gorhill / uBlock

uBlock Origin - An efficient blocker for Chromium and Firefox. Fast and lean.
GNU General Public License v3.0
47.23k stars 3.14k forks source link

An error has occurred while loading - Youtube #1461

Closed Breadwinka closed 8 years ago

Breadwinka commented 8 years ago

Read first: https://github.com/gorhill/uBlock/blob/master/CONTRIBUTING.md

with Ublock enabled, youtube will show a "An error has occurred while loading" for the length of an ad.

https://www.youtube.com/watch?v=Ld-gMclFgds

image

Steps for anyone to reproduce the issue

  1. go to www.youtube.com
  2. https://www.youtube.com/watch?v=Ld-gMclFgds 3.An error has occurred while loading appears for the length of the ad

Default Settings

Default Lists

gorhill commented 8 years ago

@scagood That would be the filter:

||youtube.com/get_video_metadata?video_id=*

is it possible to create a wildcard for subdomains?

||*.google.com$domain=youtube.com
gorhill commented 8 years ago

For those experiencing the issue, do you set your browser to block 3rd-party cookies everywhere?

scagood commented 8 years ago

I just tried ||*.google.com$domain=youtube.com but it didn't seem to work https://gyazo.com/a9b3f43886a86a2f99e5c7f450ccfca5 (log) https://gyazo.com/ec6a795b44f60094ee84b4900b7563e6 (my filters)

scagood commented 8 years ago

My cookie settings: https://gyazo.com/3971f1ca8adc92a7046f435657686f0d

gorhill commented 8 years ago

Does blocking 3rd-party cookies make any difference?

gorhill commented 8 years ago

Also, be sure that after any change to test if it helps or not, you force reload the Youtube page.

scagood commented 8 years ago

It makes no difference I'm afraid

scagood commented 8 years ago

Here is the log... (I cant be bothered to prettyfy it sorry)

[log removed]

scagood commented 8 years ago

Just a side note the ads are loaded from https://s.ytimg.com/yts/jsbin/player-en_GB-vflg04N-M/base.js

gorhill commented 8 years ago

I will be removing the long log entries from the thread, in the end it does not help. If I could reproduce the issue, I would need to step into the code -- logs so far have not been helpful. If it was a request-based issue, the issue would probably have already been fixed now. This is a js code issue, for which uBO is equipped to deal with, but I won't be able to investigate for a fix until I can reproduce at will on my side.

gorhill commented 8 years ago

How about... "YouTube shows Adblock Plus users an error message instead of ads":

In the meantime, Users on the Adblock Plus forums and Reddit have found a temporary workaround. To avoid the error, you’ll have to uncheck everything in your Google Ads settings (both for logged in and logged out) as well as installing the IBA Opt-Out extension.

gorhill commented 8 years ago

I changed the scriptlet code for custom filter youtube.com##script:inject(ytad-defuser.js) -- so whoever wants to give a try, purge one of uBO's own filter list, then force an update, open a new tab with Youtube and see if there is an effect.

ethus3h commented 8 years ago

I was seeing an issue yesterday (?) saying "If playback doesn't begin shortly, try restarting your device" when I tried to watch a youtube video; IDK if it's the same issue though. No, YouTube, I am NOT restarting my computer for you, lol. It's working fine today now though on the same video (https://www.youtube.com/watch?v=Tx1XIm6q4r4).

Breadwinka commented 8 years ago

I added the filter seems to be working much better. The message does appear but only briefly.

gorhill commented 8 years ago

The message does appear but only briefly.

Good, this confirms that uBO is hitting the right javascript code then. I was being prudent and set the delay to be half a second, but I could probably reduce it further -- and also dump a stack trace at the console for when the workaround is triggered, this would allows those suffering the issue to report exactly what javascript code is involved (expand the stack trace in the console, then screenshot it), this may help find a finer solution if any. I will update the scriptlet and report when it's ready.

gorhill commented 8 years ago

I updated the scriptlet to reduce the delay and put in tracing code, so as usual purge any one of uBO's filter list then force an update. If this still works, I would like a screenshot of the stack trace in the console, expanded as seen in pic:

a

Breadwinka commented 8 years ago

image

gorhill commented 8 years ago

Can you provide me a screenshot of the other trace as well, just above?

Breadwinka commented 8 years ago

For some reason it was really long this time

http://pastebin.com/2542HhWq

The first part is the first trace part 2 is the second trace.

gorhill commented 8 years ago

Thanks.

MSA69 commented 8 years ago

If you had a Youtube account that was experiencing the issue, would that help with debugging?

gorhill commented 8 years ago

@Breadwinka I release what I would hope would be the final solution, would you mind trying? As usual, purge-force update.

scagood commented 8 years ago

Unfortunately nothing has seemed to work yet.

https://www.youtube.com/watch?v=AD6yT4HmShI AD6yT4HmShI.err.txt AD6yT4HmShI.ok.txt

I have (temporarily) solved this by making a new account.

This is with the youtube.com##script:inject(ytad-defuser.js) custom filter and a fresh install & update of uBlock

Breadwinka commented 8 years ago

Looks like its still happening sometimes worse.

gorhill commented 8 years ago

Seems you have a different version of base.js than I do. So back to investigative mode. I modified the scriptlet so that now it will output useful info for me. I would like to see that output, but only for when you reproduce the issue. Example of the output I get on my side (though no stalled playback issue here):

a

marmottin commented 8 years ago

I thought I was the only one getting this error (up-to-date Palemoon x64). Don't know if I can help at this stage, as it also occurs less on my setup with the latest builds.

It doesn't happen on every monetized vids and, most of the time, I'm not logged in. When it was more frequent for me (almost each time), it was mostly happening while already being on a Youtube page and clicking on a sidebar link (usually a let's play series, so the same kind of encoding, ads...).

Palemoon x64: v26.1.1 uBlock: v1.6.5rc0 Youtube is using Flash Player as it refuses to stream DASH formats (480p & 1080p) through HTML5 under Palemoon. The issue occurs on every quality.

Breadwinka commented 8 years ago

@gorhill I updated it again not seeing the issue anymore.

image

gorhill commented 8 years ago

@Breadwinka There is no fix in the scriptlet, so maybe the issue was fixed by Youtube. The last entry in ABP's own issue says:

Feels like the issue was fixed, I assume on Youtube side, me and Job were not able to reproduce it again with our accounts that were having that issue.

Breadwinka commented 8 years ago

Yup you're absolutely right i disabled the scriplet and youtube is working normally, again.

ryanbr commented 8 years ago

If you're having issues, try adding @@||google.com/uds/api/ads/*/content.I.js

Does that help?

gorhill commented 8 years ago

Closing as apparently the issue resolved itself.

HotNeha commented 8 years ago

I think this method works for you, try it. http://www.baatkar.com/2016/08/fixed-please-try-again-later-in-youtube.html Thanks