Created
May 18, 2020 16:05
-
-
Save joeheyming/3d05024c1d471ec43acc3aaf7eeb6ae5 to your computer and use it in GitHub Desktop.
Download all the simpsons episodes
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 | |
LINKS=$(curl --silent http://pixa.club/en/the-simpsons/ | grep -E 'href="/en/the-simpsons/season-[0-9]+/epi' | tr -d ' ' | awk -F'"' '{print $2}' | gsort --version-sort | tail -n+250 ) | |
# echo "LINKS = $LINKS" | |
cd ~/simpsons; | |
# exit 1 | |
set -x | |
for link in $LINKS; do | |
echo $link; | |
season=$(basename $(dirname $link)); | |
echo "season = $season" | |
video=$(curl --silent http://pixa.club$link | grep -o '<video .*src=.*>' | sed -e 's/<video .*src=['"'"'"]//' -e 's/["'"'"'].*$//' -e '/^$/ d'); | |
echo "video = $video" | |
name=$(basename $video) | |
if [ ! -d ~/simpsons/$season ]; then | |
mkdir -p ~/simpsons/$season/; | |
fi | |
if [ ! -f ~/simpsons/$season/$name ]; then | |
curl "http://pixa.club$video" -H 'Referer: http://pixa.club/en/the-simpsons/season-1/epizod-3-homer-s-odyssey-the-simpsons' -H 'Accept-Encoding: identity;q=1, *;q=0' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36' -O $name | |
mv $name ~/simpsons/$season/ | |
fi | |
done; |
it was a web crawler for the pixa.club site, but it seems to have changed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
is this code meant to spit out Simpsons episodes?