mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-08 20:47:11 +03:00
@@ -752,10 +752,11 @@ function startSkipScheduleCheckingForStartSponsors() {
|
||||
/**
|
||||
* Get the video info for the current tab from YouTube
|
||||
*/
|
||||
function getVideoInfo() {
|
||||
sendRequestToCustomServer('GET', "https://www.youtube.com/get_video_info?video_id=" + sponsorVideoID, function(xmlhttp, error) {
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
|
||||
const decodedData = decodeURIComponent(xmlhttp.responseText).match(/player_response=([^&]*)/)[1];
|
||||
async function getVideoInfo(): Promise<void> {
|
||||
const result = await utils.asyncRequestToCustomServer("GET", "https://www.youtube.com/get_video_info?video_id=" + sponsorVideoID);
|
||||
|
||||
if (result.ok) {
|
||||
const decodedData = decodeURIComponent(result.responseText).match(/player_response=([^&]*)/)[1];
|
||||
if (!decodedData) {
|
||||
console.error("[SB] Failed at getting video info from YouTube.");
|
||||
return;
|
||||
@@ -763,7 +764,6 @@ function getVideoInfo() {
|
||||
|
||||
videoInfo = JSON.parse(decodedData);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getYouTubeVideoID(url: string) {
|
||||
|
||||
Reference in New Issue
Block a user