mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-07-03 20:42:49 -05:00
[utils] Skip invalid/non HTML entities (Closes #7518)
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user