Open qnorsten opened 8 years ago
this happen on a Ubuntu 14.04 system..
I updated the problem description know (accidently posted to fast). As I said I managed to solve it, and if there is nothing svtplay-dl can do about it, or if it is solved for newer versions of ubuntu feel free to close it and keep it around as a solution if anyone else is experiencing the same problem.
Edit: also added the locale information know in case something can be done to detect if it runs inside a cronjob.
I am running svtplay-dl in a cronjob on a server running Ubuntu 14.04 lts. It works most of the time but for some subtitles I get a unicode error. svtplay-dl is running under python3 The command I am running svtplay-dl -S -A --raw-subtitles --remux --silent-semi http://www.svtplay.se/sista-chansen but the video with the problem is http://www.svtplay.se/video/9809554/barnlakarna/barnlakarna-sasong-3-avsnitt-3 So the following command can reproduce the error until the video dissapers. svtplay-dl -S -A --raw-subtitles --remux --silent-semi http://www.svtplay.se/video/9809554/barnlakarna/barnlakarna-sasong-3-avsnitt-3
It seems to be related to the locale of the cronjob as can be seen during the following links http://stackoverflow.com/questions/11735363/python3-unicodeencodeerror-only-when-run-from-crontab http://www.logikdev.com/2010/02/02/locale-settings-for-your-cron-job/
I managed to solve it by adding a LANG=en_US.UTF-8 before the cronjob as the cronjob runs with a different locale in an other case. I do not know if it is fixed in later versions of ubuntu (hopefully it is) or if svtplay-dl can do anything about it. (if it is fixed and there is nothing svtplay-dl can do) feel free to close the issue. At least other people running into the same problem can google it and get a solution.
Locale from terminal:
Locale from cronjob (without fix)
Here is the tracelog: