diff options
author | Filippo Valsorda <filippo.valsorda@gmail.com> | 2012-04-10 23:08:53 +0200 |
---|---|---|
committer | Filippo Valsorda <filippo.valsorda@gmail.com> | 2012-04-10 23:08:53 +0200 |
commit | 7a8501e307ec1283aeacb03b471b5509b8c92854 (patch) | |
tree | 91f702401ca4c62406ff1d996e75449b65857428 /youtube-dl | |
parent | 781cc523af69a98efbd1b93cc89cec76145b8d14 (diff) | |
download | youtube-dl-7a8501e307ec1283aeacb03b471b5509b8c92854.tar.xz |
ignore parsing errors in get_element_by_id()
Diffstat (limited to 'youtube-dl')
-rwxr-xr-x | youtube-dl | 5 |
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() |