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

[Bug] Using 'archive' with 'parent-metadata' options breaks Imgur Album downloads #1651

Closed
harvii opened this issue Jun 24, 2021 · 1 comment

Comments

@harvii
Copy link

harvii commented Jun 24, 2021

When downloading a reddit post linking to an imgur album with both 'archive' and 'parent-metadata' options enabled, only the first image in the album is saved and the rest are skipped.

I'm guessing this is because the imgur 'id' is overwritten by the reddit 'id':

archive_fmt = "{album[id]}_{id}"

Would using archive_fmt = "{album[id]}_{filename}" be a better option?

@mikf
Copy link
Owner

mikf commented Jul 15, 2021

I'm guessing this is because the imgur 'id' is overwritten by the reddit 'id':

Yep, that's exactly it. Using {filename} should work since the metadata from Reddit doesn't have such a field in case it's an Imgur URL.

I've also extended the parent-metadata option a bit (e95f998) so you can tell it to not overwrite child metadata but to put the parent metadata entries into their own field. This also makes it possible to distinguish between child extractor and default usage with conditional directories and/or filenames:

{
    "extractor": {
        "reddit": {
            "parent-metadata": "parent",
            "parent-directory": true
        },
        "imgur": {
            "directory": {
                "'parent' in locals()": ["child extractor", "{parent[author]}"],
                "": ["default", "{album[id]}"]
            }
        }
    }
}

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