Created
April 13, 2017 21:08
-
-
Save etra0/67a002ecb954b4811762f190e8214112 to your computer and use it in GitHub Desktop.
This script was made to navigate through the chapters of a serie without opening crunchyroll in the browser.
This file contains 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 | |
# This script was made to get the link of a chapter without surfing through | |
# crunchyroll, so it's ideal if you want to use streamlink to watch the anime. | |
# First parameter always has to be the name of the serie. | |
main_url="http://www.crunchyroll.com/$1" | |
episodes="`curl -s $main_url|egrep -o '/episode-.*?\"'|sed 's/"//g'`" | |
if [ -z $2 ]; then | |
for episode in $episodes; do | |
echo $episode | |
done | |
echo "Escoga el capítulo" | |
read chapter | |
else | |
chapter=$2 | |
fi | |
for episode in $episodes; do | |
if [ `echo $episode | perl -pe 's/\/episode-(\d+).*/$1/g'` == "$chapter" ]; then | |
selected=$episode | |
fi | |
done | |
echo "$main_url$selected" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
bash ./link_crunchyroll name_serie [chapter]
This script is useful with streamlink, one example of execution:
bash ./link_crunchyroll miss-kobayashis-dragon-maid 12 | xargs streamlink
The name of the serie has to be separated by "-".