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

Failing to write the file after the download completed #541

Closed
niyazpk opened this issue Nov 23, 2012 · 6 comments
Closed

Failing to write the file after the download completed #541

niyazpk opened this issue Nov 23, 2012 · 6 comments
Labels
bug

Comments

@niyazpk
Copy link

@niyazpk niyazpk commented Nov 23, 2012

Command:

youtube-dl -cil http://www.youtube.com/watch?v=f7AU2Ozu8eo&feature=relmfu

Error:

[youtube] Setting language
[youtube] f7AU2Ozu8eo: Downloading video webpage
[youtube] f7AU2Ozu8eo: Downloading video info webpage
[youtube] f7AU2Ozu8eo: Extracting video information
[download] Destination: Fluent 2012: Paul Irish, "Javascript Development Workflow of 2013"-7AU2Ozu8eo.mp4
[download] 100.0% of 262.58M at  398.71k/s ETA 00:00
ERROR: unable to rename file
'feature' is not recognized as an internal or external command,
operable program or batch file.

This BTW has created an empty file named Fluent 2012 in the folder.

Also if the download is interrupted for some reason, it is unable to resume the download later. (Fails with the same error)

(Windows)

@niyazpk
Copy link
Author

@niyazpk niyazpk commented Nov 23, 2012

I assume it has something to do with the : in the title...?

@Plaque-fcc
Copy link

@Plaque-fcc Plaque-fcc commented Nov 24, 2012

No matter, weird but still funny error this is.

You should put the URI in single quotes since it contains the
ampersand sign.

@Plaque-fcc
Copy link

@Plaque-fcc Plaque-fcc commented Nov 24, 2012

And yes, you should customize the title, since there is yet no general
«all safe» nor «win32/NTFS»|«FAT32»|whatever naming policy control
options.

@niyazpk
Copy link
Author

@niyazpk niyazpk commented Nov 25, 2012

Ok... The way I understand it, there is no way around the & being there in the URL. I will have to quote the whole URL. Is that correct? If that is the case there is nothing much to be done for that case.

But the first problem remains I guess. Can we try something like warning the user before starting the download in cases like this? It'll be way better than waiting for the download to finish and then realize that the file cannot be written.

@Tailszefox
Copy link
Contributor

@Tailszefox Tailszefox commented Nov 25, 2012

You can just remove the ampersand, since it's not useful to get to the video. Quoting the whole URL will also work, but you'll have to do one or the other, as this has to do with the way the shell interprets the command before sending it to youtube-dl.

As for the issue with the semicolon, as @Plaque-fcc said, you should customize the title yourself. Using -l will give you the literal title, the whole point of it being to get the title as is, even if it creates an invalid filename. If you want to get a more "safe" filename, you can use, for example, -o '%(stitle)s.%(ext)s'. In your example, it gives us a file named Fluent 2012 - Paul Irish, 'Javascript Development Workflow of 2013'.mp4 which shouldn't pose any issue.

You can also use -t instead of -l: in this case, youtube-dl will use the title of the video as the filename but will filter it before to remove invalid characters. It's an easier way if you don't want to have to customize the title.

The -o and -t options aren't failproof since there's a lot of filesystems with a lot of differing restrictions regarding characters than can be used or not, but it should work most of the time, while the -l will always give you trouble for videos like this given that its intended purpose is to give you a literal title, without any filtering or checking.

@FiloSottile
Copy link
Collaborator

@FiloSottile FiloSottile commented Nov 25, 2012

OK, I think this boils down to the usual "quote the url, always" (as everything you type on the shell) and use -t, NOT -l. Do this and every video will download fine on every filesystem (almost sure, and if it doesn't, then it's a bug).

That being said, @phihag please let's alias -l to -t. There's no reason one should use -l anymore, if not by mistake.

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
4 participants
You can’t perform that action at this time.