Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twitch live streams fail with Error 410: Gone #25528

Closed
Salz opened this issue Jun 4, 2020 · 19 comments
Closed

Twitch live streams fail with Error 410: Gone #25528

Salz opened this issue Jun 4, 2020 · 19 comments

Comments

@Salz
Copy link

@Salz Salz commented Jun 4, 2020

Checklist

  • I'm reporting a broken site support

  • I've verified that I'm running youtube-dl version 2020.05.29

  • I've checked that all provided URLs are alive and playable in a browser
    I have my browser configured to not play videos, but the videos are alive and the attached patch fixes playback of the videos.

  • I've checked that all URLs and arguments with special characters are properly quoted or escaped

  • I've searched the bugtracker for similar issues including closed ones

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://twitch.tv/brossentia']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2020.05.29
[debug] Python version 3.8.3 (CPython) - Linux-5.6.9-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.2-1, ffprobe 4.2.2-1, rtmpdump 2.4
[debug] Proxy map: {}
[twitch:stream] brossentia: Downloading stream JSON
ERROR: Unable to download JSON metadata: HTTP Error 410: Gone (caused by <HTTPError 410: 'Gone'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
File "/usr/lib/python3/dist-packages/youtube_dl/extractor/common.py", line 627, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 2238, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)

Description

Looks like twitch removed the stream lookup by user name from the (obsolete) kraken API. Getting it by numerical user-id still works, but requires an additional request. The following patch fixes the issue:

live-api.diff.txt

@banjoman05
Copy link

@banjoman05 banjoman05 commented Jun 5, 2020

Came to report the same:

user@host:/home/user$ sudo youtube-dl -U
youtube-dl is up-to-date (2020.05.29)

user@host:/home/user$ youtube-dl https://www.twitch.tv/videos/641236111 --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'https://www.twitch.tv/videos/641236111', u'--verbose']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.05.29
[debug] Python version 2.7.12 (CPython) - Linux-4.4.0-178-generic-x86_64-with-Ubuntu-16.04-xenial
[debug] exe versions: ffmpeg 2.8.15, ffprobe 2.8.15, rtmpdump 2.4
[debug] Proxy map: {}
[twitch:vod] 641236111: Downloading vod info JSON
ERROR: Unable to download JSON metadata: HTTP Error 410: Gone (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 627, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2238, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

@GuillaumeSeren
Copy link

@GuillaumeSeren GuillaumeSeren commented Jun 5, 2020

Hey @Salz
just run into the same issue, and tested your patch on gentoo with youtube-dl-2020.05.29,
and it fix the issue, thank you for sharing it.

@nurupo
Copy link

@nurupo nurupo commented Jun 5, 2020

This is a real issue, I have started experiencing the same HTTP 410 Gone issue too. It broke sometime within the last 8 hours, worked great before. To reproduce, simply try opening any Twitch channel with youtube-dl.

Applied both this and the thumbnail patches and things work now.

@rooseveltrp
Copy link

@rooseveltrp rooseveltrp commented Jun 5, 2020

Hey @Salz
just run into the same issue, and tested your patch on gentoo with youtube-dl-2020.05.29,
and it fix the issue, thank you for sharing it.

Hey @GuillaumeSeren, can you share the exact command you used? For some reason it's rejecting the patch.

@GuillaumeSeren
Copy link

@GuillaumeSeren GuillaumeSeren commented Jun 5, 2020

@rooseveltrp sure,
copy the patch into /etc/portage/patches/net-misc/youtube-dl-2020.05.29/01-live-api.patch,
and reinstall the package emerge -av1 -j1 net-misc/youtube-dl.

@rooseveltrp
Copy link

@rooseveltrp rooseveltrp commented Jun 5, 2020

@rooseveltrp sure,
copy the patch into /etc/portage/patches/net-misc/youtube-dl-2020.05.29/01-live-api.patch,
and reinstall the package.

Awesome! Got it to work!

@Asday
Copy link

@Asday Asday commented Jun 5, 2020

@Salz feel like turning that patch into a PR?

@zap-stack
Copy link

@zap-stack zap-stack commented Jun 5, 2020

Is there any solution for Windows?

@Asday
Copy link

@Asday Asday commented Jun 5, 2020

@zap-stack wait for an update, or apply the patch provided by @Salz.

@vxbinaca
Copy link
Contributor

@vxbinaca vxbinaca commented Jun 5, 2020

Lets hope this doean't take a month to push a new release for this utterly breaks Twitch. Thanks @slaz. Thanks people. Great work.0

@EthanJohnson
Copy link

@EthanJohnson EthanJohnson commented Jun 5, 2020

I tried applying the patch, but all it gets now is
Unable to download JSON metadata: HTTP Error 400: Bad Request (caused by HTTPError());
https://pastebin.com/4xDNNP8h

@seboss666
Copy link

@seboss666 seboss666 commented Jun 5, 2020

Hello,
I've tried the patch provided but does not seem to work on Manjaro with Python 3.8 : https://gist.github.com/seboss666/0acfb589ff601a47785aa1627771c431

The gist contains URL command in verbose mode for full details.

@john-bigboote
Copy link

@john-bigboote john-bigboote commented Jun 5, 2020

This is another bug due to Twitch changes. #25531 has a patch.

Hello,
I've tried the patch provided but does not seem to work on Manjaro with Python 3.8 : https://gist.github.com/seboss666/0acfb589ff601a47785aa1627771c431

The gist contains URL command in verbose mode for full details.

@tomasparks
Copy link

@tomasparks tomasparks commented Jun 5, 2020

i'm getting the same error

youtube-dl --verbose -o '%(uploader)s-%(upload_date)s-%(title)s-%(id)s.%(ext)s' "https://www.twitch.tv/videos/641148397?filter=archives&sort=time"

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--verbose', u'-o', u'%(uploader)s-%(upload_date)s-%(title)s-%(id)s.%(ext)s', u'https://www.twitch.tv/videos/641148397?filter=archives&sort=time']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2020.05.29
[debug] Python version 2.7.18rc1 (CPython) - Linux-5.4.0-33-generic-x86_64-with-Ubuntu-20.04-focal
[debug] exe versions: ffmpeg N-51185-gfc3760a66d-static, ffprobe N-51185-gfc3760a66d-static, rtmpdump 2.4
[debug] Proxy map: {}
[twitch:vod] 641148397: Downloading vod info JSON
ERROR: Unable to download JSON metadata: HTTP Error 410: Gone (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 627, in _request_webpage
return self._downloader.urlopen(url_or_request)
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2238, in urlopen
return self._opener.open(req, timeout=self._socket_timeout)
File "/usr/lib/python2.7/urllib2.py", line 435, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 473, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

@MinorImprovements
Copy link

@MinorImprovements MinorImprovements commented Jun 5, 2020

@rooseveltrp sure,
copy the patch into /etc/portage/patches/net-misc/youtube-dl-2020.05.29/01-live-api.patch,
and reinstall the package emerge -av1 -j1 net-misc/youtube-dl.

@GuillaumeSeren where exactly do we copy the patch to? Is it straight into the command prompt of youtube.dl or is this a file path that we need to follow? If so how do we get to that point?

Sorry if these questions seem like no-brainers, I have no experience and am just trying to understand how it works.

@notcrusage
Copy link

@notcrusage notcrusage commented Jun 5, 2020

How do I apply the patch on windows? Can someone explain to me like I'm 5? Really noob when it comes to this stuff
@MinorImprovements Yeah I need to know the same things basically

@vriffel
Copy link

@vriffel vriffel commented Jun 5, 2020

I've applied this patch and it's working fine. Thank you.

@RequiemXN
Copy link

@RequiemXN RequiemXN commented Jun 5, 2020

How do I apply the patch on windows? Can someone explain to me like I'm 5? Really noob when it comes to this stuff
@MinorImprovements Yeah I need to know the same things basically

Yes, I also have a similar problem on Windows. Maybe already update the exe file with the patch to us?

@zap-stack
Copy link

@zap-stack zap-stack commented Jun 5, 2020

How do I apply the patch on windows? Can someone explain to me like I'm 5? Really noob when it comes to this stuff
@MinorImprovements Yeah I need to know the same things basically

Yes, I also have a similar problem on Windows. Maybe already update the exe file with the patch to us?

Me too

@dstftw dstftw closed this in ce3735d Jun 5, 2020
@ytdl-org ytdl-org locked and limited conversation to collaborators Jun 5, 2020
@ytdl-org ytdl-org deleted a comment from GuillaumeSeren Jun 5, 2020
@ytdl-org ytdl-org deleted a comment from Choonster Jun 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

You can’t perform that action at this time.