aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-11-16 20:20:16 +0600
committerSergey M․ <dstftw@gmail.com>2015-11-16 20:20:16 +0600
commit7aefc49c4013efb5056b2c1237e22c52cb5d3c49 (patch)
tree55e213265c0075e6d965329089417ae36def4fae /youtube_dl/utils.py
parentbd1512d19649c280197729814766d590ea6c023b (diff)
downloadyoutube-dl-7aefc49c4013efb5056b2c1237e22c52cb5d3c49.tar.xz
[utils] Skip invalid/non HTML entities (Closes #7518)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index d39f313a4..b7013a6aa 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -396,7 +396,11 @@ def _htmlentity_transform(entity):
numstr = '0%s' % numstr
else:
base = 10
- return compat_chr(int(numstr, base))
+ # See https://github.com/rg3/youtube-dl/issues/7518
+ try:
+ return compat_chr(int(numstr, base))
+ except ValueError:
+ pass
# Unknown entity in name, return its literal representation
return ('&%s;' % entity)