Closed Sopor closed 7 years ago
Need to convert ascii string to Unicode, this problem can also arise for other services.
I'm getting the same issue with TV4 Play when using 1.9.6-25-g9f1c01a
svtplay-dl --verbose https://www.tv4play.se/program/bachelor-n%C3%A4r-leken-blev-allvar/3937491 DEBUG [1508341324.41] /usr/local/bin/svtplay-dl/svtplay_dl/utils/init.py/request: HTTP getting 'https://www.tv4play.se/program/bachelor-n%C3%A4r-leken-blev-allvar/3937491' DEBUG [1508341324.54] /usr/local/bin/svtplay-dl/svtplay_dl/utils/init.py/request: HTTP getting 'http://prima.tv4play.se/api/web/asset/3937491/play' DEBUG [1508341324.69] /usr/local/bin/svtplay-dl/svtplay_dl/utils/init.py/request: HTTP getting 'http://webapi.tv4play.se/play/video_assets?type=episode&is_live=false&platform=web&node_nids=bachelor-n%C3%A4r-leken-blev-allvar&per_page=99999' ERROR [1508341324.75] /usr/local/bin/svtplay-dl/svtplay_dl/init.py/get_one_media: version: 1.9.6-25-g9f1c01a Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main "main", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/usr/local/bin/svtplay-dl/main.py", line 13, in
File "/usr/local/bin/svtplay-dl/svtplay_dl/init.py", line 479, in main File "/usr/local/bin/svtplay-dl/svtplay_dl/init.py", line 201, in get_media File "/usr/local/bin/svtplay-dl/svtplay_dl/init.py", line 249, in get_one_media File "/usr/local/bin/svtplay-dl/svtplay_dl/service/tv4play.py", line 71, in get File "/usr/local/bin/svtplay-dl/svtplay_dl/service/tv4play.py", line 186, in _autoname UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 12: ordinal not in range(128)
Yes, it doesn't seems to be fixed yet :(
I'm getting a similiar error that seems to happen when using the --merge-subtitle
or -S
flags. Using the latest 2.1 version. I get the same errors for SVT Play and Dplay.
Traceback (most recent call last):
File "/usr/bin/svtplay-dl", line 7, in <module>
svtplay_dl.main()
File "/usr/lib/python3/dist-packages/svtplay_dl/__init__.py", line 64, in main
get_media(urls[0], config, __version__)
File "/usr/lib/python3/dist-packages/svtplay_dl/utils/getmedia.py", line 56, in get_media
get_all_episodes(stream, url)
File "/usr/lib/python3/dist-packages/svtplay_dl/utils/getmedia.py", line 87, in get_all_episodes
get_one_media(substream)
File "/usr/lib/python3/dist-packages/svtplay_dl/utils/getmedia.py", line 176, in get_one_media
options_subs_dl(subfixes)
File "/usr/lib/python3/dist-packages/svtplay_dl/utils/getmedia.py", line 171, in options_subs_dl
subs[0].download()
File "/usr/lib/python3/dist-packages/svtplay_dl/subtitle/__init__.py", line 73, in download
self.save_file(data, "srt")
File "/usr/lib/python3/dist-packages/svtplay_dl/subtitle/__init__.py", line 82, in save_file
file_d.write(data)
UnicodeEncodeError: 'ascii' codec can't encode character '\xf6' in position 51: ordinal not in range(128)
Edit: Seems like this was an issue when running it through SSH from my Mac to my Raspberry Pi. Doing the command in the Pi itself worked without any errors.
I get this when i try to download with svtplay-dl 1.9.6-21-g59d2513