diff options
author | coletdjnz <colethedj@protonmail.com> | 2021-07-26 10:18:36 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-26 03:48:36 +0530 |
commit | 5a1fc62b41a6bd8a19bcf48dabee2ddc8e2d04e4 (patch) | |
tree | f0ffb3e2e27c37d2b40635d81e3c4e053641a51d | |
parent | b4c055bac29a41e5fb8c4b6f2028d66bc7cf27f3 (diff) | |
download | hypervideo-pre-5a1fc62b41a6bd8a19bcf48dabee2ddc8e2d04e4.tar.lz hypervideo-pre-5a1fc62b41a6bd8a19bcf48dabee2ddc8e2d04e4.tar.xz hypervideo-pre-5a1fc62b41a6bd8a19bcf48dabee2ddc8e2d04e4.zip |
[youtube] Add `mobile_web` client (#557)
Authored by: colethedj
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | yt_dlp/extractor/youtube.py | 17 |
2 files changed, 17 insertions, 2 deletions
@@ -1354,7 +1354,7 @@ Some extractors accept additional arguments which can be passed using `--extract The following extractors use this feature: * **youtube** * `skip`: `hls` or `dash` (or both) to skip download of the respective manifests - * `player_client`: Clients to extract video data from - one or more of `web`, `android`, `ios`, `web_music`, `android_music`, `ios_music` or `all`. By default, `android,web` is used. If the URL is from `music.youtube.com`, `android,web,android_music,web_music` is used + * `player_client`: Clients to extract video data from - one or more of `web`, `android`, `ios`, `mobile_web`, `web_music`, `android_music`, `ios_music` or `all`. By default, `android,web` is used. If the URL is from `music.youtube.com`, `android,web,android_music,web_music` is used * `player_skip`: `configs` - skip any requests for client configs and use defaults * `comment_sort`: `top` or `new` (default) - choose comment sorting mode (on YouTube's side). * `max_comments`: maximum amount of comments to download (default all). diff --git a/yt_dlp/extractor/youtube.py b/yt_dlp/extractor/youtube.py index fe0e7f38d..6e34dc25d 100644 --- a/yt_dlp/extractor/youtube.py +++ b/yt_dlp/extractor/youtube.py @@ -439,7 +439,21 @@ class YoutubeBaseInfoExtractor(InfoExtractor): } }, 'INNERTUBE_CONTEXT_CLIENT_NAME': 66 - } + }, + 'MWEB': { + 'INNERTUBE_API_VERSION': 'v1', + 'INNERTUBE_CLIENT_NAME': 'MWEB', + 'INNERTUBE_CLIENT_VERSION': '2.20210721.07.00', + 'INNERTUBE_API_KEY': 'AIzaSyDCU8hByM-4DrUqRUYnGn-3llEO78bcxq8', + 'INNERTUBE_CONTEXT': { + 'client': { + 'clientName': 'MWEB', + 'clientVersion': '2.20210721.07.00', + 'hl': 'en', + } + }, + 'INNERTUBE_CONTEXT_CLIENT_NAME': 2 + }, } _YT_DEFAULT_INNERTUBE_HOSTS = { @@ -463,6 +477,7 @@ class YoutubeBaseInfoExtractor(InfoExtractor): 'web_music': 'WEB_REMIX', '_web_embedded': 'WEB_EMBEDDED_PLAYER', '_web_agegate': 'TVHTML5', + 'mobile_web': 'MWEB', } def _get_default_ytcfg(self, client='WEB'): |