Browse Source

Mod: code

yemingfeng 4 months ago
parent
commit
5f6f5aa664
5 changed files with 7 additions and 6 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. 7 6
      js/youtube/youtubev1.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


+ 7 - 6
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`;
+            const apiUrl = `https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8`;
             const apiResp = await request('POST', apiUrl, JSON.stringify({
                 "context": {
                     "client": {
@@ -199,7 +199,8 @@ detail = async (url, requestId, platform) => {
                 '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)}`);
@@ -237,16 +238,16 @@ detail = async (url, requestId, platform) => {
             }
         }
 
-        let qualities = [];
+        let itags = [];
         const formats = [];
         for (let format of originFormats) {
             if (printable(platform)) {
                 console.log(format);
             }
-            if (format && qualities.indexOf(format['itag']) === -1) {
+            if (format && itags.indexOf(format['itag']) === -1) {
                 if (format["url"]) {
                     const {vcodec, acodec} = parseCodecs(format)
-                    if (vcodec && acodec) {
+                    if (acodec) {
                         const current = {
                             "width": format["width"] + "",
                             "height": format["height"] + "",
@@ -268,7 +269,7 @@ detail = async (url, requestId, platform) => {
                             "videoUrl": format["url"]
                         }
                         formats.push(current)
-                        qualities.push(format["qualityLabel"]);
+                        itags.push(format["itag"]);
                     }
                 }
             }

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