Comments (6)
I'm doing all this on Linux, and if I put a space either side of the colon, or any other regular character, including another colon, in the -o
I get a unicode full-width colon in the filename by the look of it - but not if it's flanked by %H
and co directly... 🤷
Seems like that might be a bug... 🫤
$ yt-dlp --print "%(upload_date>%Y-%m-%d)s [%(duration>%H:%M:%S)s] - filename %(filename)s" --playlist-reverse --embed-thumbnail --add-metadata -o "%(upload_date>%Y-%m-%d)s [%(duration>%H:%Hx:%M :%S: %S::)s]" https://youtube.com/playlist?list=PL0vfts4VzfNjQOM9VClyL5R0LeuTxlAR3
WARNING: [youtube:tab] Incomplete data received. Retrying (1/3)...
WARNING: [youtube:tab] Incomplete data received. Retrying (2/3)...
WARNING: [youtube:tab] Incomplete data received. Retrying (3/3)...
WARNING: [youtube:tab] Incomplete data received. Giving up after 3 retries
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "rIrNIzy6U_g")
2024-03-12 [00:08:28] - filename 2024-03-12 [00_00x:08 :28: 28::]
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "r5NQecwZs1A")
2023-08-26 [00:08:25] - filename 2023-08-26 [00_00x:08 :25: 25::]
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "lkIFF4maKMU")
^C
ERROR: Interrupted by user
from yt-dlp.
Which for Linux isn't strictly necessary.
see #9591 for that
from yt-dlp.
duration
is a numeric value (seconds) that can be interpreted by Python as a represenation of time and therefore formatted with a string template. duration_string
has already been formatted with a string template. If duration_string
is present in the metadata, then duration
will be too, so why not just use duration
?
from yt-dlp.
Okay, so I've just gone through what I thought I had already done earlier and see that applying >%H:%M:%S
to duration_string
is indeed wrong and only works as I need for duration
My confusion was that while duration_string
contains colons, I need it zero padded, which I presume is not an option, and certainly not possible by applying a format.
Using %(duration>%H:%M:%S)s
is giving the desired zero padded output.
Although, while investigating with --print
it all looks fine, but as soon as I use -o
for constructing the filename, and use --print
to show me the result, I get underscore _
instead of a colon :
in the filename - for the same formatting. 🫤
Here's a stripped down version of my yt-dlp
options that highlights what I mean.
Is this expected behaviour? Or am I going crazy! 😄
$ yt-dlp --print "%(upload_date>%Y-%m-%d)s [%(duration>%H:%M:%S)s] - filename %(filename)s" -o "%(upload_date>%Y-%m-%d)s [%(duration>%H:%M:%S)s]" https://youtube.com/playlist?list=PL0vfts4VzfNjQOM9VClyL5R0LeuTxlAR3
WARNING: [youtube:tab] Incomplete data received. Retrying (1/3)...
WARNING: [youtube:tab] Incomplete data received. Retrying (2/3)...
WARNING: [youtube:tab] Incomplete data received. Retrying (3/3)...
WARNING: [youtube:tab] Incomplete data received. Giving up after 3 retries
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "rIrNIzy6U_g")
2024-03-12 [00:08:28] - filename 2024-03-12 [00_08_28]
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "r5NQecwZs1A")
2023-08-26 [00:08:25] - filename 2023-08-26 [00_08_25]
WARNING: [youtube] Skipping player responses from android clients (got player responses for video "aQvGIIdgFDM" instead of "lkIFF4maKMU")
^C
ERROR: Interrupted by user
from yt-dlp.
On Windows, filenames cannot contain :
, so yt-dlp sanitizes the filename by converting :
to _
. You could use a unicode full-width colon, e.g. "%(duration>%H:%M:%S)s"
from yt-dlp.
Additionally, as a workaround to get the desired format, I am using the following -o
template to get a normal colon in the filename. Please don't break that, that's exactly what I need/want... 😄 lol
"[%(duration>%H)s:%(duration>%M)s:%(duration>%S)s]"
So it seems like the issue is isolated to whatever is used to parse %()
sections.
Any presence of a colon elsewhere, for me, like the "%(title)", does seem to get converted to a unicode full-width colon. Which for Linux isn't strictly necessary.
from yt-dlp.
Related Issues (20)
- [youtube] Unable to download ongoing livestream clips HOT 1
- Download videos in multiple streams HOT 2
- Afreecatv.com catchstory
- [ARDMediathek] Video is downloaded with different audio language as played in the browser HOT 7
- ON:ORF results in FFmpegPostProcessorError HOT 6
- wrong value of aspect_ratio parameter used for format selection HOT 1
- Crunchyroll extractor tries to download jp audio when passing en language format HOT 2
- [propose Update pakage] Fedora and Epel HOT 11
- How can I save as the subtitle into a variable rather than a local file? HOT 1
- [Stripchat] Unable to find configuration for stream HOT 1
- Error: "Invalid data found when processing input" on Bilibili after postprocessing when --embed-subs is used HOT 3
- sap.com
- JioCinema sports support (non drm)
- New feature: VTT subtitles to include source URI HOT 3
- Vimeo password-protected video results in Unable to download JSON metadata: HTTP Error 400 (apparently max_redirects_exceeded) HOT 2
- [youtube] Sign in to confirm you’re not a bot. This helps protect our community HOT 8
- [Instagram] Reel Content with don't need login, Requerid login
- Output issue: "s was unexpected at this time." HOT 8
- [aparat] Add playlist support for https://www.aparat.com
- Request for Threads support 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.