瀏覽代碼

mod: youtube

Ben 9 月之前
父節點
當前提交
c564427a0c
共有 6 個文件被更改,包括 10 次插入10 次删除
  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. 10 10
      js/youtube/youtube.js
  6. 0 0
      js/youtube_audio.bundle.js

文件差異過大導致無法顯示
+ 0 - 0
js/pornhub.bundle.js


文件差異過大導致無法顯示
+ 0 - 0
js/tiktok.bundle.js


文件差異過大導致無法顯示
+ 0 - 0
js/xvideos.bundle.js


文件差異過大導致無法顯示
+ 0 - 0
js/youtube.bundle.js


+ 10 - 10
js/youtube/youtube.js

@@ -182,7 +182,7 @@ detail = async (url, platform) => {
             console.log(`android api result: ${JSON.stringify(apiResp)}`);
             const res = JSON.parse(apiData);
             const currentFormats = [];
-            for (const format of [].concat(res["streamingData"]["formats"]).concat(res["streamingData"]["adaptiveFormats"])) {
+            for (const format of [].concat(res["streamingData"]["formats"] || []).concat(res["streamingData"]["adaptiveFormats"] || [])) {
                 if (format) {
                     format["from"] = "android"
                     currentFormats.push(format);
@@ -201,15 +201,15 @@ detail = async (url, platform) => {
         console.log(`after android api, format size:${originFormats.length}`);
 
         // web
-        const currentFormats = [];
-        for (const format of ytInitialPlayerResponse["streamingData"]["formats"].concat(ytInitialPlayerResponse["streamingData"]["adaptiveFormats"])) {
-            if (format) {
-                format["from"] = "web"
-                currentFormats.push(format);
-            }
-        }
-        originFormats = originFormats.concat(currentFormats);
-        console.log(`after html, format size:${originFormats.length}`);
+        // const currentFormats = [];
+        // for (const format of ytInitialPlayerResponse["streamingData"]["formats"].concat(ytInitialPlayerResponse["streamingData"]["adaptiveFormats"])) {
+        //     if (format) {
+        //         format["from"] = "web"
+        //         currentFormats.push(format);
+        //     }
+        // }
+        // originFormats = originFormats.concat(currentFormats);
+        // console.log(`after html, format size:${originFormats.length}`);
 
         let qualities = [];
         const formats = [];

文件差異過大導致無法顯示
+ 0 - 0
js/youtube_audio.bundle.js


部分文件因文件數量過多而無法顯示