0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-25 12:45:17 +00:00

switch to RYD for like count source

This commit is contained in:
Nikita Krupin 2023-01-06 14:12:55 -05:00
parent 63ac26a320
commit 86c7da0d5d
3 changed files with 21 additions and 17 deletions

View file

@ -343,8 +343,9 @@ export default {
this.video = result;
//--- Content Stuff ---//
this.likes = result.metadata.likes.toLocaleString();
this.interactions[0].value = result.metadata.likes.toLocaleString();
// NOTE: extractor likes are broken, using RYD likes instead
// this.likes = result.metadata.likes.toLocaleString();
// this.interactions[0].value = result.metadata.likes.toLocaleString();
this.loaded = true;
this.recommends = result.renderedData.recommendations;
console.log("recommendations:", this.recommends);
@ -362,7 +363,9 @@ export default {
});
this.$youtube.getReturnYoutubeDislike(this.$route.query.v, (data) => {
this.likes = data.likes.toLocaleString();
this.dislikes = data.dislikes.toLocaleString();
this.interactions[0].value = data.likes.toLocaleString();
this.interactions[1].value = data.dislikes.toLocaleString();
});
},

View file

@ -352,17 +352,19 @@ class Innertube {
isPrivate: details.isPrivate,
viewCount: details.viewCount,
lengthSeconds: details.lengthSeconds,
likes: parseInt(
vidMetadata.contents
.find((content) => content.slimVideoActionBarRenderer)
.slimVideoActionBarRenderer.buttons.find(
(button) => button.slimMetadataToggleButtonRenderer.isLike
)
.slimMetadataToggleButtonRenderer.button.toggleButtonRenderer.defaultText.accessibility.accessibilityData.label.replace(
/\D/g,
""
)
), // Yes. I know.
// likes: parseInt(
// vidMetadata.contents
// .find((content) => content.slimVideoActionBarRenderer)
// .slimVideoActionBarRenderer.buttons.find(
// (button) => button.slimMetadataToggleButtonRenderer.isLike
// )
// .slimMetadataToggleButtonRenderer.button.toggleButtonRenderer.defaultText.accessibility.accessibilityData.label.replace(
// /\D/g,
// ""
// )
// ), // Yes. I know.
likes: "broken",
// NOTE: likes are pulled from RYD for now untill extractor is fixed
},
renderedData: {
description: responseNext.engagementPanels

View file

@ -92,6 +92,7 @@ const innertubeModule = {
try {
return await InnertubeAPI.VidInfoAsync(id);
} catch (error) {
console.error(error);
}
},
@ -113,8 +114,7 @@ const innertubeModule = {
try {
const response = await InnertubeAPI.getChannelAsync(url);
return response.data;
} catch (error) {
}
} catch (error) {}
},
// It just works™
@ -177,8 +177,7 @@ const innertubeModule = {
try {
const response = await InnertubeAPI.getSearchAsync(query);
return response.contents.sectionListRenderer;
} catch (err) {
}
} catch (err) {}
},
async saveApiStats(query, url) {