Compare commits

...

2 commits

Author SHA1 Message Date
dfc59e94f9 FIX exception reporting causing another exception 2024-05-30 10:06:26 +02:00
3e609581cf podcast: ignores broken items 2022-05-06 13:31:07 +02:00
2 changed files with 11 additions and 6 deletions

View file

@ -142,16 +142,21 @@ def get_audio_from_item(item):
def get_urls(tree):
items = tree.xpath("//item")
for it in items:
# title = it.find("title").text
audio = get_audio_from_item(it)
for i, it in enumerate(items):
try:
audio = get_audio_from_item(it)
except Exception:
logging.error("Could not parse item #%d, skipping", i)
continue
if audio is None:
continue
if audio.date is None:
audio.date = get_item_date(it)
try:
audio.date = get_item_date(it)
except Exception:
logging.warn("Could not find date for item #%d", i)
yield audio
def parse_duration(arg):
if arg.isdecimal():
secs = int(arg)

View file

@ -68,7 +68,7 @@ def percentwait(songs, context, conf, getdur=get_duration):
# must be an error! mutagen support is not always perfect
return (
True,
("mutagen could not calculate length of %s" % ",".songs["uris"]),
("mutagen could not calculate length of %s" % ",".join(songs["uris"])),
)
wait = eventduration * (percentwait / 100.0)
if remaining > wait: