Last active
September 22, 2018 16:16
-
-
Save spookyahell/8be293c2a3b79eb10f5ff8770502cdee to your computer and use it in GitHub Desktop.
Ever needed that one YouTube ad downloaded but didn't know how to get the URL? (while watch on your computer) Just copy debug infos to clipboard via right click on the viewer and then run this script. (Run in python3.6+)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from tkinter import Tk | |
AdDocId = None | |
text = Tk().clipboard_get() | |
for line in text.split('\n'): | |
x = re.search('"ad_docid": "(.+)"', line) | |
if x: | |
AdDocId = x.group(1) | |
break | |
#~ print() | |
if AdDocId is not None: | |
input(f'https://www.youtube.com/watch?v={AdDocId}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment