Python error when executing via crond #1444

Closed
opened 2026-02-20 22:11:21 -05:00 by deekerman · 4 comments
Owner

Originally created by @bwa- on GitHub (Nov 26, 2013).

Originally assigned to: @jaimeMF on GitHub.

I think #1810/#1811 might have introduced an error? I get the following message with the current version (2013-11-25.3), executing a script via cron:

Traceback (most recent call last):
File "/usr/bin/youtube-dl", line 9, in
load_entry_point('youtube-dl==2013.11.25.3', 'console_scripts', 'youtube-dl')()
File "/usr/lib/python3.3/site-packages/youtube_dl/init.py", line 693, in main
_real_main(argv)
File "/usr/lib/python3.3/site-packages/youtube_dl/init.py", line 656, in _real_main
with YoutubeDL(ydl_opts) as ydl:
File "/usr/lib/python3.3/site-packages/youtube_dl/YoutubeDL.py", line 164, in init
u'Assuming --restrict-filenames since file system encoding '
File "/usr/lib/python3.3/site-packages/youtube_dl/YoutubeDL.py", line 301, in report_warning
self.to_stderr(warning_message)
File "/usr/lib/python3.3/site-packages/youtube_dl/YoutubeDL.py", line 219, in to_stderr
if self.params.get('logger'):
AttributeError: 'NoneType' object has no attribute 'get'

Here's the command:

nice -n 19 youtube-dl --playlist-end 20 -c -i --max-quality 22 -o "%(title)s.%(id)s.%(ext)s" https://www.youtube.com/user/username

uname -a:

Linux rpi 3.10.19-3-ARCH #1 PREEMPT Thu Nov 21 20:33:10 CST 2013 armv6l GNU/Linux

This only happens when using cron. Downgrading to version 2013-11-18 fixed it for me.

Originally created by @bwa- on GitHub (Nov 26, 2013). Originally assigned to: @jaimeMF on GitHub. I think #1810/#1811 might have introduced an error? I get the following message with the current version (2013-11-25.3), executing a script via cron: Traceback (most recent call last): File "/usr/bin/youtube-dl", line 9, in <module> load_entry_point('youtube-dl==2013.11.25.3', 'console_scripts', 'youtube-dl')() File "/usr/lib/python3.3/site-packages/youtube_dl/**init**.py", line 693, in main _real_main(argv) File "/usr/lib/python3.3/site-packages/youtube_dl/__init__.py", line 656, in _real_main with YoutubeDL(ydl_opts) as ydl: File "/usr/lib/python3.3/site-packages/youtube_dl/YoutubeDL.py", line 164, in __init__ u'Assuming --restrict-filenames since file system encoding ' File "/usr/lib/python3.3/site-packages/youtube_dl/YoutubeDL.py", line 301, in report_warning self.to_stderr(warning_message) File "/usr/lib/python3.3/site-packages/youtube_dl/YoutubeDL.py", line 219, in to_stderr if self.params.get('logger'): AttributeError: 'NoneType' object has no attribute 'get' Here's the command: nice -n 19 youtube-dl --playlist-end 20 -c -i --max-quality 22 -o "%(title)s.%(id)s.%(ext)s" https://www.youtube.com/user/username uname -a: Linux rpi 3.10.19-3-ARCH #1 PREEMPT Thu Nov 21 20:33:10 CST 2013 armv6l GNU/Linux This only happens when using cron. Downgrading to version 2013-11-18 fixed it for me.
deekerman 2026-02-20 22:11:21 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@jaimeMF commented on GitHub (Nov 26, 2013):

Sorry for the problem and thanks for the report! You are right, that change introduced a bug.
It seems that you are using pip, if you want to verify it's fixed, you can install the code from the repo with: pip install -e git+https://github.com/rg3/youtube-dl.git#egg=youtube-dl

@jaimeMF commented on GitHub (Nov 26, 2013): Sorry for the problem and thanks for the report! You are right, that change introduced a bug. It seems that you are using pip, if you want to verify it's fixed, you can install the code from the repo with: `pip install -e git+https://github.com/rg3/youtube-dl.git#egg=youtube-dl`
Author
Owner

@bwa- commented on GitHub (Nov 26, 2013):

Thanks for the rapid feedback! I actually use Arch's built-in package manager (pacman). I tried setting youtube-dl up via pip but failed horribly when it told me something about unknown distributions and such.
I'll just use the old version until this change gets rolled out. If I run into this or another problem, I'll report back.

Thanks again!

@bwa- commented on GitHub (Nov 26, 2013): Thanks for the rapid feedback! I actually use Arch's built-in package manager (pacman). I tried setting youtube-dl up via pip but failed horribly when it told me something about unknown distributions and such. I'll just use the old version until this change gets rolled out. If I run into this or another problem, I'll report back. Thanks again!
Author
Owner

@HalosGhost commented on GitHub (Nov 26, 2013):

You may find it preferable to use the youtube-dl-git package on the ALUR. That way you can rebuild whenever a new fix is included.

@HalosGhost commented on GitHub (Nov 26, 2013): You may find it preferable to use the youtube-dl-git package on the ALUR. That way you can rebuild whenever a new fix is included.
Author
Owner

@phihag commented on GitHub (Nov 27, 2013):

Fixed in youtube-dl 2013.11.28. You'll still get the warning (and messed-up filenames) though. Set the LC_ALL environment variable to indicate a filesystem encoding. en_US.UTF-8 should be a good value for most systems.

@phihag commented on GitHub (Nov 27, 2013): Fixed in youtube-dl 2013.11.28. You'll still get the warning (and messed-up filenames) though. Set the `LC_ALL` environment variable to indicate a filesystem encoding. `en_US.UTF-8` should be a good value for most systems.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#1444
No description provided.