yemingfeng 4 months ago
parent
commit
57517a9874
6 changed files with 16 additions and 5 deletions
  1. 0 0
      js/pornhub.bundle.js
  2. 0 0
      js/tiktok.bundle.js
  3. 0 0
      js/xvideos.bundle.js
  4. 0 0
      js/youtube.bundle.js
  5. 1 1
      js/youtube/youtubev1.js
  6. 15 4
      js/youtube/youtubev2.js

File diff suppressed because it is too large
+ 0 - 0
js/pornhub.bundle.js


File diff suppressed because it is too large
+ 0 - 0
js/tiktok.bundle.js


File diff suppressed because it is too large
+ 0 - 0
js/xvideos.bundle.js


File diff suppressed because it is too large
+ 0 - 0
js/youtube.bundle.js


+ 1 - 1
js/youtube/youtubev1.js

@@ -176,7 +176,7 @@ 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": {

+ 15 - 4
js/youtube/youtubev2.js

@@ -158,20 +158,31 @@ detail = async (url, requestId, platform) => {
         let originVideoDetails = undefined;
         // android
         try {
-            const apiUrl = `https://music.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", "hl": "en", "clientVersion": "18.49.37", "gl": "US"
+                        "clientName": "IOS",
+                        "clientVersion": "19.29.1",
+                        "deviceMake": "Apple",
+                        "deviceModel": "iPhone16,2",
+                        "hl": "en",
+                        "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",
+                        "utcOffsetMinutes": 0
                     }
                 }, "videoId": url.replace('https://www.youtube.com/watch?v=', ''), "params": "CgIQBg"
             }), {
                 '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'
+                'Content-Type': 'application/json',
+                'X-YouTube-Client-Version': '19.29.1'
             }, requestId, platform);
             let {data: apiData, _} = apiResp;
             console.log(`android api result: ${JSON.stringify(apiResp)}`);

Some files were not shown because too many files changed in this diff