Kaynağa Gözat

fix: using 720p

Ben 11 ay önce
ebeveyn
işleme
f97d01195e
5 değiştirilmiş dosya ile 22 ekleme ve 18 silme
  1. 0 0
      js/bundle.js
  2. 14 12
      js/deploy.js
  3. 4 2
      js/info.js
  4. 2 2
      js/main.swift
  5. 2 2
      test.py

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
js/bundle.js


+ 14 - 12
js/deploy.js

@@ -25,18 +25,20 @@ const params = {
 s3.upload(params)
     .promise()
     .then(data => {
-        console.log('File uploaded successfully. Location:', data);
-        const cloudfront = new AWS.CloudFront();
-        const params = {
-            DistributionId: 'E1OARMP9V91HD1',
-            InvalidationBatch: {
-                CallerReference: Date.now().toString(),
-                Paths: {
-                    Quantity: 1,
-                    Items: ['/*'],
-                },
-            },
-        };
+        console.log('File uploaded successfully. Location:', Object.assign({
+            "Location2": data.Location.replace("https://s3.amazonaws.com/justlistenmusic4560.com", "https://d3crpuooyqht8f.cloudfront.net")
+        }, data));
+        // const cloudfront = new AWS.CloudFront();
+        // const params = {
+        //     DistributionId: 'E1OARMP9V91HD1',
+        //     InvalidationBatch: {
+        //         CallerReference: Date.now().toString(),
+        //         Paths: {
+        //             Quantity: 1,
+        //             Items: ['/*'],
+        //         },
+        //     },
+        // };
         // cloudfront.createInvalidation(params)
         //     .promise()
         //     .then(data => {

+ 4 - 2
js/info.js

@@ -339,7 +339,7 @@ detail = async (url, platform) => {
                             "width": format["width"] + "",
                             "height": format["height"] + "",
                             "type": format["mimeType"],
-                            "quality": format["quality"],
+                            "quality": format["qualityLabel"],
                             "itag": format["itag"],
                             "fps": format["fps"] + "",
                             "bitrate": format["bitrate"] + "",
@@ -390,6 +390,8 @@ detail = async (url, platform) => {
             }
         }
 
+        formats.sort((a, b) => parseInt(a["height"]) - parseInt(b["height"]));
+
         const videoDetails = {
             "isLiveContent": originVideoDetails["isLiveContent"],
             "title": originVideoDetails["title"],
@@ -410,7 +412,7 @@ detail = async (url, platform) => {
             "data": {
                 "videoDetails": videoDetails,
                 "streamingData": {
-                    "formats": formats.reverse()
+                    "formats": formats
                 }
             },
             "id": "MusicDetailViewModel_detail_url"

+ 2 - 2
js/main.swift

@@ -138,7 +138,7 @@ func testSearch(keyword: String, ctx: JSContext) -> Void {
 
 let ctx = createJSContext()
 
-let remote = "https://d3crpuooyqht8f.cloudfront.net/dc1ff45a-5823-45c8-8245-331c4b4be0b4"
+let remote = "https://d3crpuooyqht8f.cloudfront.net/e76b32a6-42a0-4682-a30c-0b5c2d75e5b9"
 let local = "file:///Users/ben/Desktop/app/be/be-ytb/js/bundle.js"
 
 if let url = URL(string: remote) {
@@ -147,7 +147,7 @@ if let url = URL(string: remote) {
         case .success(let jsString):
             print("下载远程JS成功")
             ctx.evaluateScript(jsString)
-            testDetail(url: "https://www.youtube.com/watch?v=U1th94xR694", ctx: ctx)
+            testDetail(url: "https://www.youtube.com/watch?v=JByDbPn6A1o", ctx: ctx)
 //            testSearch(keyword: "周杰伦", ctx: ctx)
         case .failure(let error):
             print("Download Error: \(error)")

+ 2 - 2
test.py

@@ -5,10 +5,10 @@ import yt_dlp
 with yt_dlp.YoutubeDL({
     "flat-playlist": True,
     "extract_flat": "flat-playlist",
-    'proxy': 'socks://127.0.0.1:8889',
+    # 'proxy': 'socks://127.0.0.1:8889',
     'nocheckcertificate': True
 }) as ydl:
-    info = ydl.extract_info("https://www.youtube.com/watch?v=5qm8PH4xAss", download=False)
+    info = ydl.extract_info("https://www.youtube.com/watch?v=JByDbPn6A1o", download=False)
     formats = []
     for item in info["formats"]:
         if item.get("resolution") != "audio only" and item.get("url") and item.get("acodec") and item.get(

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor