[generic] prefer enclosures over following links

This commit is contained in:
Bastian de Groot 2018-04-14 17:14:51 +02:00
parent 68ddba20ae
commit 57182dca50

View File

@ -2009,13 +2009,14 @@ class GenericIE(InfoExtractor):
entries = [] entries = []
for it in doc.findall('./channel/item'): for it in doc.findall('./channel/item'):
next_url = xpath_text(it, 'link', fatal=False) enclosure_nodes = it.findall('./enclosure')
if not next_url: for e in enclosure_nodes:
enclosure_nodes = it.findall('./enclosure') next_url = e.attrib.get('url')
for e in enclosure_nodes: if next_url:
next_url = e.attrib.get('url') break
if next_url:
break if not enclosure_nodes:
next_url = xpath_text(it, 'link', fatal=False)
if not next_url: if not next_url:
continue continue