Browse Source

mod: audioUr

Ben 8 months ago
parent
commit
6208ae26e6

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/index.html

@@ -3,7 +3,7 @@
 <head>
     <meta charset="UTF-8">
     <title>JavaScript in Browser</title>
-    <script src="youtube.js"></script>
+    <script src="youtubev1.js"></script>
     <script src="test.js"></script>
 </head>
 </html>

+ 1 - 1
js/youtube/test.js

@@ -6,7 +6,7 @@
 //         console.log(e);
 //     })
 
-detail(`https://www.youtube.com/watch?v=S9bCLPwzSC0`, 'WEB')
+detail(`https://www.youtube.com/watch?v=S9bCLPwzSC0`,'1111', 'WEB')
     .then(res => {
         console.log(res);
     })

+ 13 - 2
js/youtube/youtubev1.js

@@ -229,6 +229,17 @@ detail = async (url, requestId, platform) => {
         }
         console.log(`after android api, format size:${originFormats.length}`);
 
+        let audioUrl = ""
+        for (let format of originFormats) {
+            if (format["url"]) {
+                const {vcodec, acodec} = parseCodecs(format)
+                if (!vcodec && acodec) {
+                    audioUrl = format["url"]
+                    break
+                }
+            }
+        }
+
         let qualities = [];
         const formats = [];
         for (let format of originFormats) {
@@ -255,7 +266,8 @@ detail = async (url, requestId, platform) => {
                             "abr": "0",
                             "container": "mp4_dash",
                             "from": format["from"],
-                            "source": format
+                            "source": format,
+                            "audioUrl": audioUrl
                         }
                         formats.push(current)
                         qualities.push(format["qualityLabel"]);
@@ -270,7 +282,6 @@ detail = async (url, requestId, platform) => {
             })
         }
 
-
         formats.sort((a, b) => parseInt(a["height"]) - parseInt(b["height"]));
 
         const videoDetails = {

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