mirror of
https://github.com/nathom/streamrip.git
synced 2025-06-06 17:51:22 -04:00
Fix Youtube downloads #270
This commit is contained in:
parent
eba4d451a9
commit
72591d1440
1 changed files with 8 additions and 0 deletions
|
@ -982,6 +982,7 @@ class YoutubeVideo(Media):
|
||||||
"""Dummy class implemented for consistency with the Media API."""
|
"""Dummy class implemented for consistency with the Media API."""
|
||||||
|
|
||||||
id = None
|
id = None
|
||||||
|
downloaded_ids = set()
|
||||||
|
|
||||||
class DummyClient:
|
class DummyClient:
|
||||||
"""Used because YouTube downloads use youtube-dl, not a client."""
|
"""Used because YouTube downloads use youtube-dl, not a client."""
|
||||||
|
@ -1051,6 +1052,7 @@ class YoutubeVideo(Media):
|
||||||
)
|
)
|
||||||
pv.wait()
|
pv.wait()
|
||||||
p.wait()
|
p.wait()
|
||||||
|
self.downloaded_ids.add(self.id)
|
||||||
|
|
||||||
def load_meta(self, *args, **kwargs):
|
def load_meta(self, *args, **kwargs):
|
||||||
"""Return None.
|
"""Return None.
|
||||||
|
@ -1075,9 +1077,15 @@ class YoutubeVideo(Media):
|
||||||
def convert(self, *args, **kwargs):
|
def convert(self, *args, **kwargs):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def type(self):
|
||||||
|
return "youtubevideo"
|
||||||
|
|
||||||
def __repr__(self, *args, **kwargs):
|
def __repr__(self, *args, **kwargs):
|
||||||
return f"YoutubeVideo({self.url})"
|
return f"YoutubeVideo({self.url})"
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return repr(self)
|
||||||
|
|
||||||
def __bool__(self):
|
def __bool__(self):
|
||||||
"""Return True."""
|
"""Return True."""
|
||||||
return True
|
return True
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue