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

[DeviantArt] Favorites Filename Configurations #5742

Open
cheese529 opened this issue Jun 16, 2024 · 4 comments
Open

[DeviantArt] Favorites Filename Configurations #5742

cheese529 opened this issue Jun 16, 2024 · 4 comments

Comments

@cheese529
Copy link

cheese529 commented Jun 16, 2024

Here's my current config for downloading from DeviantArt. What do I need to change to make the favorited images have a different filename when downloaded, ideally would like to have the author of the image in the filename. So for example, when downloading from [almost NSFW] https://www.deviantart.com/sleepygimp, I need everything uploaded by the creator to follow "filename": "{title} [{date:%Y-%m-%d}] {index_base36}.{extension}", but everything inside the favorited folder should be "filename": "{title} [{date:%Y-%m-%d}] {index_base36} {author}.{extension}", Tried to use chat gpt to figure this out but had no luck.
Also if there is anything else I should be changing inside my config or adding please feel free to let me know :)

"deviantart":
{
    "filename": "{title} [{date:%Y-%m-%d}] {index_base36}.{extension}",
    "client-id": "",
    "client-secret": "",
    "refresh-token": "",
    "auto-watch": true,
    "auto-unwatch": true,
    "comments": false,
    "extra": true,
    "flat": false,
    "folders":false,
    "group": true,
    "include": "all",
    "parent-directory": true,
    "journals": "html",
    "jwt": false,
    "mature": true,
    "metadata": true,
    "postprocessors": [
        {
            "name": "metadata",
            "mode": "custom",
            "mtime": true,
            "filename": "{title} [{date:%Y-%m-%d}] {index_base36}.html",
            "filter": "description",
            "directory" : "HTML Descriptions",
            "extension": "html",
            "content-format": "<!DOCTYPE html><html><meta charset='utf-8'>Username: <a href='https://www.deviantart.com/{username}'>{username}</a> \n<br><br>\n URL: <a href='{url}'>{url[8:]}</a> \n<br><br>\n Title: <b>{title}</b> \n<br><br>\n Description: {description} \n<br><br>\n <img src={preview['src']}></html>"
        },
        {
            "name": "metadata",
            "mode": "custom",
            "mtime": true,
            "filename": "{title} [{date:%Y-%m-%d}] {index_base36}.txt",
            "filter": "description",
            "directory"       : "Descriptions",
            "content-format"  : "{description}\n",
            "extension-format": "descr.txt"
        }
    ],
    "original": true,
    "quality": 100,
    "pagination": "api",
    "public": false,
    "wait-min": 0
},
@mikf
Copy link
Owner

mikf commented Jun 16, 2024

You can specify options per subcategory - favorite in this case
nvm it's collection

"deviantart":
{
    "filename": "{title} [{date:%Y-%m-%d}] {index_base36}.{extension}",
    "collection": {
        "filename": "{title} [{date:%Y-%m-%d}] {index_base36} {author}.{extension}"
    }
}

"content-format": "<!DOCTYPE html> ...

You could place this rather long format string in an external file.
https://gdl-org.github.io/docs/formatting.html#special-type-format-strings

"content-format": "\fT C:/path/to/template.html"

Tried to use chat gpt to figure this out but had no luck.

ChatGPT has absolutely no idea how to use and configure gallery-dl.
At least it didn't a few months ago when I tested it.

@cheese529
Copy link
Author

cheese529 commented Jun 19, 2024

  • favorite in this case

I tried exactly what you wrote but unfortunately it doesn't seem to be working. Everything inside the favorites folder still downloads with the OG filename I have.

        "deviantart":
        {
			"filename": "{title} [{date:%Y-%m-%d}] {index_base36}.{extension}",
			"favorite": {
				"filename": "{title} [{date:%Y-%m-%d}] {author[username]} - {index_base36}.{extension}"
			},
            "client-id": "31030",
            "client-secret": "b83117cc9f8375d4a40a515354fcb587",
			"refresh-token": "e8046f485ef1f05f93511beb680a37f27f8b6a16",
            "auto-watch": true,
            "auto-unwatch": true,
            "comments": false,
            "extra": true,
            "flat": false,
            "folders":false,
            "group": true,
            "include": "all",
			"parent-directory": true,
            "journals": "html",
			"jwt": false,
            "mature": true,
            "metadata": true,```

@mikf
Copy link
Owner

mikf commented Jun 19, 2024

My bad. It needs to be collection, or you set flat for favorite to true.

@cheese529
Copy link
Author

cheese529 commented Jun 19, 2024

You could place this rather long format string in an external file.

Thank you so much for this. Is there anything else I could change for the format string itself in order to make the post processed HTML file look as much like DeviantArt as possible, 1:1 in terms of font and green background etc, Kinda like how you made the journal html files resemble DA very nicely.

It needs to be collection

This ended up fixing it for me thanks.

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

No branches or pull requests

2 participants