handle items without audios
thanks for fuzzing me, radioblackout.org
This commit is contained in:
parent
9347bc6752
commit
66842a79f9
1 changed files with 8 additions and 4 deletions
12
feed
12
feed
|
@ -297,10 +297,14 @@ def get_urls_generic(tree, url_selector="description[text()]", metadata_in_body=
|
||||||
audio.date = get_item_date(it)
|
audio.date = get_item_date(it)
|
||||||
yield audio
|
yield audio
|
||||||
else:
|
else:
|
||||||
url = it.xpath(url_selector)[0]
|
try:
|
||||||
audio = Audio(url)
|
url = it.xpath(url_selector)[0]
|
||||||
audio.date = get_item_date(it)
|
except IndexError:
|
||||||
yield audio
|
logging.warn("no audio found in %s", title)
|
||||||
|
else:
|
||||||
|
audio = Audio(url)
|
||||||
|
audio.date = get_item_date(it)
|
||||||
|
yield audio
|
||||||
|
|
||||||
|
|
||||||
def get_urls_from_podcast(tree):
|
def get_urls_from_podcast(tree):
|
||||||
|
|
Loading…
Reference in a new issue