Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Is there a simple way to format upload_date? #12048
Comments
|
Why not simply write a Python script to do the formatting for you? If you wanna to modify youtube-dl, I found that |
|
thanks cqnkxy - this is exactly what i was looking for - i ended up using a little bash script to do it (im a noob to bash)...but your excellent youtube-dl specific input will give me some new areas to explore - thanks for your help! in case any other noobs want the steps i used to modify the date: #steps taken inside my bash script: #once youtube-dl was finished, used this little fix_dates function to loop through the downloaded files and manually add the "-" to create yyyy-mm-dd format fix_dates() { for file in * #call function |
Please follow the guide below
xinto all the boxes [ ] relevant to your issue (like that [x])Make sure you are using the latest version: run
youtube-dl --versionand ensure your version is 2017.02.10. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.Before submitting an issue make sure you have:
What is the purpose of your issue?
The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue
Hello! Youtube-DL is a fantastic tool - thanks to you all for all of your hard work on this project! My question is about the upload_date filename functionality. Lets say I have a youtube-dl command like this:
youtube-dl -i -o "/videos/%(upload_date)s_%(title)s.%(ext)s" https://www.youtube.com/playlist?list=AnyValidPlaylistCodeHere
It works perfectly, but instead of the first portion of the downloaded file being something like "20170209_", I would like it to be "2017-02-09_". I thought this would be a 5-minute thing, but after reading/searching, I can't see a simple way to do it. I noted someone had requested to convert the %(NAME)s renaming functionality to python string.format {}, but it did not look like his code commits were accepted (they broke other functionality). I also noticed this "Utils.py" file in the main Git archive, but was not sure how to utilize it.
I am running Linux Mint 17.2 with xfce desktop. Would I need to use some sort of external post-processing to reformat the date in my downloaded file names? I was 99% sure there would be some simple way to accomplish it in youtube-dl, but i'm afraid i'm stumped. I would love if someone could give me the "most common / simplest" approach to such a renaming task in linux...the solution doesn't have to necessarily involve using youtube-dl....it's awesome enough as it is! : )
Thanks for any help you can provide...