]> jfr.im git - yt-dlp.git/commitdiff
[youtube] Add `mobile_web` client (#557)
authorcoletdjnz <redacted>
Sun, 25 Jul 2021 22:18:36 +0000 (10:18 +1200)
committerGitHub <redacted>
Sun, 25 Jul 2021 22:18:36 +0000 (03:48 +0530)
Authored by: colethedj

README.md
yt_dlp/extractor/youtube.py

index 52852f341df037accc029cadee02c2e2affd9107..3d9edf5906011c6529971fdd5e23fb89d1999615 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1354,7 +1354,7 @@ # EXTRACTOR ARGUMENTS
 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).
index fe0e7f38dc61816e7a30631bf2dbe1b268700190..6e34dc25d5575d9b5ca3ac4b2139880c90ab6b40 100644 (file)
@@ -439,7 +439,21 @@ def _real_initialize(self):
                 }
             },
             '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 @@ def _real_initialize(self):
         'web_music': 'WEB_REMIX',
         '_web_embedded': 'WEB_EMBEDDED_PLAYER',
         '_web_agegate': 'TVHTML5',
+        'mobile_web': 'MWEB',
     }
 
     def _get_default_ytcfg(self, client='WEB'):