mikf / gallery-dl

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

[QUESTION] kemono filename format #3239

Open afterdelight opened 1 year ago

afterdelight commented 1 year ago

How to convert {published} value in filename to date format like {date:%Y%m%d} i tried {published:%Y%m%d} and it gave FilenameFormatError: Applying filename format string failed (ValueError: Invalid format specifier)

AlttiRi commented 1 year ago

{published!d:%Y.%m.%d} also does not work.

!d

afterdelight commented 1 year ago

!T doesnt work either

mikf commented 1 year ago

You need to use :D<format> to parse published, and then you can format it: {published:D%a, %d %b %Y %H:%M:%S %Z/%Y.%m.%d}

date is the already parsed version of published, by the way. There is no real reason the parse it a second time.

{published!d:%Y.%m.%d} also does not work.

!d converts a timestamp to date. published is a string.

!T doesnt work either

!T converts a date to timestamp. published is a string.

afterdelight commented 1 year ago

what if user want to choose added instead of published? is there no simple command? will gumroad automatically use added instead of published? but added is from when its added on kemono not when post is created on gumroad page

mikf commented 1 year ago

is there no simple command?

copy-paste and replacing "published" with "added" is not simple enough?

will gumroad automatically use added instead of published?

Yes, it will, as can be seen in https://github.com/mikf/gallery-dl/commit/6e3658ef52bdbc43cba55ecda6f13c0702d608e3

but added is from when its added on kemono not when post is created on gumroad page

gumroad posts on kemono have no other metadata that could be used as date.

afterdelight commented 1 year ago

what about last-modified header from this issue? https://github.com/mikf/gallery-dl/issues/2007