aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornyuszika7h <nyuszika7h@gmail.com>2022-01-31 15:52:42 +0100
committerGitHub <noreply@github.com>2022-01-31 20:22:42 +0530
commit1c6f480160199d88b8e3d278befe6eec099b619d (patch)
tree4c50c5f08121ffe75ab86583df6b25abd8493f55
parentf8580bf02f66ff6606d667de3172aeacc40c01fc (diff)
downloadhypervideo-pre-1c6f480160199d88b8e3d278befe6eec099b619d.tar.lz
hypervideo-pre-1c6f480160199d88b8e3d278befe6eec099b619d.tar.xz
hypervideo-pre-1c6f480160199d88b8e3d278befe6eec099b619d.zip
[viki] Fix "Bad request" for manifest (#2540)
Closes #2499 Authored by: nyuszika7h
-rw-r--r--yt_dlp/extractor/viki.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/yt_dlp/extractor/viki.py b/yt_dlp/extractor/viki.py
index 6a3c5532d..19b09121c 100644
--- a/yt_dlp/extractor/viki.py
+++ b/yt_dlp/extractor/viki.py
@@ -19,7 +19,7 @@ class VikiBaseIE(InfoExtractor):
_VALID_URL_BASE = r'https?://(?:www\.)?viki\.(?:com|net|mx|jp|fr)/'
_API_URL_TEMPLATE = 'https://api.viki.io%s'
- _DEVICE_ID = '86085977d' # used for android api
+ _DEVICE_ID = '112395910d'
_APP = '100005a'
_APP_VERSION = '6.11.3'
_APP_SECRET = 'd96704b180208dbb2efa30fe44c48bd8690441af9f567ba8fd710a72badc85198f7472'
@@ -253,7 +253,7 @@ class VikiIE(VikiBaseIE):
} for thumbnail_id, thumbnail in (video.get('images') or {}).items() if thumbnail.get('url')]
resp = self._call_api(
- 'playback_streams/%s.json?drms=dt1,dt2&device_id=%s' % (video_id, self._DEVICE_ID),
+ 'playback_streams/%s.json?drms=dt3&device_id=%s' % (video_id, self._DEVICE_ID),
video_id, 'Downloading video streams JSON')['main'][0]
stream_id = try_get(resp, lambda x: x['properties']['track']['stream_id'])
@@ -264,10 +264,13 @@ class VikiIE(VikiBaseIE):
} for ext in ('srt', 'vtt')]) for lang in (video.get('subtitle_completions') or {}).keys())
mpd_url = resp['url']
- # 1080p is hidden in another mpd which can be found in the current manifest content
+ # 720p is hidden in another MPD which can be found in the current manifest content
mpd_content = self._download_webpage(mpd_url, video_id, note='Downloading initial MPD manifest')
mpd_url = self._search_regex(
r'(?mi)<BaseURL>(http.+.mpd)', mpd_content, 'new manifest', default=mpd_url)
+ if 'mpdhd_high' not in mpd_url:
+ # Modify the URL to get 1080p
+ mpd_url = mpd_url.replace('mpdhd', 'mpdhd_high')
formats = self._extract_mpd_formats(mpd_url, video_id)
self._sort_formats(formats)