Skip to content

Instantly share code, notes, and snippets.

@kevinoconnor7
Created December 31, 2020 21:47
Show Gist options
  • Save kevinoconnor7/dced6a9f4ebcf6002c97a64eb5788fe3 to your computer and use it in GitHub Desktop.
Save kevinoconnor7/dced6a9f4ebcf6002c97a64eb5788fe3 to your computer and use it in GitHub Desktop.
diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py
index 0f2c06f40..77ffa7789 100644
--- a/youtube_dl/downloader/hls.py
+++ b/youtube_dl/downloader/hls.py
@@ -138,6 +138,9 @@ class HlsFD(FragmentFD):
else compat_urlparse.urljoin(man_url, line))
if extra_query:
frag_url = update_url_query(frag_url, extra_query)
+ if '_ad/creative/' in frag_url:
+ self.to_screen('[AD!] Found ad url: %s' % frag_url)
+ continue
count = 0
headers = info_dict.get('http_headers', {})
if byte_range:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment