diff options
author | Jesús <heckyel@hyperbola.info> | 2020-12-30 00:04:41 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2020-12-30 00:04:41 -0500 |
commit | 056c3be3f2ab9a19d8b2c38396826aaad9d4081d (patch) | |
tree | 248bb34a95fab6377c6205abc12d032934e28025 /youtube/util.py | |
parent | 0a9d24b2614a8cd814d2fffc5f254034245f6496 (diff) | |
download | yt-local-056c3be3f2ab9a19d8b2c38396826aaad9d4081d.tar.lz yt-local-056c3be3f2ab9a19d8b2c38396826aaad9d4081d.tar.xz yt-local-056c3be3f2ab9a19d8b2c38396826aaad9d4081d.zip |
strip_non_ascii in comments-author-name
Diffstat (limited to 'youtube/util.py')
-rw-r--r-- | youtube/util.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube/util.py b/youtube/util.py index e92fed5..3d5546a 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -601,3 +601,9 @@ def to_valid_filename(name): name = '_' + name return name + + +def strip_non_ascii(string): + ''' Returns the string without non ASCII characters''' + stripped = (c for c in string if 0 < ord(c) < 127) + return ''.join(stripped) |