mirror of
https://github.com/ihabunek/twitch-dl
synced 2024-08-30 18:32:25 +00:00
Allow unicode values in slugs
Otherwise non-ascii characters get stripped which is not good for e.g. titles in cyrillic script.
This commit is contained in:
parent
15ca684286
commit
2171a9e08e
@ -58,6 +58,6 @@ def slugify(value):
|
||||
re_pattern = re.compile(r'[^\w\s-]', flags=re.U)
|
||||
re_spaces = re.compile(r'[-\s]+', flags=re.U)
|
||||
value = str(value)
|
||||
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('ascii')
|
||||
value = unicodedata.normalize('NFKC', value)
|
||||
value = re_pattern.sub('', value).strip().lower()
|
||||
return re_spaces.sub('-', value)
|
||||
return re_spaces.sub('_', value)
|
||||
|
Loading…
Reference in New Issue
Block a user