Skip to content

Commit

Permalink
Fix Youtube downloads #270
Browse files Browse the repository at this point in the history
  • Loading branch information
nathom committed Jan 15, 2022
1 parent eba4d45 commit 72591d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions streamrip/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -1051,6 +1052,7 @@ def download(
)
pv.wait()
p.wait()
self.downloaded_ids.add(self.id)

def load_meta(self, *args, **kwargs):
"""Return None.
Expand All @@ -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
Expand Down

0 comments on commit 72591d1

Please sign in to comment.