Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token '<', "<!DOCTYPE "... is not valid JSON #293

Closed
sop61 opened this issue Sep 5, 2023 · 11 comments
Closed

Unexpected token '<', "<!DOCTYPE "... is not valid JSON #293

sop61 opened this issue Sep 5, 2023 · 11 comments

Comments

@sop61
Copy link

sop61 commented Sep 5, 2023

As shown in the screenshot, I recently ran into this issue trying to auto-load subtitles from Youtube. It was working before, so I'm not sure what happened that would cause this, because I didn't mess with any settings prior to this.
image

@killergerbah
Copy link
Owner

@sop61 It would be helpful to get a screenshot of your console logs and network tab in the developer console when this issue happens. Also, a link to the video where you're seeing it would be great.

@sop61
Copy link
Author

sop61 commented Sep 6, 2023

Sorry about that. Here's a link to the vid: https://www.youtube.com/watch?v=jDW85zELIL0
image
image

@roboticsbrian
Copy link

Corroborating this bug report on Chrome Version 116.0.5845.141

This happens on every Youtube video. Netflix and Amazon are fine.

@Lengel1106
Copy link

I'm also seeing this on YouTube videos.

@killergerbah
Copy link
Owner

@sop81 I think this was mentioned on Discord as well, but ad blockers might be causing this. asbplayer needs to make some additional requests to YouTube to obtain the subtitle tracks, which may be blocked by ad blockers.

@sop61
Copy link
Author

sop61 commented Sep 7, 2023

That seems to be the case for my situation. I wonder if there's a way I can somehow whitelist or enable the parts that involve asbplayer, without disabling adblocking...

@killergerbah
Copy link
Owner

I don't use ad blockers so I do not know. asbplayer needs to make a number of requests to YouTube to obtain subtitle tracks. So the ad blocker would need to allow those requests through.

@phamthaison1207
Copy link

yeah thank you killergerbah for mentioning it, I disabled ublock origin and it worked, unfortunately, I am still figuring out how to allow adblockers to allow requests

@sop61
Copy link
Author

sop61 commented Sep 13, 2023

I ended up just switching off my filters one by one to check which ones are blocking it. Don't know if there's a better way than this, as others may have set their ad blocker different from mine. For those also wanting to mine from youtube and are running into this issue, just check your ad blocker's settings and filters. Or you can just turn off your ad blocker during the time you're mining, and turn it back on when you're done.

In any case, the issue is not with asbplayer, so I'll close this.

@jam-madrigal
Copy link

jam-madrigal commented Sep 22, 2023

Hello, I realize this was closed but I found a solution if anyone else is still having trouble. By inspecting the HTTP requests upon opening the subtitle selection prompt, I discovered that adding the following url to your list of trusted sites in ublock will resolve this issue while seemingly maintaining adblock functionality.

https://www.youtube.com/api/stats/
image

I've only been testing it out and using it today, so it may be imperfect. For example, I've had to refresh the page to see the subtitles become selectable if I was trying on a video that was in a tab already.

@killergerbah
Copy link
Owner

Thanks @jam-madrigal !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants