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

adding extra characters to the original file name #9625

Closed
adeebothman opened this issue May 29, 2016 · 3 comments
Closed

adding extra characters to the original file name #9625

adeebothman opened this issue May 29, 2016 · 3 comments

Comments

@adeebothman
Copy link

@adeebothman adeebothman commented May 29, 2016

after using youtube-dl -t {link} to download playlist from youtube
it download file very well, but it adds extra characters to the file name like this one
ex: this command
[ youtube-dl -t https://www.youtube.com/playlist?list=PLAwxTw4SYaPnMwH5-FNkErnnq_aSy706S ]
should download the first video with this title "Welcome to Developing Android Apps"
instead it downloaded with this one " Welcome to Developing Android Apps-2Wo_QfQZ0lE.mp4"

finally thank you for such a great tool it changed my life 👍
i hope we can figure the solution soon

@dstftw
Copy link
Collaborator

@dstftw dstftw commented May 29, 2016

It's intentional. Use -o "%(title)s.%(ext)s".

@dstftw dstftw closed this May 29, 2016
@adeebothman
Copy link
Author

@adeebothman adeebothman commented May 29, 2016

can you explain it to me please
i understand that i should replace (ext).s with (mp4).s , but (title)s with
what ? what should write in stead of title ?

On Sun, May 29, 2016 at 5:00 AM, Sergey M. notifications@github.com wrote:

Closed #9625 #9625.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#9625 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/APCmBdQmJDY3CC7_QvpaxVK0L8EZKoIHks5qGPMlgaJpZM4IpMaY
.

@phihag
Copy link
Contributor

@phihag phihag commented May 29, 2016

The -o option specifies a template for the filename. It is not recommended to actually replace anything in there.

You're passing in the option -t, which is equivalent to -o "%(title)s-%(id)s.%(ext)s" (which is, coincidentally, also the default behavior). This makes the filename include the video ID, which is extremely useful if you want to find the original video URL in a pinch.

If you only want the title and extension (there are lots of other fields too), pass in -o "%(title)s.%(ext)s" instead of -t.

If that's the behavior you want all the time, consider creating a configuration file.

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