Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NSFW] Write ImageFap Gallery Description as Text File #3905

Closed
cheese529 opened this issue Apr 12, 2023 · 7 comments
Closed

[NSFW] Write ImageFap Gallery Description as Text File #3905

cheese529 opened this issue Apr 12, 2023 · 7 comments

Comments

@cheese529
Copy link

How would I be able to get gallery-dl to write the description of an imagefap gallery as a text file, just like yt-dlp is able to do

@mikf
Copy link
Owner

mikf commented Apr 15, 2023

Use a metadata post processor with "event": "init" and appropriate "filename", similar to

"postprocessors": [
{
"name": "metadata",
"event": "post",
"filename": "{id} {title}.txt",
"#": "write text content and external URLs",
"mode": "custom",
"format": "{content}\n{embed[url]:?/\n/}",
"#": "onlx write file if there is an external link present",
"filter": "embed.get('url') or re.search(r'(?i)(gigafile|xgf|1drv|mediafire|mega|google|drive)', content)"
}

@cheese529
Copy link
Author

cheese529 commented Apr 15, 2023

Please forgive me as I am super code illiterate, so in ELI5 terms I would I just copy and paste the following stuff you put into my config below the imagefap entry? I would just want the output to be a text file with the same name as the gallery's name

@mikf
Copy link
Owner

mikf commented Apr 15, 2023

Theoretically, it would look like this

{
    "extractor": {
        "imagefap": {
            "postprocessors": [
                {
                    "name": "metadata",
                    "event": "init",
                    "filename": "{title}.txt",
                    "format": "{description}"
                }
            ]
        }
    }
}

but, as it turns out, gallery-dl does not provide a {description} for imagefap galleries.

Do these galleries even have something that could be used as description? I've looked at a few and none of them had more than a title and tags.

@cheese529
Copy link
Author

cheese529 commented Apr 15, 2023

[NSFW] here is a link that has a description for the gallery and the images also have captions too which I hope can also be added into the file. https://www.imagefap.com/gallery/3392277 and here are two more example galleries that have a description. https://www.imagefap.com/gallery/7871364 https://www.imagefap.com/gallery/6706356

Heads up all the links are indeed very NSFW so please open with caution.

@mikf
Copy link
Owner

mikf commented Apr 17, 2023

There is now a description metadata field for imagefap galleries (02ec5bb).
(and a categories one with 2dfd4a3)

You might want to add "filter": "description" to the post processor from #3905 (comment) to not write empty files for galleries without description.

@mikf mikf closed this as completed Apr 17, 2023
@cheese529
Copy link
Author

thank you so much! here is my current config https://pastebin.pl/view/62c7ed3b
could you please tell me exactly what i would actually write in the imagefap part in order to accomplish all of this. also would this fix also download or embed image captions too maybe in metadata? or just gallery description

@mikf
Copy link
Owner

mikf commented Apr 26, 2023

could you please tell me exactly what i would actually write in the imagefap part in order to accomplish all of this.

The snippet I posted in #3905 (comment)

also would this fix also download or embed image captions too maybe in metadata? or just gallery description

Just gallery descriptions. Image captions would require an extra HTTP request for each single image, and that's not really feasible with imagefap's "rate-limit".

The current strategy is to get images in bulks of 24 and those do not contain captions, I don 't think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants