mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 03:17:44 +03:00
[common] catch UnicodeEncodeError and instruct users to change the locale
This commit is contained in:
parent
6590bb33cd
commit
225f18d347
@ -1183,6 +1183,14 @@ def script_main(script_name, download, download_playlist, **kwargs):
|
||||
raise
|
||||
else:
|
||||
sys.exit(1)
|
||||
except UnicodeEncodeError:
|
||||
log.e('[error] oops, the current environment does not seem to support Unicode.')
|
||||
log.e('please set it to a UTF-8-aware locale first,')
|
||||
log.e('so as to save the video (with some Unicode characters) correctly.')
|
||||
log.e('you can do it like this:')
|
||||
log.e(' (Windows) % chcp 65001 ')
|
||||
log.e(' (Linux) $ LC_CTYPE=en_US.UTF-8')
|
||||
sys.exit(1)
|
||||
except Exception:
|
||||
if not traceback:
|
||||
log.e('[error] oops, something went wrong.')
|
||||
|
Loading…
x
Reference in New Issue
Block a user