[generic] prefer enclosures over following links
This commit is contained in:
parent
68ddba20ae
commit
57182dca50
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user