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

play.virginmediatelevision.ie: ads #25164

Closed
10 of 11 tasks
Ashurel opened this issue Sep 1, 2024 · 9 comments
Closed
10 of 11 tasks

play.virginmediatelevision.ie: ads #25164

Ashurel opened this issue Sep 1, 2024 · 9 comments

Comments

@Ashurel
Copy link

Ashurel commented Sep 1, 2024

Prerequisites

  • This is NOT a YouTube, Facebook, Twitch or a shortener/hosting site report. These sites MUST be reported by clicking their respective links.
  • I read and understand the policy about what is a valid filter issue.
  • I verified that this issue is not a duplicate. (Search here to find out.)
  • I did not remove any of the default filter lists, or I have verified that the issue was not caused by removing any of the default lists.
  • I did not enable additional filter lists, or I have verified that the issue still occurs without enabling additional filter lists.
  • I do not have custom filters/rules, or I have verified that the issue still occurs without custom filters/rules.
  • I am not using uBlock Origin along with other content blockers.
  • I have verified that the web browser's built-in content blocker/tracking protection, network wide/DNS blocking, or my VPN is not causing the issue.
  • I have verified that other extensions are not causing the issue.
  • If this is about a breakage or detection, I have verified that it is caused by uBlock Origin and isn't a site issue.
  • I did not answer truthfully to ALL the above checkboxes.

URL(s) where the issue occurs.

https://play.virginmediatelevision.ie/shows

Description

Doesn't block ad segments when playing shows

Other extensions used

Tamper Monkey
Ground News Checker

Screenshot(s)

Screenshot(s)

Configuration

Details
uBlock Origin: 1.59.0
Chromium: 128
filterset (summary):
 network: 152643
 cosmetic: 48121
 scriptlet: 22249
 html: 0
listset (total-discarded, last-updated):
 default:
  user-filters: 2-0, never
  easylist: 85080-569, 1h.5m Δ
  easyprivacy: 53094-647, 1h.5m Δ
  plowe-0: 3547-0, now
  ublock-badware: 10905-6, 1h.5m Δ
  ublock-filters: 39807-337, 1h.5m Δ
  ublock-privacy: 1118-2, 1h.5m Δ
  ublock-quick-fixes: 243-0, 1h.5m Δ
  ublock-unbreak: 2471-0, 1h.5m Δ
  urlhaus-1: 28460-0, now
filterset (user): [array of 2 redacted]
trustedset:
 added: [array of 2 redacted]
userSettings: [none]
hiddenSettings: [none]
supportStats:
 allReadyAfter: 1008 ms (selfie)
 maxAssetCacheWait: 131 ms
 cacheBackend: indexedDB
popupPanel:
 blocked: 158
 network:
  bluebillywig.com: 33
  doubleclick.net: 67
  flashtalking.com: 1
  google.com: 3
  googletagmanager.com: 1
  imasdk.googleapis.com: 1
  npaw.com: 50
  privacy-mgmt.com: 1
  youtube.com: 1
 extended:
  ###pauseAd
  ##+js(set-constant, google.ima.dai, {})
  ##+js(no-xhr-if, /froloa.js)
@MasterKia MasterKia changed the title Missing blocker on Virgin Media Player play.virginmediatelevision.ie: ads Sep 1, 2024
@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Sep 3, 2024

@gorhill Sorry, somehow I can't use any filters to target the XML with the URL

https://699f4b4fd221407ead714c33183bba51.mediatailor.eu-west-1.amazonaws.com/v1/dash/774d979dd66704abea7c5b62cb34c6815fda0d35/virgin-vod/virginmedia/remix/virgin_four/52572531/52572531.ism/manifest.mpd?aws.sessionId=fb22fed2-09b5-4593-9a6e-baaea0d65b30

even with replace. I tried very simple filters for each case but none is success (no block or log appearing)

play.virginmediatelevision.ie##+js(xml-prune, Period, , amazonaws.com/v1/dash/)
play.virginmediatelevision.ie##+js(trusted-replace-xhr-response, e, , amazonaws.com/v1/dash/)
||amazonaws.com/v1/dash/$replace=/e//gms

You might need VPN to Ireland for this site.

@gorhill
Copy link
Member

gorhill commented Sep 3, 2024

The VPN I use does not offer a server for Ireland, so I can't reproduce.

What is the Content-Type header for that resource?


Ok loading that URL directly in the browser I get a valid response, with Content-Type header set to application/dash+xml. I can add support for this so that replace= works. As for the other scriptlet-based filters, I would need to step into the scriptlet code to understand why it doesn't work.


For trusted-replace-xhr-response, the scriptlet expects a string and if not, it just returns without further processing.

gorhill added a commit to gorhill/uBlock that referenced this issue Sep 3, 2024
@gorhill
Copy link
Member

gorhill commented Sep 3, 2024

Has there been many cases of using replace= for XML data or even other types of structured data?

@stephenhawk8054
Copy link
Member

Has there been many cases of using replace= for XML data or even other types of structured data?

Not yet as far as I know. But ability to perform non-regex pruning (json/xml/m3u-prune) for replace could be helpful.


There's actually another case of xml-prune not working: #9764 (comment) , although in that case, uBO does log the scriptlet. I haven't tested that case with replace yet.

@gorhill
Copy link
Member

gorhill commented Sep 3, 2024

There's actually another case of xml-prune not working: #9764 (comment)

Ok I might have identified the issue, thought this will need confirmation. What seems to be the issue is that when responseXML points to a valid XML document, the scriptlet overwrites responseText with the changes, but it does not overwrite response as the assumption was that it pointed to the same XML document as responseXML (my understanding of MDN documentation). However in the case I could reproduce, I see response is a string, not a document event thought responseXML points to a valid document. So I added code to also overwrite response if its typeof is string.

gorhill added a commit to gorhill/uBlock that referenced this issue Sep 3, 2024
@uBlock-user
Copy link
Contributor

@gorhill Another case is twitch. m3u-prune scriptlet doesn't work there, your thoughts ?

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Sep 4, 2024

@gorhill Hmm... xml-prune still doesn't work yet.

replace is working with these though

play.virginmediatelevision.ie##+js(json-prune, avails)
||amazonaws.com/v1/dash/$replace=/<Period[^\n]+\n[^<]+<BaseURL>https:\/\/vod-virginmedia-ssai.+?<\/Period>//gms
||amazonaws.com/v1/dash/$replace=/(?:mediaPresentationDuration|start)="[^"]+"//g

I tried putting breakpoints inside uBO's xml-prune but it seems it doesn't go to that part.

stephenhawk8054 added a commit that referenced this issue Sep 4, 2024
stephenhawk8054 added a commit that referenced this issue Sep 4, 2024
@gorhill
Copy link
Member

gorhill commented Sep 4, 2024

For the case I could reproduce, I was able to take the breakpoint, and the code path I added which I believe is the issue was taken:

US VPN
URL: https://pluto.tv/us/on-demand/movies/6111bbe29b91f300138dc5d9
Filter: pluto.tv##+js(xml-prune, Period, , .mpd)

This breaks the player, as expected -- this was just to confirm the new code path is indeed needed -- the player was not broken before modifying the code.

@stephenhawk8054
Copy link
Member

stephenhawk8054 commented Sep 5, 2024

A temp solution is

play.virginmediatelevision.ie##+js(trusted-replace-outbound-text, JSON.stringify, /^.+$/s, {}, condition, adsParams)

but it's weird that I can't use any trusted-prune-inbound/outbound-object for JSON.stringify.

Both of these don't work for me

play.virginmediatelevision.ie##+js(trusted-prune-outbound-object, JSON.stringify, adsParams)
play.virginmediatelevision.ie##+js(trusted-prune-inbound-object, JSON.stringify, adsParams)

The JSON passed to JSON.stringify looks like this:

{"adsParams":{"ip":"146.70.48.5,for=64.252.114.42","app_bundle":"app_bundle","app_store_url":"app_store_url","app_version":"app_version","content_id":"52572531","content_title":"A+Touch+of+Frost","platform":"firefox","gam_child_ad_unit_1":"VirginMedia_Player_VOD/VirginMedia_Player_ROS","gam_child_ad_unit_2":"Desktop","gam_description_url":"https://play.virginmediatelevision.ie/replay/52572531","device_type":"device_type","lmt":"0","gdpr":"1","gdpr_consent":"CQEbF4AQEbF4AAGABBENBFFgAAAAAEPAABAgAAAMEgBALzAYIAAA.YAAAAAAAAAAA","cmsid":"2683343","testing":"false"}}

Ok, I think

play.virginmediatelevision.ie##+js(json-prune-fetch-response, response.ads, , propsToMatch, /streams)

is the best solution now

stephenhawk8054 added a commit that referenced this issue Sep 5, 2024
stephenhawk8054 added a commit that referenced this issue Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants