aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/viewster.py
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2015-07-29 23:20:37 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2015-07-30 12:55:48 +0200
commit799207e838e0404aaa5cb6658e41bef108aced16 (patch)
tree2d27bebe830921c03b253fa0d7e37c6bd94461c4 /youtube_dl/extractor/viewster.py
parent34866b4836eab8dd2fcaae88dc1ed5c79a742c92 (diff)
[viewster] extract the api auth token
Closes #6406.
Diffstat (limited to 'youtube_dl/extractor/viewster.py')
-rw-r--r--youtube_dl/extractor/viewster.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/extractor/viewster.py b/youtube_dl/extractor/viewster.py
index 6ef36290b..393b63618 100644
--- a/youtube_dl/extractor/viewster.py
+++ b/youtube_dl/extractor/viewster.py
@@ -62,7 +62,6 @@ class ViewsterIE(InfoExtractor):
}]
_ACCEPT_HEADER = 'application/json, text/javascript, */*; q=0.01'
- _AUTH_TOKEN = '/YqhSYsx8EaU9Bsta3ojlA=='
def _download_json(self, url, video_id, note='Downloading JSON metadata', fatal=True):
request = compat_urllib_request.Request(url)
@@ -72,6 +71,10 @@ class ViewsterIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
+ # Get 'api_token' cookie
+ self._request_webpage(url, video_id)
+ cookies = self._get_cookies(url)
+ self._AUTH_TOKEN = compat_urllib_parse.unquote(cookies['api_token'].value)
info = self._download_json(
'https://public-api.viewster.com/search/%s' % video_id,