Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When title contains invalid characters in filename for windows, download with --output option fails. #364

Closed
github0 opened this issue Jun 26, 2012 · 1 comment

Comments

@github0
Copy link

@github0 github0 commented Jun 26, 2012

Hi,

When title contains invalid characters in filename for windows, download with --output option fails.

Regards
Yoshi

Command line

C:\Python27\youtube-dl.py --ignore-errors --output "D:\Downloaded Files%(title)s-%(id)s.%(ext)s" --write-description --no-mtime --batch-file "C:\Users\user\Desktop\youtube-dl.lst"

C:\Python27\youtube-dl.py --ignore-errors --output "D:\Downloaded Files%(title)s-%(id)s.%(ext)s" --no-mtime --batch-file "C:\Users\user\Desktop\youtube-dl.lst"

Version
2012.02.27

OS
Windows 7 x64

Python
Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32

Examples(The contents of the movie do not have a meaning.)

/
CodeIgniter, jQuery - Asterisk Billing / Invoicing - geekhut.org

http://www.youtube.com/watch?v=O6t9WS7xixk

[youtube] O6t9WS7xixk: Downloading video webpage
[youtube] O6t9WS7xixk: Downloading video info webpage
[youtube] O6t9WS7xixk: Extracting video information
[info] Writing video description to: D:\Downloaded Files\CodeIgniter, jQuery - Asterisk Billing / Invoicing - geekhut.org-O6t9WS7xixk.mp4.description

ERROR: Cannot write description file D:\Downloaded Files\CodeIgniter, jQuery - Asterisk Billing / Invoicing - geekhut.org-O6t9WS7xixk.mp4.description

[youtube] O6t9WS7xixk: Downloading video webpage
[youtube] O6t9WS7xixk: Downloading video info webpage
[youtube] O6t9WS7xixk: Extracting video information

ERROR: unable to open for writing: [Errno 2] No such file or directory: u'D#\Downloaded Files\CodeIgniter, jQuery - Asterisk Billing # Invoicing - geekhut.org-O6t9WS7xixk.mp4.part'

:
US Olympic Committee: Don't be an Asterisk

http://www.youtube.com/watch?v=p-FI5JRGHXk

[youtube] p-FI5JRGHXk: Downloading video webpage
[youtube] p-FI5JRGHXk: Downloading video info webpage
[youtube] p-FI5JRGHXk: Extracting video information
[info] Writing video description to: D:\Downloaded Files\US Olympic Committee: Don't be an Asterisk-p-FI5JRGHXk.mp4.description
[download] Destination: D:\Downloaded Files\US Olympic Committee: Don't be an Asterisk-p-FI5JRGHXk.mp4

ERROR: unable to rename file

[youtube] p-FI5JRGHXk: Downloading video webpage
[youtube] p-FI5JRGHXk: Downloading video info webpage
[youtube] p-FI5JRGHXk: Extracting video information
[download] Destination: D:\Downloaded Files\US Olympic Committee: Don't be an Asterisk-p-FI5JRGHXk.mp4

ERROR: unable to rename file

M83 - Asterisk *

http://www.youtube.com/watch?v=tey2y7E1_Ew

[youtube] tey2y7E1_Ew: Downloading video webpage
[youtube] tey2y7E1_Ew: Downloading video info webpage
[youtube] tey2y7E1_Ew: Extracting video information
[info] Writing video description to: D:\Downloaded Files\M83 - Asterisk *-tey2y7E1_Ew.flv.description

ERROR: Cannot write description file D:\Downloaded Files\M83 - Asterisk *-tey2y7E1_Ew.flv.description

[youtube] tey2y7E1_Ew: Downloading video webpage
[youtube] tey2y7E1_Ew: Downloading video info webpage
[youtube] tey2y7E1_Ew: Extracting video information

ERROR: unable to open for writing: [Errno 2] No such file or directory: u'D#\Downloaded Files\M83 - Asterisk #-tey2y7E1_Ew.flv.part'

?
? (Question Mark)

http://www.youtube.com/watch?v=2zok2A3TJec

[youtube] 2zok2A3TJec: Downloading video webpage
[youtube] 2zok2A3TJec: Downloading video info webpage
[youtube] 2zok2A3TJec: Extracting video information
[info] Writing video description to: D:\Downloaded Files? (Question Mark)-2zok2A3TJec.flv.description

ERROR: Cannot write description file D:\Downloaded Files? (Question Mark)-2zok2A3TJec.flv.description

[youtube] 2zok2A3TJec: Downloading video webpage
[youtube] 2zok2A3TJec: Downloading video info webpage
[youtube] 2zok2A3TJec: Extracting video information

ERROR: unable to open for writing: [Errno 2] No such file or directory: u'D#\Downloaded Files# (Question Mark)-2zok2A3TJec.flv.part'

"
ND "Solo Asterisk" Defense Drill

http://www.youtube.com/watch?v=yrQlvqvjWAk

[youtube] yrQlvqvjWAk: Downloading video webpage
[youtube] yrQlvqvjWAk: Downloading video info webpage
[youtube] yrQlvqvjWAk: Extracting video information
[info] Writing video description to: D:\Downloaded Files\ND "Solo Asterisk" Defense Drill-yrQlvqvjWAk.flv.description

ERROR: Cannot write description file D:\Downloaded Files\ND "Solo Asterisk" Defense Drill-yrQlvqvjWAk.flv.description

[youtube] yrQlvqvjWAk: Downloading video webpage
[youtube] yrQlvqvjWAk: Downloading video info webpage
[youtube] yrQlvqvjWAk: Extracting video information

ERROR: unable to open for writing: [Errno 2] No such file or directory: u'D#\Downloaded Files\ND #Solo Asterisk# Defense Drill-yrQlvqvjWAk.flv.part'

|
|

http://www.youtube.com/watch?v=fv8lhPKimQU

[youtube] fv8lhPKimQU: Downloading video webpage
[youtube] fv8lhPKimQU: Downloading video info webpage
[youtube] fv8lhPKimQU: Extracting video information
[info] Writing video description to: D:\Downloaded Files\Go Go Gadget - Hip Hop | Paradox from Holland | Funkin' Stylez, Dusseldorf, Germany | YAK FILMS-fv8lhPKimQU.mp4.description

ERROR: Cannot write description file D:\Downloaded Files\Go Go Gadget - Hip Hop | Paradox from Holland | Funkin' Stylez, Dusseldorf, Germany | YAK FILMS-fv8lhPKimQU.mp4.description

[youtube] fv8lhPKimQU: Downloading video webpage
[youtube] fv8lhPKimQU: Downloading video info webpage
[youtube] fv8lhPKimQU: Extracting video information

ERROR: unable to open for writing: [Errno 2] No such file or directory: u"D#\Downloaded Files\Go Go Gadget - Hip Hop # Paradox from Holland # Funkin' Stylez, Dusseldorf, Germany # YAK FILMS-fv8lhPKimQU.mp4.part"

\ seems to be satisfactory.

I was not able to find samples of < and >.

@FiloSottile
Copy link
Collaborator

@FiloSottile FiloSottile commented Jun 30, 2012

You must use %(stitle)s (and not %(title)s) to insert the video title in the --output template. The "s" one is sanitized for filesystems.

-o, --output TEMPLATE    output filename template. Use %(stitle)s to get the
                         title, %(uploader)s for the uploader name,
                         %(autonumber)s to get an automatically incremented
                         number, %(ext)s for the filename extension,
                         %(upload_date)s for the upload date (YYYYMMDD), and
                         %% for a literal percent. Use - to output to
                         stdout.

Re-open the bug if that doesn't solve your problem.

@phihag Shouldn't we state that in a FAQ, underline it in the --help or better change the --output syntax in a more normal-user friendly?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.