Fix Youtube downloads #270

This commit is contained in:
Nathan Thomas 2022-01-14 21:21:56 -08:00
parent eba4d451a9
commit 72591d1440
1 changed files with 8 additions and 0 deletions

View File

@ -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 @@ class YoutubeVideo(Media):
)
pv.wait()
p.wait()
self.downloaded_ids.add(self.id)
def load_meta(self, *args, **kwargs):
"""Return None.
@ -1075,9 +1077,15 @@ class YoutubeVideo(Media):
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