handle errors in duration

This commit is contained in:
boyska 2024-05-12 16:01:58 +02:00
parent 2995e979ab
commit 2bf468a2cf

4
feed
View file

@ -589,6 +589,7 @@ def retrieve(url, args):
def audio_passes_filters(audio, args): def audio_passes_filters(audio, args):
try:
logging.debug(audio.end_date) logging.debug(audio.end_date)
if not audio.valid: if not audio.valid:
return False return False
@ -603,6 +604,8 @@ def audio_passes_filters(audio, args):
if args.max_age.total_seconds() and audio.age > args.max_age: if args.max_age.total_seconds() and audio.age > args.max_age:
return False return False
return True return True
except DurationNotFound:
return False
def expand_glob(sources: list, weights: list) -> tuple: def expand_glob(sources: list, weights: list) -> tuple:
@ -629,6 +632,7 @@ def expand_glob(sources: list, weights: list) -> tuple:
return new_sources, new_weights return new_sources, new_weights
def get_audio_by_source(args, parser): def get_audio_by_source(args, parser):
sources = args.urls sources = args.urls
if args.source_weights: if args.source_weights: