Skip to content

Instantly share code, notes, and snippets.

@bahamas10
Created July 30, 2013 05:12
Show Gist options
  • Save bahamas10/6110402 to your computer and use it in GitHub Desktop.
Save bahamas10/6110402 to your computer and use it in GitHub Desktop.
download all yugioh the abridged series

run with an argument specifying the starting point site, or no arguments for the main series. videos save to current dir

dave @ [ manilla :: (Darwin) ] ~/temp/yugioh $ ./getyugioh.sh 'http://yugiohabridged.com/?p=videos&t=movies'


---- Yu-Gi-Oh: The Abridged Movie ----

> page link = http://yugiohabridged.com/lib/load.php?V=AYGuuAQC
> video link = http://blip.tv/play/AYGuuAQC.html?p=1
> video id = 2857888
> blip url = http://blip.tv/file/get/2857888
> directlink = http://j43.video2.blip.tv/5710002588563/YGOTAS-yugiohmovie163.flv
> file = Yu-Gi-Oh: The Abridged Movie.flv
Yu-Gi-Oh: The Abridged Movie.flv already exists


---- Yu-Gi-Oh: The Other Abridged Movie ----

> page link = http://yugiohabridged.com/lib/load.php?V=AYGuuCgC
> video link = http://blip.tv/play/AYGuuCgC.html?p=1
> video id = 2857924
> blip url = http://blip.tv/file/get/2857924
> direct link = http://j41.video2.blip.tv/5500002590553/YGOTAS-wardragons382.flv
> file = Yu-Gi-Oh: The Other Abridged Movie.flv
Yu-Gi-Oh: The Other Abridged Movie.flv already exists


---- SPOOF MOVIE NO JUTSU~! ----

> page link = http://yugiohabridged.com/lib/load.php?V=AYK09CUC
> video link = http://blip.tv/play/AYK09CUC.html?p=1
> video id = 5061057
> blip url = http://blip.tv/file/get/5061057
> direct link = http://j69.video2.blip.tv/14200008506173/YGOTAS-SPOOFMOVIENOJUTSU526.avi
> file = SPOOF MOVIE NO JUTSU~!.avi
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
 22  682M   22  156M    0     0   648k      0  0:17:57  0:04:07  0:13:50  617k
#!/usr/bin/env bash
l=${1:-http://yugiohabridged.com/?p=videos&t=ygotas}
links=$(curl -sS "$l" | grep '<a name')
while read link; do
pagelink=$(perl -nle '/href="([^&]+)&/ && print $1' <<< "$link")
title=$(perl -nle '/name="([^"]+)"/ && print $1' <<< "$link")
echo -e "\n\n---- $title ----\n"
echo "> page link = $pagelink"
vidlink=$(curl -sS "$pagelink" | grep iframe | perl -nle '/src="([^"]+)"/ && print $1')
echo "> video link = $vidlink"
id=$(curl -sS "$vidlink" | egrep -o 'file=http[^&]+' | sed -e 's/.*%2F//g')
echo "> video id = $id"
blipurl=http://blip.tv/file/get/$id
echo "> blip url = $blipurl"
html=$(curl -Ssi "$blipurl")
link=$(perl -nle '/"direct_url":"([^"]+.flv)"/ && print $1' <<< "$html")
[[ -z "$link" ]] && link=$(perl -nle '/"direct_url":"([^"]+.avi)"/ && print $1' <<< "$html")
echo "> direct link = $link"
file=$title.${link##*.}
echo "> file = $file"
if [[ -f "$file" ]]; then
echo "$file already exists"
else
curl -L "$link" -o "$file"
fi
done <<< "$links"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment