Skip to content

Instantly share code, notes, and snippets.

@assafmo
Last active January 14, 2018 10:18
Show Gist options
  • Save assafmo/ecaba43fdaee552d9c598f05dca028a9 to your computer and use it in GitHub Desktop.
Save assafmo/ecaba43fdaee552d9c598f05dca028a9 to your computer and use it in GitHub Desktop.
Download and unzip subtitles from wizdom.xyz (also script to get imdb_id from show/movie name)
#!/bin/sh
name="$1"
curl -s --compressed "https://duckduckgo.com/?q=%5Cimdb $name" | grep -oP 'tt[0-9]+' | head -1
#!/bin/sh
imdb_id="$1"
search_regex="$2"
curl --compressed -s "http://json.wizdom.xyz/$imdb_id.json" | \
jq . | \
grep -Ei -B 1 "$search_regex" | \
awk -F '"' '/"id"/{print $4}' | \
parallel 'curl --compressed -s "http://zip.wizdom.xyz/{}.zip" > {}.zip; unzip -o {}.zip; rm -f {}.zip'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment