From 3a329fe6894c6d524ddfec44a97f6b4f481068a0 Mon Sep 17 00:00:00 2001 From: Aleksander Wasaznik Date: Sun, 5 Feb 2017 15:51:12 +0100 Subject: [PATCH] Implement title fetch in metadatafetch.py A simple prototype for fetching the title of media using youtube-dl. --- grzegorz/metadatafetch.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 grzegorz/metadatafetch.py diff --git a/grzegorz/metadatafetch.py b/grzegorz/metadatafetch.py new file mode 100644 index 0000000..53432ca --- /dev/null +++ b/grzegorz/metadatafetch.py @@ -0,0 +1,7 @@ +import youtube_dl +from . import nyasync + +@nyasync.ify +def title(url): + ydl = youtube_dl.YoutubeDL() + return ydl.extract_info(url, download=False).get('title')