Browse Source

mod: apiKey

Aiden 4 months ago
parent
commit
69db94eccc
1 changed files with 8 additions and 3 deletions
  1. 8 3
      js/youtube/youtubev1.js

+ 8 - 3
js/youtube/youtubev1.js

@@ -176,13 +176,18 @@ detail = async (url, requestId, platform) => {
         let originFormats = [];
         let originVideoDetails = undefined;
         try {
-            const apiUrl = `https://music.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8`;
+            const apiUrl = `https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8`;
             const apiResp = await request('POST', apiUrl, JSON.stringify({
                 "context": {
                     "client": {
-                        "clientName": "ANDROID", "hl": "en", "clientVersion": "18.49.37", "gl": "US"
+                        "clientName": "ANDROID_MUSIC",
+                        "hl": "en",
+                        "clientVersion": "5.16.51",
+                        "gl": "US",
+                        "androidSdkVersion": 30
                     }
-                }, "videoId": url.replace('https://www.youtube.com/watch?v=', ''), "params": "CgIQBg"
+                }, "videoId": url.replace('https://www.youtube.com/watch?v=', ''),
+                "params": "8AEB"
             }), {
                 'Host': 'www.youtube.com',
                 'Connection': 'keep-alive',