jole
Posts: 4
Joined: Thu Jun 14, 2012 8:17 am
Location: Edmonton, AB
Contact: Website

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

Thu Jun 14, 2012 8:22 am

Got it working, this is awesome!

lenod
Posts: 21
Joined: Wed May 23, 2012 3:57 pm

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

Fri Jun 15, 2012 4:35 pm

Amazing!

I only have issues when playing really high quality youtube videos. Is there anything i can do about it? Like changing my ram split (currently 128/128) or is there a way to chose the quality of the video?

texy
Forum Moderator
Forum Moderator
Posts: 5094
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

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

Fri Jun 15, 2012 4:48 pm

Experiment and report back!

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

lenod
Posts: 21
Joined: Wed May 23, 2012 3:57 pm

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

Fri Jun 15, 2012 6:17 pm

In fact I was in 192 (which is in fact the standard). I tried the 128/128 split and it is a bit smoother, but still not really usable (stops every 10secs instead of 3 ;)). So i go back to the default split.

More preceisely, I have troubles with some 720p mp4 videos.

youtube-dl allows to select the format of the video with the '-f' option and the code given by this table :
[img]http://howto.blbosti.com/wp-content/upl ... -types.png
[/img]
(all formats under 720p play great and are not all that dirty even on a large screen)

It is easy to adapt the yt python script to select the right format, but the available formats varies over the videos.

Given that youtube -F allows to list the available formats for the video it would be useful to allow the user to choose the desired format (for decoding or for bandwith reasons) in the ncurses interface, but I'm good enough with python to do that ;)

marktbaldridge
Posts: 23
Joined: Tue Feb 21, 2012 4:58 am

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

Fri Jun 15, 2012 6:22 pm

lenod wrote:Given that youtube -F allows to list the available formats for the video it would be useful to allow the user to choose the desired format (for decoding or for bandwith reasons) in the ncurses interface, but I'm good enough with python to do that ;)
Hey! You want to make a little project out of this? I'll help. :D I'm not a python genius, but I'm alright. I'm serious, man, let's do it! :)

lenod
Posts: 21
Joined: Wed May 23, 2012 3:57 pm

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

Fri Jun 15, 2012 6:39 pm

Ok, i'm in ;)
Let's do a repo (which one, hosted where ? on a pi ? :D).
I already have a quick fix for the quality.

marktbaldridge
Posts: 23
Joined: Tue Feb 21, 2012 4:58 am

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

Fri Jun 15, 2012 6:49 pm

lenod wrote:Ok, i'm in ;)
Let's do a repo (which one, hosted where ? on a pi ? :D).
I already have a quick fix for the quality.

Yay!

It really should be hosted on a pi! :P A Pi Server. or should it be a Pi Waiter? ;)

For now, let's fork yt on github. And what do you think about putting the youtube-dl script right in our install tree? It'd save a step in the install for folks, and it's small enough...

User avatar
FeersumEndjinn
Posts: 148
Joined: Mon Nov 21, 2011 4:02 pm

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

Mon Jun 25, 2012 4:00 pm

Interestingly enough, this works perfectly fine on wheezy with mplayer - I'm not even using omxplayer?
Morrolan / FeersumEndjinn

"And the lord God said unto John, 'Come forth and receive eternal life', but John came fifth and won a toaster."

marktbaldridge
Posts: 23
Joined: Tue Feb 21, 2012 4:58 am

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

Mon Jun 25, 2012 5:38 pm

FeersumEndjinn wrote:Interestingly enough, this works perfectly fine on wheezy with mplayer - I'm not even using omxplayer?

Interesting. Are you running an X session? And are you sure you're getting hardware acceleration?

BenWiley4000
Posts: 100
Joined: Sun Jun 24, 2012 1:36 am

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

Wed Jun 27, 2012 10:35 pm

Thanks so much for this! It's wonderful.

BenWiley4000
Posts: 100
Joined: Sun Jun 24, 2012 1:36 am

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

Thu Jun 28, 2012 3:27 am

One question, is there a way to bring up more search results

lenod
Posts: 21
Joined: Wed May 23, 2012 3:57 pm

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

Mon Jul 02, 2012 9:19 am

I think the number of search results only depends on the number of lines in your terminal/console. How could we display more? with two columns?

User avatar
coffe
Posts: 4
Joined: Sun Jul 01, 2012 8:36 pm

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

Wed Jul 04, 2012 7:04 pm

Hi!

I really like this idea. Love it!
Unfortunately i keep getting this error:


-------------------------------------------------------------------------------------------

pi@raspberrypi ~ $ yt
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 13] Permission denied

-------------------------------------------------------------------------------------------

Please, what am i doing wrong?
(and yes, my knowledge in English is not that good. :D dyslexia and all that jazz )

Nr90
Posts: 216
Joined: Sat Nov 26, 2011 12:39 pm

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

Wed Jul 04, 2012 8:12 pm

Excellent how to!
Thanks!

lenod
Posts: 21
Joined: Wed May 23, 2012 3:57 pm

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

Thu Jul 05, 2012 7:50 am

coffe wrote:Hi!

I really like this idea. Love it!
Unfortunately i keep getting this error:


-------------------------------------------------------------------------------------------

pi@raspberrypi ~ $ yt
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 13] Permission denied

-------------------------------------------------------------------------------------------

Please, what am i doing wrong?
(and yes, my knowledge in English is not that good. :D dyslexia and all that jazz )
It looks like you don't have the permission to execute youtube-dl. First check that you installed it correctly and try to run it and see if you have a "permission denied" error. (maybe you missed a "chmod +x").

User avatar
coffe
Posts: 4
Joined: Sun Jul 01, 2012 8:36 pm

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

Mon Jul 09, 2012 5:50 pm

lenod wrote: It looks like you don't have the permission to execute youtube-dl. First check that you installed it correctly and try to run it and see if you have a "permission denied" error. (maybe you missed a "chmod +x").
YES!
Forgot that part. Now i am enjoining youtube on my rasp.
This will make my wife understand why i bought it ;)

Thanx!

gtvfan
Posts: 2
Joined: Sun Jul 15, 2012 6:51 pm

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

Sun Jul 15, 2012 7:42 pm

I am currently able to run youtube-dl successfully and launch yt and even search. As soon as I make a selection, I receive this error: RuntimeError: Error getting URL. Any help would be most appreciated, thanks!

[root@pi ~]# yt
Traceback (most recent call last):
File "/usr/bin/yt", line 9, in <module>
load_entry_point('whitey==0.1', 'console_scripts', 'yt')()
File "/usr/lib/python2.7/site-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 16, in main
ui.run()
File "/usr/lib/python2.7/site-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/lib/python2.7/site-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 100, in _curses_main
self._run_pager()
File "/usr/lib/python2.7/site-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 227, in _run_pager
self._play_video(c - ord('1'))
File "/usr/lib/python2.7/site-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 254, in _play_video
play_url(url)
File "/usr/lib/python2.7/site-packages/whitey-0.1-py2.7.egg/yt/__init__.py", line 361, in play_url
raise RuntimeError('Error getting URL.')
RuntimeError: Error getting URL.

gtvfan
Posts: 2
Joined: Sun Jul 15, 2012 6:51 pm

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

Sun Jul 15, 2012 8:28 pm

Fixed my own problem, apparently a simple sim link from /usr/bin/python to /usr/bin/python2.7 was all that was needed.

BenWiley4000
Posts: 100
Joined: Sun Jun 24, 2012 1:36 am

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

Wed Jul 18, 2012 3:49 am

what can I change to put a black background behind videos? it appears to call omxplayer w/o the proper script

raha0007
Posts: 8
Joined: Wed Jul 18, 2012 10:16 am

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

Thu Jul 26, 2012 2:16 pm

It didnt work 100% for me but I can copy the video links from the browser, then download them in the console and watch them with omxplayer until they stop prematurely.

sahunt83
Posts: 8
Joined: Sat Jul 28, 2012 6:48 pm

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

Sat Jul 28, 2012 7:15 pm

I am using arch so I downloaded the whitey tarball from https://aur.archlinux.org/. (youtube-dl is available in community 'pacman -S youtube-dl')

After extracting the tarball, I did the typical arch install with 'makepkg -s' and then 'pacman -U whitey-0.1-2-any.pkg.tar.xz'. But I didn't edit the __init__.py file.

After reboot I ran 'yt' and tried playing a video and got the following error: 'OSError: [Errno 2] No such file or directory'. So I just edited the __init__.py at this point replacing mplayer with omxplayer and using the '-ohdmi' option.

The error told me where the file was:
vi /usr/lib/python2.7/site-packages/yt/__init__.py

After that it worked like a charm. If anyone knows what file I need to edit in in the whitey package build folder so that the it installs with omxplayer I'd like to know. Thanks.

BenWiley4000
Posts: 100
Joined: Sun Jun 24, 2012 1:36 am

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

Sat Jul 28, 2012 7:47 pm

coffe wrote:Hi!

I really like this idea. Love it!
Unfortunately i keep getting this error:


-------------------------------------------------------------------------------------------

pi@raspberrypi ~ $ yt
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 13] Permission denied

-------------------------------------------------------------------------------------------

Please, what am i doing wrong?
(and yes, my knowledge in English is not that good. :D dyslexia and all that jazz )
sorry for waiting so long to get back-- I think it would be great to have a scrollable interface, like when you open up a man or like elinks.

Ben

donprius
Posts: 3
Joined: Sun Feb 26, 2012 7:40 pm

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

Sat Aug 18, 2012 5:43 pm

I had the same list of errors as robot funk which seem to indicate some font encoding issue (UTF versus Latin, maybe?) in the code. I had given up and moved on.
Last night, my son was visiting and tried yt, and now it's working! The things I remember having done since installing yt and now are-
1. I ran sudo apt-get updates, but I don't remember anything being updated.
2. Chromium was installed. (Instructions in posting http://www.raspberrypi.org/phpBB3/viewtopic.php?p=127887#p127887)
3. The lynx browser was installed.(sudo apt-get install lynx)

Now yt works, but videos end a bit prematurely as others have reported. Still, it's a lot of fun seeing Youtube videos using the Raspberry Pi.

Much thanks to marktbaldridge, the other forum members, the RPi community and the Foundation. I love my Raspberry Pi!

chopperdave
Posts: 2
Joined: Sun Aug 19, 2012 4:40 pm

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

Sun Aug 19, 2012 5:12 pm

I'm donprius's son, and I was also having trouble with this. Unfortunately, I didn't copy the error messages, but they weren't the same as any of the others here.

This morning I did a fresh install of the recommended image, followed the directions here, and it just worked!

I only deviated from the instructions in these ways:

*changed "cp youtube-dl /usr/bin/youtube-dl" to "sudo cp youtube-dl /usr/bin/youtube-dl"
*followed nommo's instructions about audio over hdmi.

Thanks for the great tutorial!

chopperdave
Posts: 2
Joined: Sun Aug 19, 2012 4:40 pm

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

Mon Aug 20, 2012 12:14 am

I was having the same problem as donprius with videos being truncated, but that was fixed by:

Code: Select all

sudo apt-get update && sudo apt-get install omxplayer
to install the latest version.

Sadly, my internet connection is too slow to play 1080 videos smoothly, but using youtube-dl to download them ahead of time and then omxplayer after they're done downloading works a treat!

Return to “Media centres”

Who is online

Users browsing this forum: No registered users and 11 guests