add iot paper
[martlubbers.net.git] / archive / youtube-term.html
1 <html>
2 <head>
3 <title>Play youtube videos on a headless server</title>
4 <link href="style.css" rel="stylesheet" type="text/css">
5 </head>
6 <body>
7 Download the get_flash_videos latest version:
8 <pre>$ git clone https://github.com/monsieurvideo/get-flash-videos.git</pre>
9 Install the dependencies:
10 <pre># apt-get install perl libmodule-find-perl libwww-mechanize-perl vlc</pre>
11 Install the get_flash_videos script:
12 <pre>
13 $ cd get-flash-videos/
14 $ make
15 $ make install
16 </pre>
17 Create a small script that combines these with vlc by adding this to bashrc or a shellscript in PATH the flag -A alsa could be different(when usig pulseaudio it can be omitted):
18 <pre>
19 function ytview {
20 if [ "$#" -ne "1" ]; then
21 echo "usage $0 yturl"
22 else
23 get_flash_videos -q -f - $1 | cvlc -A alsa -V aa -
24 fi
25 }
26 </pre>
27 Play a video by typing:
28 <pre>$ ytview http://www.youtube.com/watch?v=QAUzWtLMnU0</pre>
29 Some videos can't be downloaded, but most videos will just work.
30 </body>
31 </html>