livestreamer: 503 error from Youtube
Every time I try to watch a youtube video the following message appears:
breadmaker@hostname:~$ livestreamer youtube.com/watch?v=tufY_UfHsow best
[cli][info] Found matching plugin youtube for URL youtube.com/watch?v=tufY_UfHsow
error: Unable to open URL: http://youtube.com/get_video_info (503 Server Error: Service Unavailable for url: http://ipv4.google.com/sorry/IndexRedirect?continue=http://youtube.com/get_video_info%3Fel%3Dplayer_embedded%26video_id%3DtufY_UfHsow&q=CGMSBL5fLXQYw9C2uAUiGQDxp4NLDKn_kPXhn7B7vUfn3HF6NlghoBoqSWh0dHA6Ly95b3V0dWJlLmNvbS9nZXRfdmlkZW9faW5mbz9lbD1wbGF5ZXJfZW1iZWRkZWQmdmlkZW9faWQ9dHVmWV9VZkhzb3c)
For the record, the video can be watched via broswer without problems.
Using livestreamer 1.12.2 with Debian 3.16.7-ckt25-2 (2016-04-08) x86_64 GNU/Linux
About this issue
- Original URL
- State: open
- Created 8 years ago
- Reactions: 3
- Comments: 44
If use proper user-agent string, then it is accepted and working again! https://github.com/nitpicker/livestreamer/commit/d5d814fbf673c8bf62c5d34cfed824f8088e30a4
Save https://raw.githubusercontent.com/nitpicker/livestreamer/d5d814fbf673c8bf62c5d34cfed824f8088e30a4/src/livestreamer/plugins/youtube.py to your livestream plugin folder
Is it a profit or law issue??
[Edited] For guy who is unfamiliar with python, there is pre-built one at https://github.com/nitpicker/livestreamer/releases/download/untagged-781898b0704c7ac99ca2/livestreamer-1.12.2.win-amd64.zip (Python 2.7/Windows x64)
Quicker solution: Run as:
livestreamer --http-header "User-Agent"="UA" https://www.youtube.com/watch?v=123Where UA is a user agent string, such as that which appears at http://whatsmyuseragent.com/
This error comes because YouTube treats livestreamer’s HTTP requests as bot requests. The ipv4.google.com address that comes out with the error is a redirect to a captcha page. As far as I know there is no way for livestreamer to prompt a user to solve the captcha. Using a recognised user agent solves this problem.
Windows version has the .py files compiled into .pyc files. For any updates (for example, this update for Youtube) you will have to compile the youtube.py into a youtube.pyc to make it work.
Date: Wed, 13 Apr 2016 10:46:33 -0700 From: notifications@github.com To: livestreamer@noreply.github.com Subject: Re: [chrippa/livestreamer] 503 error from Youtube (#1284)
@nitpicker found that folder here: C:\Program Files (x86)\Livestreamer\livestreamer-1.12.2-py2.7.egg\livestreamer\plugins but it got .pyc files in it.
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub
@tobilektri I compiled the .py file with Python. It wouldn’t let me upload a .pyc file, so I changed the extension to .txt. Be sure to change it back to .pyc
youtube.txt
Will this be merged into master?
@JackSaat , maybe it’s in
<python dir>\Lib\site-packages\<livestreamer-x.yy.z-py2.7.egg>\livestreamer\plugins.