I got the same error. I fixed the issue by making changing my locale to "en_US.utf-8" rather than just "en_US"robotfunk wrote: UnicodeEncodeError: 'ascii' codec can't encode character u'\u2026' in position 12: ordinal not in range(128)
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
-
- Posts: 6
- Joined: Wed Aug 15, 2012 10:45 pm
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
It stops the vids early
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
Is there any way to make the resolution lower?
i have a slow internet connection.

i have a slow internet connection.

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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!

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!
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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 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?
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
Just confirming that it is indeed fixed. Many Thanks.This should be fixed in the very latest version
I've realised now that the 'user' option in yt is for searching by uploader rather than logging into accounts

Would still love to be able to create or access playlists if anyone has ideas for this?
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
maybe a late answer but you should put "export LANG=en_US.utf-8" to your ~/.profilerobotfunk 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...
-
- Posts: 2
- Joined: Wed Sep 12, 2012 7:29 pm
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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?
Am I missing somthing simple?

- 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-)
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
( once you are done testing, run startx to get back to the X server... the one with the GUi )
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
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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
).
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

-
- Posts: 2
- Joined: Wed Sep 12, 2012 7:29 pm
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
I tried all of your ideas and nothing changed. I am running with the default installation of wheezy with no change to memory settings.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( once you are done testing, run startx to get back to the X server... the one with the GUi )Code: Select all
press CTRL-ALT-F1 sudo service stop lxdm yt
-
- Posts: 1
- Joined: Sat Sep 15, 2012 8:13 pm
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
Hi there, I've just played with this, no doubt the tutorials are great, but the mileage seems to vary. For me, I usedJeepman8098 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.
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.
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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 :
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>
- 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-)
any reason not to use UTF-8?walax wrote:Is there any way to make it work withtout having to set the locale to any UTF8 ?
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
Mainly accents (éàç) bugging in irssi if locale are in UTF-8.Licaon_Kter wrote:any reason not to use UTF-8?
Maybe i should look this way indeed.
But if anyone manages to make yt work with latin charset, tell us !
- 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-)
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!)
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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
Can you help me in solving this?
Thanks
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
Thanks
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
yt is starting, but the 3 first results do not appear.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
I'm not at home actually so can't tell you if the video is playing correctly.
-
- Posts: 6
- Joined: Sun Sep 30, 2012 12:07 am
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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?
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?
-
- Posts: 6
- Joined: Sun Sep 30, 2012 12:07 am
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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: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?
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?
-
- Posts: 6
- Joined: Sun Sep 30, 2012 12:07 am
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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 failingJeepman8098 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?

-
- Posts: 6
- Joined: Sun Sep 30, 2012 12:07 am
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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

Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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
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
-
- Posts: 6
- Joined: Sun Sep 30, 2012 12:07 am
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
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
Then install it as per the instructions on page 1:
HTH
Code: Select all
wget https://github.com/rg3/youtube-dl/raw/2012.09.27/youtube-dl
Code: Select all
sudo chmod a+x youtube-dl
sudo cp youtube-dl /usr/bin/youtube-dl
Re: HOWTO: YouTube on the Raspberry Pi - sans X B-)
No need. I have used the internal update in youtube-dltrinigooner 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
Then install it as per the instructions on page 1:Code: Select all
wget https://github.com/rg3/youtube-dl/raw/2012.09.27/youtube-dl
HTHCode: Select all
sudo chmod a+x youtube-dl sudo cp youtube-dl /usr/bin/youtube-dl
Code: Select all
sudo youtube-dl -U