Ben 8 months ago
parent
commit
8edc07003c

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


+ 8 - 0
js/youtube/test.js

@@ -1,3 +1,11 @@
+recommend('123', 'WEB')
+    .then(res => {
+        console.log(res);
+    })
+    .catch(e => {
+        console.log(e);
+    })
+
 detail(`https://www.youtube.com/watch?v=4KkjBz34yzw`, '123', 'WEB')
     .then(res => {
         console.log(res);

+ 47 - 0
js/youtube/youtubev2.js

@@ -425,3 +425,50 @@ search = async (keyword, next, requestId, platform) => {
         return ret;
     }
 }
+
+recommend = async (requestId, platform) => {
+    try {
+        const body = {
+            "context": {
+                "client": {
+                    "clientName": "WEB", "clientVersion": "2.20240304.00.00"
+                }
+            }, "browseId": "VLPL4fGSI1pDJn69On1f-8NAvX_CYlx7QyZc"
+        }
+        let res = await request('POST', `https://www.youtube.com/youtubei/v1/browse?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8`, JSON.stringify(body), {}, requestId, platform);
+        const {data, _} = res;
+        res = JSON.parse(data);
+        const videos = [];
+        for (const item of res["contents"]["twoColumnBrowseResultsRenderer"]["tabs"][0]["tabRenderer"]["content"]["sectionListRenderer"]["contents"][0]["itemSectionRenderer"]["contents"]["0"]["playlistVideoListRenderer"]["contents"]) {
+            const video = item["playlistVideoRenderer"];
+            console.log(video);
+            if (video && video["videoId"] && video["lengthText"]) {
+                videos.push({
+                    "type": "videoWithContextRenderer", "data": {
+                        "videoId": video["videoId"],
+                        "title": video["title"]?.["runs"]?.[0]?.["text"],
+                        "thumbnails": video["thumbnail"]?.["thumbnails"],
+                        "channelName": video["longBylineText"]?.["runs"]?.[0]?.["text"],
+                        "publishedTimeText": video["publishedTimeText"]?.["simpleText"],
+                        "viewCountText": video["viewCountText"]?.["simpleText"],
+                        "shortViewCountText": video["shortViewCountText"]?.["simpleText"],
+                        "lengthText": video["lengthText"]?.["simpleText"]
+                    }
+                });
+            }
+        }
+        const ret = {
+            "code": 200, "msg": "", "requestId": requestId, "data": {
+                "data": videos,
+            }, "id": "MusicRecommendResultViewModel_recommend_result"
+        }
+        console.log(`recommend result: ${JSON.stringify(ret)}`);
+        return ret;
+    } catch (e) {
+        const ret = {
+            "code": -1, "msg": e.toString(), "requestId": requestId,
+        }
+        console.log(`recommend result error: ${JSON.stringify(ret)}`);
+        return ret;
+    }
+}

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


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