0

I am trying to set up a schedule task to download some files from YouTube. The download script works well when I am ssh'ing as a user. However, the download filenames are wrong when started by the system task. It seems to be a locale issue, as the download filename comes with some Chinese characters.

How can I config the system task to support utf-8 filenames?

Here is my current script:

#!/bin/sh

LANG="en_US.UTF-8"

URL='https://www.youtube.com/playlist?list=PLPY0_ooDN1du85pbM2mEaVRE-dS-fHtT3'
OUT='/var/services/download/video/%(upload_date)s-%(title)s.%(ext)s'
/var/services/homes/ohho/tool/youtube-dl --max-downloads 6 $URL -o $OUT
ohho
  • 975
  • 8
  • 18
  • 34

1 Answers1

1

you should use export when you set LANG environment variables. If not, the tool youtube-dl will still get the default LANG which is ascii.

export LANG=en_US.UTF-8

Hope this helps you.

Zhigang Ji
  • 11
  • 1