Skip to content

Instantly share code, notes, and snippets.

@s-c-p
Created May 28, 2018 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-c-p/be33fd41219b9c66e8aae91483c07f45 to your computer and use it in GitHub Desktop.
Save s-c-p/be33fd41219b9c66e8aae91483c07f45 to your computer and use it in GitHub Desktop.
from urllib.request import urlretrieve
title = ""
with open("youtube-urls.txt", mode='rt') as i:
for url in i:
urlretrieve(url, "temp.txt")
with open("temp.txt", mode="rt") as t:
con = t.read()
kv = con.split("&")
for p in kv:
if p.startswith("title="):
title = p
break
print(title)
with open("temp.txt", mode="wt") as t:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment