Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
error with youtube search if running python code directly #3489
Comments
|
Your version of youtube-dl is outdated (plus, you seem not to actually have the linked post), since youtube-dl seems to be installed with apt-get or pip. Try git clone git://github.com/rg3/youtube-dl
(cd youtube-dl && git pull) # If you already have youtube-dl installed in the current directory
sudo ln -sf $(pwd)/youtube-dl/bin/youtube-dl /usr/bin/youtube-dlAfter that, you can update with a simple |
|
I have a version from git and updated it with git pull |
|
Excellent! So does it work now? |
|
no. I was using that git version all along. |
|
Can you humor me and post the output you get when running
|
|
Problem solved. I had an old version in the python dist directory. After removing that and creating a link to main.py it's now working. I'll update my tutorial in the Raspberry Pi forum accordingly. |
I prefer to use youtube-dl directly from python code on the Raspberry Pi for speed resaons (see http://www.raspberrypi.org/forums/viewtopic.php?f=38&t=83763 ).
This approach does not work with youtube search (but using the binary it works!). Verbose output:
youtube-dl -g --verbose 'https://www.youtube.com/results?search_query=raspberry+pi'
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-g', '--verbose', 'https://www.youtube.com/results?search_query=raspberry+pi']
[debug] Encodings: locale 'UTF-8', fs 'UTF-8', out 'UTF-8', pref: 'UTF-8'
[debug] youtube-dl version 2013.12.26
[debug] Python version 2.7.3 - Linux-3.12.25+-armv6l-with-debian-7.6
[debug] Proxy map: {}
ERROR: Unable to download webpage: HTTP Error 403: Forbidden; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.
File "/usr/lib/python2.7/dist-packages/youtube_dl/extractor/common.py", line 182, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1070, in urlopen
return self._opener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 407, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 445, in error
return self._call_chain(_args)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(_args)
File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)