Skip to content

Instantly share code, notes, and snippets.

@assafmo
Last active January 14, 2018 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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'
@assafmo
Copy link
Author

assafmo commented Sep 25, 2017

E.g. ./wizdom.sh tt0944947 s05 will download all of GOT S05 subtitles

@assafmo
Copy link
Author

assafmo commented Sep 25, 2017

The scripts can be combined but the imdb one cannot be trusted IMO (./wizdom.sh $(./imdb.sh 'the+big+bang+theory') s10e20)

@assafmo
Copy link
Author

assafmo commented Jan 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment