mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Refetch when not found no matter the date
This commit is contained in:
@@ -286,7 +286,7 @@ async function videoIDChange(id) {
|
||||
}
|
||||
|
||||
// Get new video info
|
||||
getVideoInfo();
|
||||
// getVideoInfo(); // Seems to have been replaced
|
||||
|
||||
// Update whitelist data when the video data is loaded
|
||||
whitelistCheck();
|
||||
@@ -726,20 +726,11 @@ function retryFetch(): void {
|
||||
|
||||
sponsorDataFound = false;
|
||||
|
||||
//check if this video was uploaded recently
|
||||
utils.wait(() => !!videoInfo).then(() => {
|
||||
const dateUploaded = videoInfo?.microformat?.playerMicroformatRenderer?.uploadDate;
|
||||
console.log(dateUploaded)
|
||||
|
||||
//if less than 3 days old
|
||||
if (Date.now() - new Date(dateUploaded).getTime() < 259200000) {
|
||||
setTimeout(() => {
|
||||
if (sponsorVideoID && sponsorTimes?.length === 0) {
|
||||
sponsorsLookup(sponsorVideoID);
|
||||
}
|
||||
}, 10000 + Math.random() * 30000);
|
||||
setTimeout(() => {
|
||||
if (sponsorVideoID && sponsorTimes?.length === 0) {
|
||||
sponsorsLookup(sponsorVideoID);
|
||||
}
|
||||
});
|
||||
}, 10000 + Math.random() * 30000);
|
||||
|
||||
sponsorLookupRetries = 0;
|
||||
}
|
||||
@@ -801,6 +792,8 @@ function startSkipScheduleCheckingForStartSponsors() {
|
||||
|
||||
/**
|
||||
* Get the video info for the current tab from YouTube
|
||||
*
|
||||
* TODO: Replace
|
||||
*/
|
||||
async function getVideoInfo(): Promise<void> {
|
||||
const result = await utils.asyncRequestToCustomServer("GET", "https://www.youtube.com/get_video_info?video_id=" + sponsorVideoID + "&html5=1&c=TVHTML5&cver=7.20190319");
|
||||
|
||||
Reference in New Issue
Block a user