marhoy / nrk-download

Download content from NRK, complete with images and subtitles:
https://nrkdownload.readthedocs.org
GNU General Public License v3.0
54 stars 10 forks source link

Problem while executing over ssh? #3

Closed eivindml closed 7 years ago

eivindml commented 7 years ago

Hi,

first of, love the app/initative! 🎉

When I execute the program directly from my server, it works great. But when I try to execute some commands over ssh, it crashes. Not sure if this is a problem with the application itself, or with my ssh setup somehow. But everything else I do over ssh works fine. This is the error message I get over ssh:

mini:~ eivindml$ nrkdownload -s "kampen om livet"

Matching series:
 0: Ganefryd : 1 Sesong(er)
 1: Kampen om livet : 1 Sesong(er)

Enter a number in the range 0-1. (q to quit): 1
1

Matching programs
 0: Kampen om livet (Sesong 1): Er vi alene i Universet? - 1:8 - S01E01
 1: Kampen om livet (Sesong 1): Kan vi leve evig? - 2:8 - S01E02
 2: Kampen om livet (Sesong 1): Kan vi utrydde sult? - 3:8 - S01E03
 3: Kampen om livet (Sesong 1): Kan vi kurere kreft? - 4:8 - S01E04
Traceback (most recent call last):
  File "/usr/local/bin/nrkdownload", line 11, in <module>
    sys.exit(main())
  File "/Library/Python/2.7/site-packages/nrkdownload/commandline_script.py", line 31, in main
    nrkdownload.search_from_cmdline(arguments)
  File "/Library/Python/2.7/site-packages/nrkdownload/nrktv.py", line 360, in search_from_cmdline
    series_download(series[index])
  File "/Library/Python/2.7/site-packages/nrkdownload/nrktv.py", line 346, in series_download
    ask_for_program_download(programs)
  File "/Library/Python/2.7/site-packages/nrkdownload/nrktv.py", line 219, in ask_for_program_download
    print('{:2}: {}'.format(i, p))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf8' in position 48: ordinal not in range(128)

Any ideas?

marhoy commented 7 years ago

This is due to a missing environment variable on your Mac mini. Add the following to your ~/.bash_profile: export LC_CTYPE=en_US.UTF-8

Then source it (. ~/.bash_profile) or log out/in.

eivindml commented 7 years ago

Great, thanks! :)