[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,14 +2009,15 @@ 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)
if not next_url:
enclosure_nodes = it.findall('./enclosure') enclosure_nodes = it.findall('./enclosure')
for e in enclosure_nodes: for e in enclosure_nodes:
next_url = e.attrib.get('url') next_url = e.attrib.get('url')
if next_url: if next_url:
break break
if not enclosure_nodes:
next_url = xpath_text(it, 'link', fatal=False)
if not next_url: if not next_url:
continue continue