gallery-dl
gallery-dl copied to clipboard
[Plurk] Unable to preserve the image order within a Plurk
A single Plurk often contains more than one image attachment. What I'm trying to achieve is to have files downloaded directly from Plurk to have their plurk author and post IDs and the attachment index in their filenames.
Currently with the default configuration DirectLink's naming scheme is used resulting in output filenames like images.plurk.com__1aIeI7pSWZQg9him1t9du5.png
which are completely unusable.
After playing around with the configs I was able to almost get it right, that is, to include the author UID and the post UID, but not the index of an attachment within a single Plurk. I had to resort to the original URL-derived filename for name uniqueness, but that offers no guarantees on the correct order. Is there a way to achieve the proper numbering?
Relevant parts of my config:
"extractor": {
"plurk": {
"parent-metadata": true
},
"directlink": {
"parent-metadata": {"'plurk_id' in locals()": true},
"filename": {"'plurk_id' in locals()": "plurk_{owner_id}_{plurk_id}_{filename}.{extension}"}
},
}
There are several other issues relevant to Plurk file naming (most notably #4361 and #5112), however those are about issues arising at an earlier stage, when linking child/parent metadata, which I think I've solved with my current configuration.