Comments (6)
Proof of concept: pukkandan/empty@4469558
Eg:
$youtube-dlc https://www.youtube.com/watch?v=N5di3IroHnY -o "duration=%(duration>%H-%M-%S)t, uploaded=%(upload_date>%Y day%j)t" --get-filename
duration=00-13-35, uploaded=2020 day309
from yt-dlp.
The patch given is a temporary measure at best. What if someone else wants this functionality for release_date
instead? Adding all those extra fields only makes the code bloated and hard to maintain in future. I will see if it is possible to create a general solution for this using the output template itself. Maybe something like -o %(upload_date|yy-mm-dd)t
from yt-dlp.
Since I got tagged I figured I would post the pull request I originally made for this feature that was closed for the exact reasons above, it's not a great solution. This properly implemented would be a good thing to get into upstream as well (I'm not sure how diverged yt-dlp is at this point).
Note dsttfw's feedback:
The general idea is to allow something like
%(field[:<field_specific_formatter>])<standard_formatter>
.
from yt-dlp.
%(field[:<field_specific_formatter>])<standard_formatter>
Let me see if it is possible to make the date formatting work with the standard formatter
from yt-dlp.
Now it should be possible to do formats like %(upload_date>%d).1d
, although I don't understand why anyone would want to do that, considering how flexible strftime
already is
I also changed it to use just %()s
rather than %()t
from yt-dlp.
Output templates are complicated and I would appreciate if someone could review the code. I'll make a PR so that it's easier to review
from yt-dlp.
Related Issues (20)
- [chzzkLive] Live stream download aborted due to EOF under certain conditions
- [YouTube] Getting playlists/library no longer works HOT 1
- Dropbox video download failure HOT 5
- Error on youtube downloading video HOT 5
- Cookie question HOT 3
- ERROR: [youtube]: Get the best YouTube experience. Sign in to save videos, subscribe, and more HOT 2
- Varying performance based on python version HOT 1
- [Broken] Pornhub download ouput title not including chinese
- UNEXPECTED_EOF_WHILE_READING SSLError BBC.co.uk HOT 4
- [Youtube] KeyError: 'data' HOT 1
- REDACTED--RESOLVED HOT 2
- Fresh cookies (not necessarily logged in) are needed HOT 1
- Vimeo no longer can find “source” format HOT 1
- SHAHID unsuported url HOT 2
- [Instagram] ERROR: C0AsYItMrr7: An extractor error has occurred. (caused by KeyError('config')); HOT 1
- Is there any way to download a thumbnail for special size ? HOT 2
- how to download a video that is georestricted in my country but not in another country? HOT 5
- [Piapro] Unable to extract view count and content ID HOT 1
- How do I download links from batch link.txt but only want the link on line 1? HOT 4
- Freesound - "Unable to extract song url" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yt-dlp.