The fantastic YouTube-dl team
rg3.name
rg3.name
# requirements:
# sh, sed (BSD ok), tr, openssl, ftp or some other httpclient
curl=ftp
file=${2-1.mp4} # default outfile
# itag #s are on the wikipedia page for youtube
case $# in
[12])
{
sed 's/http:/https:/' \
|while read a;
do
b=${a#*://};
c=${b%%/*};
{
printf "%b" "GET /${a#https://*/} HTTP/1.0\r\n";
printf "Host: $c\r\n";
printf "User-Agent: OK, Google.\r\n";
printf "Connection: close\r\n\r\n";
} \
|openssl s_client -ign_eof -connect $c:443 -verify 9
done \
|sed '
s,http,\
&,g;
' \
|sed '
/%3A%2F/!d;
/videoplayback/!d;
s,%3D,=,g;
s,%3A,:,g;
s,%2F,/,g;
s,%3F,?,g;
s/^M//g;
' \
|sed -e '
s/&itag=5//;t1
s/&itag=1[78]//;t1
s/&itag=22//;t1
s/&itag=3[4-8]//;t1
s/&itag=4[3-6]//;t1
s/&itag=1[346][0-9]//;t1
' -e :1 \
|sed '
s,%26,\
,g;
s,&,\
,g;
' \
|sed 's/%25/%/g' \
|tr '\012' '&' \
|sed 's/&$//';
echo
} \
|sed '
s,%3D,=,g;
s,%3A,:,g;
s,%2F,/,g;
s,%3F,?,g;
s/^M//g;
' \
|sed '
s/&https/\
\
https/g;' \
|sed 's/\\u0026.*//' \
|sed '/itag='"${1-.}"'/!d;'|{
read a;
exec $curl -4o $file $a;}
;;
*)
exec echo \
"usage: $0 itagno [outfile]
outfile: $file"
esacHas anyone found a solution for building your own YouTube powered mobile app with Chromecast support? It seems the only way to do this is to use a tool like this to cast the raw video URL.
They do, but it's not like YT can do anything about it except adding some obfuscation and changing that periodically. If it can be viewed on one machine, it can also be recorded. Hence the War on General-Purpose Computing.
I still remember when all you needed to do to download was change "watch?v=" into "get_video?video_id=" in the URL...
It tries also to merge similar files to an mkv (not sure).