tomhung / youtube-dl2kodi

Convert youtube-dl video.info.json file to movie.nfo or episode.nfo for Kodi
10 stars 5 forks source link

Chokes on Unicode #2

Open dinsdalepiranha opened 5 years ago

dinsdalepiranha commented 5 years ago
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl2kodi.py", line 58, in <module>
    f.write(nfo)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xa9' in position 1478: ordinal not in `range(128)
entisocial commented 4 years ago

The fork from @tmechen indeed fixed the issues coming from python 2, but now if there's an output option from YouTube-dl saving the files elsewhere than the default directory, the script will not work as it will look for the .json in the default directory instead of the output directory and if you explicitly tell the new directory like that: filejson = f"/thenewdirectory/{base_file}.info.json" the nfo will be made but in the default directory, not the one from the output.

tmechen commented 4 years ago

oh i see, this is true. i used the 'base_file' var to write the nfo file. and i did realize this before, in my daily cron there is a fixed version, this is why i was baffled for a second about your report, because i do use the -o option to store the files in seperate folders... i just commited my currently running version.
hope this helps, or did i misunderstand your comment?

entisocial commented 4 years ago

Yup it's all good now 🙂 thank you very much!