

The fantastic YouTube-dl team - vmorgulis
http://rg3.name/201408141628.html

======
schoen
Previous HN discussion of youtube-dl, including its remarkable contributor
community and frequency of updates:

[https://news.ycombinator.com/item?id=8647943](https://news.ycombinator.com/item?id=8647943)

------
snorrah
YouTube-dl and livestreamer are probably my personal favourite examples of
open source code. Almost invaluable in getting around the flash-based monopoly
of online video, they are both still highly useful in simply watching video in
a preferred/favourite media player rather than some browser player UI.

~~~
gluelogic
I agree. I have a lot of respect for youtube-dl. Great software.

------
userbinator
I personally use
[http://www.jwz.org/hacks/youtubedown](http://www.jwz.org/hacks/youtubedown)
\- it's probably much less featureful than YouTube-dl, but it's a single
script, easily hackable, and does what I need. In contrast, YTDL seems to have
grown into a generic "video site downloader".

~~~
101914
I wrote my own. I can change it faster when YouTube changes something than
waiting for someone else. YouTube makes downloading very straightforward. No
need for Perl, Python or any interpreter except sh.

    
    
      # 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"
      esac

------
bossx
Do these tools violate the YouTube TOS?

Has 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.

~~~
userbinator
_Do these tools violate the YouTube TOS?_

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...

------
vmorgulis
I noticed that youtube-dl now converts the webm to mp4 with ffmpeg after the
download.

It tries also to merge similar files to an mkv (not sure).

~~~
snorrah
There's a wealth of options to control this. I prefer going with MP4 for
various reasons except if the source is available as a 1440p 60fps file, which
I think is Webm only right now. Mix and match to your hearts content!

