diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index 93f1d7b..b2aeea5 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -866,7 +866,7 @@ class Media(models.Model): # Otherwise, calculate from matched format codes vformat = None aformat = None - if '+' in format_str: + if format_str and '+' in format_str: # Seperate audio and video streams vformat_code, aformat_code = format_str.split('+') vformat = self.get_format_by_code(vformat_code) @@ -875,7 +875,7 @@ class Media(models.Model): # Combined stream or audio only cformat = self.get_format_by_code(format_str) aformat = cformat - if cformat['vcodec']: + if cformat and cformat['vcodec']: # Combined vformat = cformat if vformat: