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.
Can't download from twitch.tv #10654
Comments
|
experiencing the same thing, livestreamer and a kodi plugin don't work either. so i guess they changed api.
|
|
Twitch now requires "client_id" for API calls. It was announced months ago, but turned on just 2 hours ago. Should be easy to fix. |
|
I applied quick fix locally. Also noticed that headers were not passed through so removed not needed ones (question is if Twitch-Api-Token is needed, it was working without it for some time). Youtube-dl should have it's own client-id probably instead of using web player one. Tho it is not for me to decide. If someone wants quick fix until it is fixed in trunk: diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py
index 359a885..f393ab1 100644
--- a/youtube_dl/extractor/twitch.py
+++ b/youtube_dl/extractor/twitch.py
@@ -45,14 +45,13 @@ class TwitchBaseIE(InfoExtractor):
def _call_api(self, path, item_id, note):
headers = {
- 'Referer': 'http://api.twitch.tv/crossdomain/receiver.html?v=2',
- 'X-Requested-With': 'XMLHttpRequest',
+ 'Client-ID': 'jzkbprff40iqj646a697cyrvl0zt2m6',
}
for cookie in self._downloader.cookiejar:
if cookie.name == 'api_token':
headers['Twitch-Api-Token'] = cookie.value
response = self._download_json(
- '%s/%s' % (self._API_BASE, path), item_id, note)
+ '%s/%s' % (self._API_BASE, path), item_id, note, headers=headers)
self._handle_error(response)
return response
|
|
I tried kasper93's fix and it worked well. Thanks! :) |
|
Who's client is that ID from? |
|
His own account, I guess.. |
|
But I got this: |
|
None than you programmers get this shit. Twitch Ruined the whole Nvidia streaming ability... i really hope Nvidia Sue the shit out of you for doing your amazing decision. |
|
Er... What |
|
Not sure, probably talking about the issues with the newly released GeForce Experience 3.0 software? There have been some problems, or so I heard... Relevant suggestion for youtube-dl core:Twitch is not the first site to use some form of authentication for API access, and it definitely won't be the last. It would probably be a good idea to extend the user authentication functionality of youtube-dl ( Because otherwise, what is happening now, we have an API key/Client ID hard-coded into the extractor file ( |
|
The problem of API keys is: they are often limited w.r.t mechanisms used in web pages. For example, some API keys have usage limitations, and some limits functionality. If there's a salient advantage of API keys, it's a good idea. |
|
BTW, the Twitch extractor already supports reading from Not sure, but maybe it is possible to extend https://github.com/rg3/youtube-dl/blob/master/youtube_dl/extractor/common.py#L665-L683, so that a new value/field can be retrieved from .netc, because right now we would only need those one value for To be a bit more specific: I don't have any experience with Python, but
|
|
Why do you want to override client id anyway? It is client/application
identifier and is the same for all user on given application. Right now
youtube-dl uses web player id. This value is not dependent on user or
anything. It is not something that user should be able to change really.
|
Well, if that is the case and Client ID is not bound to a specific user account, it probably shouldn't be changed and my point becomes unnecessary. I don't know about the Twitch API, never used it so far, but other site's APIs use unique identifiers which are linked to an user account. |
|
Hi everyone! Kasper, me being a complete ignoramus in programming, do you think I would be able to apply your fix to my shadowplay software? If so, please tell me how this is done. Do I just copy paste that code into some file or something like that? Thank you very much! :D |
|
Windows 10 (newest build at this time)
|
|
@daemonfire300 does not play in browser either. |
|
@dstftw my fault, I should have tried different VODs, seems like this one is just broken. |
Using latest mpv and youtube-dl.
Running windows, unsure how to post log