Last active
January 5, 2019 19:29
-
-
Save assafmo/1ba208c9ca9cf93553ec9c4ef134bf1f to your computer and use it in GitHub Desktop.
Download subtitles from addic7ed for an episode & delete hearing impaired help
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sudo npm install -g ad7 | |
file="$1" | |
( | |
cd $(dirname "${file}") | |
ad7 --show "$(basename "${file}" | grep -Pio '.+?S\d\dE\d\d' | sed -r 's/\.(s|S)[0-9]{2}(e|E)[0-9]{2}//')" \ | |
--s "$(basename "${file}" | grep -Pio 'S\d\dE\d\d' | awk -F '(S|s)|(E|e)' '{print $2}')" \ | |
--e "$(basename "${file}" | grep -Pio 'S\d\dE\d\d' | awk -F '(S|s)|(E|e)' '{print $3}')" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment