projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c035dba
)
[twitch] Fix api calls (Closes #10654, closes #10660)
author
Sergey M․
<dstftw@gmail.com>
Thu, 15 Sep 2016 13:58:02 +0000
(20:58 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Thu, 15 Sep 2016 13:58:02 +0000
(20:58 +0700)
youtube_dl/extractor/twitch.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/twitch.py
b/youtube_dl/extractor/twitch.py
index 359a8859c8099d5eb9e2e8b1071737e900b8fb45..af6d890b0ed965220232392ac85d3739a5353dd2 100644
(file)
--- a/
youtube_dl/extractor/twitch.py
+++ b/
youtube_dl/extractor/twitch.py
@@
-32,6
+32,7
@@
class TwitchBaseIE(InfoExtractor):
_API_BASE = 'https://api.twitch.tv'
_USHER_BASE = 'https://usher.ttvnw.net'
_LOGIN_URL = 'http://www.twitch.tv/login'
_API_BASE = 'https://api.twitch.tv'
_USHER_BASE = 'https://usher.ttvnw.net'
_LOGIN_URL = 'http://www.twitch.tv/login'
+ _CLIENT_ID = 'jzkbprff40iqj646a697cyrvl0zt2m6'
_NETRC_MACHINE = 'twitch'
def _handle_error(self, response):
_NETRC_MACHINE = 'twitch'
def _handle_error(self, response):
@@
-44,15
+45,9
@@
class TwitchBaseIE(InfoExtractor):
expected=True)
def _call_api(self, path, item_id, note):
expected=True)
def _call_api(self, path, item_id, note):
- headers = {
- 'Referer': 'http://api.twitch.tv/crossdomain/receiver.html?v=2',
- 'X-Requested-With': 'XMLHttpRequest',
- }
- for cookie in self._downloader.cookiejar:
- if cookie.name == 'api_token':
- headers['Twitch-Api-Token'] = cookie.value
response = self._download_json(
response = self._download_json(
- '%s/%s' % (self._API_BASE, path), item_id, note)
+ '%s/%s' % (self._API_BASE, path), item_id, note,
+ headers={'Client-ID': self._CLIENT_ID})
self._handle_error(response)
return response
self._handle_error(response)
return response