Browse Source

Mod: client

yemingfeng 4 months ago
parent
commit
1bb0d50ce1
1 changed files with 12 additions and 7 deletions
  1. 12 7
      js/youtube/youtubev1.js

+ 12 - 7
js/youtube/youtubev1.js

@@ -176,22 +176,27 @@ detail = async (url, requestId, platform) => {
         let originFormats = [];
         let originVideoDetails = undefined;
         try {
-            const apiUrl = `https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8`;
+            const apiUrl = `https://www.youtube.com/youtubei/v1/player`;
             const apiResp = await request('POST', apiUrl, JSON.stringify({
                 "context": {
                     "client": {
-                        "clientName": "ANDROID_MUSIC",
+                        "clientName": "IOS",
+                        "clientVersion": "19.29.1",
+                        "deviceMake": "Apple",
+                        "deviceModel": "iPhone16,2",
                         "hl": "en",
-                        "clientVersion": "5.16.51",
+                        "osName": "iPhone",
+                        "osVersion": "17.5.1.21F90",
+                        "timeZone": "UTC",
+                        "userAgent": "com.google.ios.youtube/19.29.1 (iPhone16,2; U; CPU iOS 17_5_1 like Mac OS X;)",
                         "gl": "US",
-                        "androidSdkVersion": 30
+                        "utcOffsetMinutes": 0
                     }
-                }, "videoId": url.replace('https://www.youtube.com/watch?v=', ''),
-                "params": "8AEB"
+                }, "videoId": url.replace('https://www.youtube.com/watch?v=', '')
             }), {
                 'Host': 'www.youtube.com',
                 'Connection': 'keep-alive',
-                'User-Agent': 'com.google.android.apps.youtube.music/17.31.35 (Linux; U; Android 11) gzip',
+                'User-Agent': 'com.google.ios.youtube/19.29.1 (iPhone16,2; U; CPU iOS 17_5_1 like Mac OS X;)',
                 'Accept-Language': 'en-US,en',
                 'Cookie': parseSetCookie(htmlHeaders),
                 'Content-Type': 'application/json'