mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-24 14:06:36 +00:00
Skip media without any formats
This commit is contained in:
parent
cf951a820a
commit
942452c6a2
@ -1499,7 +1499,16 @@ class Media(models.Model):
|
||||
if not callable(indexer):
|
||||
raise Exception(f'Media with source type f"{self.source.source_type}" '
|
||||
f'has no indexer')
|
||||
return indexer(self.url)
|
||||
response = indexer(self.url)
|
||||
no_formats_available = (
|
||||
not response or
|
||||
"formats" not in response.keys() or
|
||||
0 == len(response["formats"])
|
||||
)
|
||||
if no_formats_available:
|
||||
self.can_download = False
|
||||
self.skip = True
|
||||
return response
|
||||
|
||||
def calculate_episode_number(self):
|
||||
if self.source.source_type == Source.SOURCE_TYPE_YOUTUBE_PLAYLIST:
|
||||
|
Loading…
Reference in New Issue
Block a user