Can't download to a Samba share #4003

Closed
opened 2026-02-21 01:46:05 -05:00 by deekerman · 1 comment
Owner

Originally created by @Mykro on GitHub (Feb 11, 2015).

Relevant part of my bash script:

youtube-dl -q -v --all-subs -o "${DEST_DIR}/%(title)s_%(id)s_%(resolution)s.%(ext)s" ${FINDSTR} $*  2>&1 | tee -a "${LOG_FILE}"

Output:

Downloading https://www.youtube.com/watch?v=XXXXX to directory: smb://192.168.99.99/media/Music Videos/
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-q', '-v', '--all-subs', '-o', 'smb://192.168.99.99/media/Music Videos/%(title)s_%(id)s_%(resolution)s.%(ext)s', 'https://www.youtube.com/watch?v=XXXXX']
[debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8
[debug] youtube-dl version 2014.12.06.1
[debug] Python version 2.7.6 - Linux-3.13.0-44-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 9.16-6, avprobe 9.16-6, rtmpdump 2.4
[debug] Proxy map: {}
WARNING: video doesn't have subtitles
ERROR: unable to create directory [Errno 22] Invalid argument: 'smb:'
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 965, in process_info
    os.makedirs(dn)
  File "/usr/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 22] Invalid argument: 'smb:'

Workaround: if I remove ${DEST_DIR} from the -o parameter and instead use pushd to change to that directory first (as pushd works with samba shares), the youtube-dl command then works fine. It looks like something inside the python code might be barfing on the samba syntax.

Originally created by @Mykro on GitHub (Feb 11, 2015). Relevant part of my bash script: ``` youtube-dl -q -v --all-subs -o "${DEST_DIR}/%(title)s_%(id)s_%(resolution)s.%(ext)s" ${FINDSTR} $* 2>&1 | tee -a "${LOG_FILE}" ``` Output: ``` Downloading https://www.youtube.com/watch?v=XXXXX to directory: smb://192.168.99.99/media/Music Videos/ [debug] System config: [] [debug] User config: [] [debug] Command-line args: ['-q', '-v', '--all-subs', '-o', 'smb://192.168.99.99/media/Music Videos/%(title)s_%(id)s_%(resolution)s.%(ext)s', 'https://www.youtube.com/watch?v=XXXXX'] [debug] Encodings: locale UTF-8, fs UTF-8, out None, pref UTF-8 [debug] youtube-dl version 2014.12.06.1 [debug] Python version 2.7.6 - Linux-3.13.0-44-generic-x86_64-with-Ubuntu-14.04-trusty [debug] exe versions: avconv 9.16-6, avprobe 9.16-6, rtmpdump 2.4 [debug] Proxy map: {} WARNING: video doesn't have subtitles ERROR: unable to create directory [Errno 22] Invalid argument: 'smb:' Traceback (most recent call last): File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 965, in process_info os.makedirs(dn) File "/usr/lib/python2.7/os.py", line 150, in makedirs makedirs(head, mode) File "/usr/lib/python2.7/os.py", line 150, in makedirs makedirs(head, mode) File "/usr/lib/python2.7/os.py", line 150, in makedirs makedirs(head, mode) File "/usr/lib/python2.7/os.py", line 150, in makedirs makedirs(head, mode) File "/usr/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 22] Invalid argument: 'smb:' ``` Workaround: if I remove ${DEST_DIR} from the -o parameter and instead use pushd to change to that directory first (as pushd works with samba shares), the youtube-dl command then works fine. It looks like something inside the python code might be barfing on the samba syntax.
Author
Owner

@phihag commented on GitHub (Feb 11, 2015):

Like all command-line programs I am aware of, youtube-dl just supports the normal filesystem. File paths starting with smb:// will generally only be supported in KDE programs, which are a whole different beast together (imagine if every program had to implement or link to the kioslaves library! That would make even trivial programs like ls really really complicated).

The Linux (though not the KDE) way to use SMB shares is to mount the share into the local filesystem.

Therefore, I must sadly close this issue. While we would not actively reject a pull request that adds kioslaves support (although that might pose a problem, since it would be highly platform-specific), adding kioslaves is far outside the scope of youtube-dl. Sorry!

@phihag commented on GitHub (Feb 11, 2015): Like _all_ command-line programs I am aware of, youtube-dl just supports the normal filesystem. File paths starting with `smb://` will generally only be supported in KDE programs, which are a whole different beast together (imagine if every program had to implement or link to the kioslaves library! That would make even trivial programs like `ls` really really complicated). The Linux (though not the KDE) way to use SMB shares is to [mount](https://www.samba.org/samba/docs/man/manpages-3/mount.cifs.8.html) the share into the local filesystem. Therefore, I must sadly close this issue. While we would not actively reject a pull request that adds kioslaves support (although that might pose a problem, since it would be highly platform-specific), adding kioslaves is far outside the scope of youtube-dl. Sorry!
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-ytdl-org#4003
No description provided.