Log returned data when video info failed to load

This commit is contained in:
Ajay Ramachandran
2021-01-27 22:27:23 -05:00
parent c0a515d8f0
commit 4f50ead08d
3 changed files with 6 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
"version": "2.0.12",
"version": "2.0.12.1",
"default_locale": "en",
"description": "__MSG_Description__",
"content_scripts": [{

View File

@@ -594,6 +594,9 @@
"adblockerIssue": {
"message": "It seems that something is blocking SponsorBlock's ability to get video data. This is probably your ad blocker. Please check https://github.com/ajayyy/SponsorBlock/wiki/Fix-Ad-Blocker-Blocking-SponsorBlock's-Requests"
},
"adblockerIssueUnlistedVideosInfo": {
"message": "If you are unable to resolve this, then disable the setting 'Ignore unlisted/private videos', as SponsorBlock is unable to retrieve the visibility information for this video"
},
"itCouldBeAdblockerIssue": {
"message": "If this keeps occuring, it could be caused by your ad blocker. Please check https://github.com/ajayyy/SponsorBlock/wiki/Fix-Ad-Blocker-Blocking-SponsorBlock's-Requests"
},

View File

@@ -258,7 +258,7 @@ async function videoIDChange(id) {
try {
await utils.wait(() => !!videoInfo, 5000, 1);
} catch (err) {
alert(chrome.i18n.getMessage("adblockerIssue"));
alert(chrome.i18n.getMessage("adblockerIssue") + "\n\n" + chrome.i18n.getMessage("adblockerIssueUnlistedVideosInfo"));
}
if (isUnlisted()) {
@@ -719,6 +719,7 @@ async function getVideoInfo(): Promise<void> {
const decodedData = decodeURIComponent(result.responseText).match(/player_response=([^&]*)/)[1];
if (!decodedData) {
console.error("[SB] Failed at getting video info from YouTube.");
console.error("[SB] Data returned from YouTube: " + result.responseText);
return;
}