From 942452c6a28fd3d64fdcc6af6c212a112b0bb124 Mon Sep 17 00:00:00 2001 From: tcely Date: Wed, 25 Dec 2024 10:53:25 -0500 Subject: [PATCH] Skip media without any formats --- tubesync/sync/models.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index 455a38a5..15daf5ba 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -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: