mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-06-30 11:02:51 -05:00
[ard] Make more robust against missing thumbnails
I cannot reproduce this error, it's from travis.
This commit is contained in:
@ -304,6 +304,17 @@ def xpath_with_ns(path, ns_map):
|
||||
return '/'.join(replaced)
|
||||
|
||||
|
||||
def xpath_text(node, xpath, name=None, fatal=False):
|
||||
n = node.find(xpath)
|
||||
if n is None:
|
||||
if fatal:
|
||||
name = xpath if name is None else name
|
||||
raise ExtractorError('Could not find XML element %s' % name)
|
||||
else:
|
||||
return None
|
||||
return n.text
|
||||
|
||||
|
||||
compat_html_parser.locatestarttagend = re.compile(r"""<[a-zA-Z][-.a-zA-Z0-9:_]*(?:\s+(?:(?<=['"\s])[^\s/>][^\s/=>]*(?:\s*=+\s*(?:'[^']*'|"[^"]*"|(?!['"])[^>\s]*))?\s*)*)?\s*""", re.VERBOSE) # backport bugfix
|
||||
class BaseHTMLParser(compat_html_parser.HTMLParser):
|
||||
def __init(self):
|
||||
|
Reference in New Issue
Block a user