aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2019-03-05 23:45:40 +0700
committerSergey M․ <dstftw@gmail.com>2019-03-05 23:56:33 +0700
commitd9eb580a796ef6c9a248fdd8896ccf85349c35eb (patch)
tree0ce10624b51913ead63ec996a2dd06848aaf9174 /youtube_dl
parent5dcd630dca9b75ec2ca920ae7799252e0e0bb599 (diff)
[extractor/common] Do not fail on invalid data while parsing F4M manifest in non fatal mode
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/common.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index 641e50f3c..55ce1a888 100644
--- a/youtube_dl/extractor/common.py
+++ b/youtube_dl/extractor/common.py
@@ -13,6 +13,7 @@ import socket
import sys
import time
import math
+import xml
from ..compat import (
compat_cookiejar,
@@ -1464,6 +1465,9 @@ class InfoExtractor(object):
def _parse_f4m_formats(self, manifest, manifest_url, video_id, preference=None, f4m_id=None,
transform_source=lambda s: fix_xml_ampersands(s).strip(),
fatal=True, m3u8_id=None):
+ if not isinstance(manifest, xml.etree.ElementTree.Element) and not fatal:
+ return []
+
# currently youtube-dl cannot decode the playerVerificationChallenge as Akamai uses Adobe Alchemy
akamai_pv = manifest.find('{http://ns.adobe.com/f4m/1.0}pv-2.0')
if akamai_pv is not None and ';' in akamai_pv.text: