This guide make use of a perl script called youtube-viewer
https://github.com/trizen/youtube-viewer
It performs searches directly from terminal; these are youtube options:
Code: Select all
all : play all the results in order
next : go to the next page (same as <ENTER>)
back : return to the previous page
login : will prompt you for login
logout : will delete the authentication key
[integer] : play the corresponding video
i, info [i] : show more informations about one video
c, comments [i] : show video comments (e.g.: c 19)
r, related [i] : show related videos (e.g.: r 6)
v, videos [i] : show author's latest videos
p, playlists [i] : show author's latest playlists
subscribe [i] : subscribe to author's channel
like, dislike [i] : like or dislike a video
fav, favorite [i] : favorite a video (e.g.: fav 3)
[keywords] : search for youtube videos
3-8, 3..8 : same as 3 4 5 6 7 8
8 2 12 4 6 5 1 : play the videos in your order
-argv -argv2=v : set some arguments (e.g.: -u=google)
e, edit-config : edit and apply the configuration
load-config : (re)load the configuration file
/my?[regex]*$/ : play videos matched by a regex (/i)
reset, reload : restart the application
q, quit, exit : close the application
1) Obviously, first of all install the script; it's a single file to put in /usr/bin and give execution permission
2) The script requires two perl modules:
- libwww-perl (from repos)
- XML::Fast : unfortunately it isn't in repos so you have to install it manually through cpan; the command is:
Code: Select all
sudo cpan -i XML::Fast
3) Now the tricky part; youtube-viewer uses mplayer as default. Since it has, atm, the problems we all know, we must revert to omxplayer; the easiest way is to edit a single line of the script:
Code: Select all
system @mplayer_line, $streaming;
Code: Select all
#system @mplayer_line, $streaming;
system 'omxplayer', $streaming;
Code: Select all
#!/bin/bash
/usr/bin/omxplayer -o hdmi $1
Code: Select all
system 'my_omxplayer_launcher', $streaming;
Code: Select all
system 'setterm -blank force';
system 'omxplayer', $streaming;
system 'setterm -blank poke';
Giuseppe