offish / twitchtube

Twitch YouTube bot. Automatically make video compilations of the most viewed Twitch clips and upload them to YouTube using Python 3.
MIT License
538 stars 77 forks source link

Add UTF-8 encoding to Twitch Clip Title #13

Closed kyroskoh closed 3 years ago

kyroskoh commented 3 years ago

Please add UTF-8 encoding to Twitch Clip Title if it is non-English.

twitchtube | 07:09:26 - info: Downloading clip with slug: UglyVibrantCrabsCharlietheUnicorn.
Traceback (most recent call last):
  File "main.py", line 43, in <module>
    names = download_clips(clips, VIDEO_LENGTH, path)
  File "/home/kyroskoh/twitchtube/twitchtube/clips.py", line 144, in download_clips
    download_clip(data[clip]['url'], path)
  File "/home/kyroskoh/twitchtube/twitchtube/clips.py", line 91, in download_clip
    log.info(f'Saving "{clip_title}" as "{out_filename}".')
  File "/home/kyroskoh/twitchtube/twitchtube/logging.py", line 21, in info
    log(f.GREEN, 'info', text)
  File "/home/kyroskoh/twitchtube/twitchtube/logging.py", line 15, in log
    print(f'{f.GREEN}twitchtube {f.WHITE}| {time} - {color + sort}{f.WHITE}: {text}{f.WHITE}')
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 58-59: ordinal not in range(256)