From 72591d1440e87ae2b0605a124bbe06145c9e169e Mon Sep 17 00:00:00 2001 From: Nathan Thomas Date: Fri, 14 Jan 2022 21:21:56 -0800 Subject: [PATCH] Fix Youtube downloads #270 --- streamrip/media.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/streamrip/media.py b/streamrip/media.py index c994e7a1..bd3a84c4 100644 --- a/streamrip/media.py +++ b/streamrip/media.py @@ -982,6 +982,7 @@ class YoutubeVideo(Media): """Dummy class implemented for consistency with the Media API.""" id = None + downloaded_ids = set() class DummyClient: """Used because YouTube downloads use youtube-dl, not a client.""" @@ -1051,6 +1052,7 @@ def download( ) pv.wait() p.wait() + self.downloaded_ids.add(self.id) def load_meta(self, *args, **kwargs): """Return None. @@ -1075,9 +1077,15 @@ def tag(self, *args, **kwargs): def convert(self, *args, **kwargs): raise NotImplementedError + def type(self): + return "youtubevideo" + def __repr__(self, *args, **kwargs): return f"YoutubeVideo({self.url})" + def __str__(self): + return repr(self) + def __bool__(self): """Return True.""" return True