aboutsummaryrefslogtreecommitdiffstats
path: root/youtube-dl
diff options
context:
space:
mode:
Diffstat (limited to 'youtube-dl')
-rwxr-xr-xyoutube-dl5
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube-dl b/youtube-dl
index 78fb07ea1..dc7ec136f 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -252,7 +252,10 @@ class IDParser(HTMLParser.HTMLParser):
def get_element_by_id(id, html):
"""Return the content of the tag with the specified id in the passed HTML document"""
parser = IDParser(id)
- parser.loads(html)
+ try:
+ parser.loads(html)
+ except HTMLParser.HTMLParseError:
+ pass
return parser.get_result()