killergerbah / asbplayer

Browser-based media player and Chrome extension for subtitle sentence mining
MIT License
554 stars 69 forks source link

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

Closed sop61 closed 1 year ago

sop61 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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

roboticsbrian commented 1 year ago

Corroborating this bug report on Chrome Version 116.0.5845.141

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

Lengel1106 commented 1 year ago

I'm also seeing this on YouTube videos.

killergerbah commented 1 year ago

@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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Thanks @jam-madrigal !