diff --git a/larigira/audiogen_podcast.py b/larigira/audiogen_podcast.py index b58ec04..5b4fee5 100644 --- a/larigira/audiogen_podcast.py +++ b/larigira/audiogen_podcast.py @@ -121,9 +121,14 @@ def get_audio_from_item(item): duration_parts = item.findtext("duration").split(":") total_seconds = 0 for i, num in enumerate(reversed(duration_parts)): - total_seconds += int(num) * (60 ** i) + total_seconds += int(float(num)) * (60 ** i) if total_seconds: audio_args["duration"] = total_seconds + else: + for child in item.xpath("group/content"): + if child.get("url") == url: + audio_args["duration"] = int(float(child.get("duration"))) + break return Audio(url, **audio_args)