Hellowlol / bw_plex

binge watching for plex
MIT License
366 stars 23 forks source link

ascii issue #27

Closed halali closed 6 years ago

halali commented 6 years ago

i have some episodes in Czech language so there is diacritic

PS C:\Users\Halali> bw_plex find_theme
2018-04-21 10:39:47,450 :: bw_plex :: DEBUG :: Getting server Server
2018-04-21 10:39:47,716 :: bw_plex :: DEBUG :: Downloading all themes from youtube. This might take a while..
2018-04-21 10:39:49,211 :: bw_plex :: DEBUG :: Searching youtube for name The 100 rk 243380 save_path C:\Users\Halali/.config/bw_plex\temp_themes url None
2018-04-21 10:40:54,953 :: bw_plex :: DEBUG :: Searching youtube for name 12 Monkeys rk 316883 save_path C:\Users\Halali/.config/bw_plex\temp_themes url None
2018-04-21 10:40:58,450 :: bw_plex :: DEBUG :: Searching youtube for name 13 Reasons Why rk 706334 save_path C:\Users\Halali/.config/bw_plex\temp_themes url None
2018-04-21 10:41:02,282 :: bw_plex :: DEBUG :: Searching youtube for name 13.okrsek rk 755649 save_path C:\Users\Halali/.config/bw_plex\temp_themes url None
2018-04-21 10:41:05,835 :: bw_plex :: DEBUG :: Searching youtube for name 24 Hodin: Nezastavitelný rk 729628 save_path C:\Users\Halali/.config/bw_plex\temp_themes url None
Traceback (most recent call last):
  File "C:\Python27\Scripts\bw_plex-script.py", line 11, in <module>
    load_entry_point('bw-plex', 'console_scripts', 'bw_plex')()
  File "c:\python27\lib\site-packages\click\core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "c:\python27\lib\site-packages\click\core.py", line 697, in main
    rv = self.invoke(ctx)
  File "c:\python27\lib\site-packages\click\core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python27\lib\site-packages\click\core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python27\lib\site-packages\click\core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "d:\apps\src\bw-plex\bw_plex\plex.py", line 453, in find_theme
    save_path=TEMP_THEMES)
  File "d:\apps\src\bw-plex\bw_plex\misc.py", line 432, in search_for_theme_youtube
    fp = get_valid_filename(fp)
  File "d:\apps\src\bw-plex\bw_plex\misc.py", line 291, in get_valid_filename
    clean_tail = str(tail).strip()
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfd' in position 23: ordinal not in range(128)
Hellowlol commented 6 years ago

Thanks! I don’t have any shows with weird names. I’ll fix this later, in the mean time you can give python 3 a ago.

halali commented 6 years ago

Will try

Hellowlol commented 6 years ago

https://github.com/Hellowlol/bw_plex/commit/fcd778e1ad294eae1299e1421fbe880d4d3d4a8c should fix the issue, feel free to reopen if thats on the case.