jfnichols
Posts: 1
Joined: Thu Aug 23, 2012 12:12 am

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Thu Aug 23, 2012 12:35 am

robotfunk wrote: UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 12: ordinal not in range(128)
I got the same error. I fixed the issue by making changing my locale to "en_US.utf-8" rather than just "en_US"

rjm27trekkie
Posts: 6
Joined: Wed Aug 15, 2012 10:45 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Fri Aug 24, 2012 9:31 pm

It stops the vids early

matbos
Posts: 64
Joined: Thu Aug 16, 2012 3:29 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Fri Aug 31, 2012 5:29 pm

Is there any way to make the resolution lower?
i have a slow internet connection.
:?

SB2020
Posts: 10
Joined: Thu Sep 06, 2012 1:34 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Thu Sep 06, 2012 2:10 pm

First off, thanks for this HOWTO. It's great to watch youtube on the telly without being distracted by comments and 'the next most interesting vid in the side bar' :)

Like others I am seeing vids cut off a few seconds early - I tried to update Omxplayer but it reports it's the latest version and the problem persists. Any more ideas?

Finally I'd love to create playlists and/or access my youtube accounts' playlists, subscriptions and channels. Is this possible? When I tried logging in with the 'user' option the app crashed out with errors. Does it require youtube username or (as I tried) email address?

Thanks again - this has elevated the status of the R-Pi in the eyes of my kids!

henle
Posts: 65
Joined: Sat Apr 21, 2012 7:23 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Fri Sep 07, 2012 1:57 pm

SB2020 wrote: Like others I am seeing vids cut off a few seconds early - I tried to update Omxplayer but it reports it's the latest version and the problem persists. Any more ideas?
This should be fixed in the very latest version, you can get it at http://omxplayer.sconde.net/, or wait for it to appear in the repository.

SB2020
Posts: 10
Joined: Thu Sep 06, 2012 1:34 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Sun Sep 09, 2012 8:22 am

This should be fixed in the very latest version
Just confirming that it is indeed fixed. Many Thanks.

I've realised now that the 'user' option in yt is for searching by uploader rather than logging into accounts :oops:

Would still love to be able to create or access playlists if anyone has ideas for this?

nfx
Posts: 3
Joined: Wed May 30, 2012 6:55 am

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Mon Sep 10, 2012 5:02 pm

robotfunk wrote:Here's the error I get when I run yt on the Pi itself:

Traceback (most recent call last):
File "/usr/local/bin/yt", line 9, in <module>
load_entry_point('whitey==0.1', 'console_scripts', 'yt')()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 16, in main
ui.run()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 56, in run
curses.wrapper(self._curses_main)
File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 99, in _curses_main
self._update_screen()
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 157, in _update_screen
self._add_table_row(self._help, 0, 0, w-1, self._bar_attr, max_width=16, win=self._help_bar)
File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 334, in _add_table_row
win.addstr(y, x, truncate('%s:%s' % (k,v), min(w-x, cell_w)).encode(self._code), attr)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 12: ordinal not in range(128)

I wouldn't worry too much about it, I don't have an urgent need to play youtube from the Terminal, just wanted to share the results...
maybe a late answer but you should put "export LANG=en_US.utf-8" to your ~/.profile

Jeepman8098
Posts: 2
Joined: Wed Sep 12, 2012 7:29 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Wed Sep 12, 2012 7:40 pm

Can someone help another noob? I followed the guide and have everything needed installed now. I have tried opening yt in X using lxterminal and no luck. It appears to work and talks to youtube and pulls a list of video's however when I select say #6 it shows playing http:\\youtub.com\andabunchofstuff and then talking to youtube. That is as far as it gets and no video appears and no errors.

Am I missing somthing simple? :oops:

User avatar
Licaon_Kter
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Wed Sep 12, 2012 11:24 pm

try a smaller video, say search for "nyan cat" and play video number 1
also, you are using the 192/64 memory spilt or ? ( run in a terminal: free -h and on the first line it should say Mem: 183 or smaller )

also, try from the console too

Code: Select all

press CTRL-ALT-F1
sudo service stop lxdm
yt
( once you are done testing, run startx to get back to the X server... the one with the GUi )
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)

esseti
Posts: 5
Joined: Thu Sep 13, 2012 9:45 am

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Thu Sep 13, 2012 9:48 am

Hello all.
it works! thanks. only a couple of things.
- the video does not play full screen. (a part of the screen is not filled by the video, how can i've black screen in the back?)
- how can i select the quality of the vide? i tried to play an hd file from YT but it played the lower quality (i should switch the quality but i don't know how to do that).
- how to stop the video. i got how to play it but not how to stop and/or close the video (closing the terminal is the only way i found :D).

Jeepman8098
Posts: 2
Joined: Wed Sep 12, 2012 7:29 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Thu Sep 13, 2012 7:47 pm

Licaon_Kter wrote:try a smaller video, say search for "nyan cat" and play video number 1
also, you are using the 192/64 memory spilt or ? ( run in a terminal: free -h and on the first line it should say Mem: 183 or smaller )

also, try from the console too

Code: Select all

press CTRL-ALT-F1
sudo service stop lxdm
yt
( once you are done testing, run startx to get back to the X server... the one with the GUi )
I tried all of your ideas and nothing changed. I am running with the default installation of wheezy with no change to memory settings.

TheKinkySoup
Posts: 1
Joined: Sat Sep 15, 2012 8:13 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Sat Sep 15, 2012 8:22 pm

Jeepman8098 wrote: I tried all of your ideas and nothing changed. I am running with the default installation of wheezy with no change to memory settings.
Hi there, I've just played with this, no doubt the tutorials are great, but the mileage seems to vary. For me, I used
1) Thread starter's YT + his modified version
2) latest build omxplayer from http://omxplayer.sconde.net/

Like you, I have tried everything, but YT seems to have sound but no video. Hence I tried to look at it by part. First I tested omxplayer to make sure that it's working. Then I caught the culprit. omxplayer ain't playing the video, just music. Googled a little and found no solution. Went to tinker with the memory split. Went for 128/128 and omxplayer started playing the video! Went over to check YT and it's working too.

I guess that's one of the key detail missing. Perhaps it's assumed that people who bothered to play with Pis should know this? Haha.

walax
Posts: 7
Joined: Wed Sep 19, 2012 6:55 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Thu Sep 20, 2012 10:34 am

Is there any way to make it work withtout having to set the locale to any UTF8 ?

Actually with iso8859-15 (either fr_FR ou en_US), I get this error :

Code: Select all

  File "/usr/lib/python2.7/encodings/iso8859_15.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u2026' in position 12: character maps to <undefined>

User avatar
Licaon_Kter
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Mon Sep 24, 2012 3:14 pm

walax wrote:Is there any way to make it work withtout having to set the locale to any UTF8 ?
any reason not to use UTF-8?
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)

walax
Posts: 7
Joined: Wed Sep 19, 2012 6:55 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Mon Sep 24, 2012 5:47 pm

Licaon_Kter wrote:any reason not to use UTF-8?
Mainly accents (éàç) bugging in irssi if locale are in UTF-8.

Maybe i should look this way indeed.

But if anyone manages to make yt work with latin charset, tell us !

User avatar
Licaon_Kter
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Wed Sep 26, 2012 11:36 pm

oh, can you test: normal system wide use iso8859-15 or whatever suits your fancy, but when you start yt start it with LANG=fr_FR.utf8 yt
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)

starous
Posts: 9
Joined: Tue Sep 18, 2012 2:48 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Thu Sep 27, 2012 2:10 pm

Hi,

first of all thanks for this manual.
I have followed the manual step-by-step and used your modified file. When I run the command yt and choose a video the program crashes and the following msg prints

Code: Select all

Traceback (most recent call last):
  File "/usr/local/bin/yt", line 9, in <module>
    load_entry_point('whitey==0.1', 'console_scripts', 'yt')()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 16, in main
    ui.run()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 56, in run
    curses.wrapper(self._curses_main)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 100, in _curses_main
    self._run_pager()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 227, in _run_pager
    self._play_video(c - ord('1'))
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 254, in _play_video
    play_url(url)
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 357, in play_url
    yt_dl = subprocess.Popen(['youtube-dl', '-g', url], stdout = subprocess.PIPE, stderr = subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 8] Exec format error
Can you help me in solving this?

Thanks

walax
Posts: 7
Joined: Wed Sep 19, 2012 6:55 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Fri Sep 28, 2012 2:38 pm

Licaon_Kter wrote:oh, can you test: normal system wide use iso8859-15 or whatever suits your fancy, but when you start yt start it with LANG=fr_FR.utf8 yt
yt is starting, but the 3 first results do not appear.

I'm not at home actually so can't tell you if the video is playing correctly.

trinigooner
Posts: 6
Joined: Sun Sep 30, 2012 12:07 am

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Sun Sep 30, 2012 12:14 am

This is a nice howto. However, can't seem to get anything playing. No matter what number I pick, a small dialog comes up and tells me 'Playing https://blahblahblah', but then goes away after a few seconds. Where's the video?
I've even tried playing small videos like searching for 'nyan cat' like one user suggested. Still nothing. Worst of all is I don't see any error messages (do logs get written somewhere else?). Wish I could at least figure out what was going wrong.
Any ideas?

trinigooner
Posts: 6
Joined: Sun Sep 30, 2012 12:07 am

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Sun Sep 30, 2012 1:13 am

trinigooner wrote:This is a nice howto. However, can't seem to get anything playing. No matter what number I pick, a small dialog comes up and tells me 'Playing https://blahblahblah', but then goes away after a few seconds. Where's the video?
I've even tried playing small videos like searching for 'nyan cat' like one user suggested. Still nothing. Worst of all is I don't see any error messages (do logs get written somewhere else?). Wish I could at least figure out what was going wrong.
Any ideas?
k.. so I just noticed the omxplayer.log file in the directory where I launch yt. It contains an error. Here's what I see:
00:00:00 T:0 DEBUG: DllBcm: Using omx system library
00:00:00 T:0 DEBUG: DllOMX: Using omx system library
00:00:00 T:0 DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0 DEBUG: DllAvUtilBase: Using libavutil system library
00:00:00 T:0 DEBUG: DllAvCodec: Using libavcodec system library
00:00:00 T:0 DEBUG: DllAvFormat: Using libavformat system library
00:00:00 T:0 ERROR: COMXPlayer::OpenFile - avformat_open_input http://o-o---preferred---sn-jvhj5nu-p5q ... 812cfcb123

Any ideas?

trinigooner
Posts: 6
Joined: Sun Sep 30, 2012 12:07 am

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Sun Sep 30, 2012 1:26 am

Jeepman8098 wrote:Can someone help another noob? I followed the guide and have everything needed installed now. I have tried opening yt in X using lxterminal and no luck. It appears to work and talks to youtube and pulls a list of video's however when I select say #6 it shows playing http:\\youtub.com\andabunchofstuff and then talking to youtube. That is as far as it gets and no video appears and no errors.

Am I missing somthing simple? :oops:
Have the same exact problem. Could you check the omxplayer.log file that gets produced in the same directory you run yt from? Do you see an error in that file? COMXPlayer::OpenFile . Looks like a function to open the file is failing :-(

trinigooner
Posts: 6
Joined: Sun Sep 30, 2012 12:07 am

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Sun Sep 30, 2012 10:43 pm

So I've been mostly responding to myself :-) But I found the problem. My version of youtube-dl was wrong. Don't use the version mentioned in the post with the latest version of Raspian. Use this one instead: https://github.com/rg3/youtube-dl/raw/2 ... youtube-dl

cumulonix
Posts: 4
Joined: Wed Oct 03, 2012 2:24 am

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Wed Oct 03, 2012 2:37 am

I get the same error as robotfunk - (after using the __init__.py posted by marktbaldridge or, replacing mplayer with omxplayer without options and recompiling). i am running wheezy + wifi adapter, connected via SSH.
here is the error:
on typing 'yp', the interface starts and seems fully functional (search etc) till I try to play a video by pressing a number. On pressing a number, yp immediately exits with the error

Code: Select all

Traceback (most recent call last):
  File "/usr/local/bin/yt", line 9, in <module>
    load_entry_point('whitey==0.1', 'console_scripts', 'yt')()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 16, in main
    ui.run()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 56, in run
    curses.wrapper(self._curses_main)
  File "/usr/lib/python2.7/curses/wrapper.py", line 43, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 100, in _curses_main
    self._run_pager()
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 227, in _run_pager
    self._play_video(c - ord('1'))
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 254, in _play_video
    play_url(url)
  File "/usr/local/lib/python2.7/dist-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 357, in play_url
    yt_dl = subprocess.Popen(['youtube-dl', '-g', url], stdout = subprocess.PIPE, stderr = subprocess.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

trinigooner
Posts: 6
Joined: Sun Sep 30, 2012 12:07 am

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Wed Oct 03, 2012 1:36 pm

Do you have youtube-dl installed? Try typing youtube-dl from the command line. If you get an error then you need to install it and put it in /usr/bin

Code: Select all

wget https://github.com/rg3/youtube-dl/raw/2012.09.27/youtube-dl
Then install it as per the instructions on page 1:

Code: Select all

sudo chmod a+x youtube-dl
sudo cp youtube-dl /usr/bin/youtube-dl
HTH

starous
Posts: 9
Joined: Tue Sep 18, 2012 2:48 pm

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)

Wed Oct 03, 2012 2:16 pm

trinigooner wrote:Do you have youtube-dl installed? Try typing youtube-dl from the command line. If you get an error then you need to install it and put it in /usr/bin

Code: Select all

wget https://github.com/rg3/youtube-dl/raw/2012.09.27/youtube-dl
Then install it as per the instructions on page 1:

Code: Select all

sudo chmod a+x youtube-dl
sudo cp youtube-dl /usr/bin/youtube-dl
HTH
No need. I have used the internal update in youtube-dl

Code: Select all

sudo youtube-dl -U

Return to “Media centres”

Who is online

Users browsing this forum: No registered users and 6 guests