mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.73k stars 956 forks source link

[Twitter] Provide 'extension' and 'duration' fields for directory format strings. #4223

Open KonoVitoDa opened 1 year ago

KonoVitoDa commented 1 year ago

I use "filter": "extension =='mp4' and duration == 0" as a filter in a exec postprocessor to convert Twitter GIFs to actual GIFs (not those MP4 videos), and it works nicely. And now I'd like to use the same filter to place these GIFs on a folder specifically for GIFs. I tried "extension == 'mp4' and duration == 0": ["Twitter", "GIFs"] and get this error: [twitter][error] DirectoryFormatError: Applying directory format string failed (NameError: name 'extension' is not defined)

Hrxn commented 1 year ago

Maybe because extension is only present for tweets that contain embedded media? Dunno, would be able to confirm with an example URL.

KonoVitoDa commented 1 year ago

https://twitter.com/freusan/status/1215114960835170305

extension and duration fields are only present in Keywords for filenames and --filter