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

[pinterest] user subcategory getting treated as board subcategory #2452

Closed
github-account1111 opened this issue Mar 29, 2022 · 8 comments
Closed

Comments

@github-account1111
Copy link

github-account1111 commented Mar 29, 2022

I would like to download every pin created by https://www.pinterest.com/amazon (https://www.pinterest.com/amazon/_created/) to folder amazon-pinterest/, as well as https://www.pinterest.com/mybelonging/garage-goals/ to bookmarks/pinterest-mybelonging-garage-goals/.

Relevant config portion:

{
  "postprocessor": {
    "pinterest": {
      "directory": ["{owner[username]}-pinterest"],
      "board": {
        "directory": ["bookmarks", "pinterest-{board[owner][username]}-{board[name]}"]
      }
    }
  }
}

The problem:
--extractor-info on https://www.pinterest.com/amazon outputs

Category / Subcategory
  "pinterest" / "user"

... but --list-keywords outputs

subcategory
  board

So everything ends up going under bookmarks as if it was a board.

@Hrxn
Copy link
Contributor

Hrxn commented Mar 29, 2022

I would like to download every pin created by https://www.pinterest.com/amazon (https://www.pinterest.com/amazon/_created/) to folder amazon-pinterest/, as well as https://www.pinterest.com/mybelonging/garage-goals/ to bookmarks/pinterest-mybelonging-garage-goals/.

Relevant config portion:

{
  "postprocessor": {
    "pinterest": {
      "directory": ["{owner[username]}-pinterest"],
      "board": {
        "directory": ["bookmarks", "pinterest-{board[owner][username]}-{board[name]}"]
      }
    }
  }
}

That.. doesn't seem right. Why do you put extractor options inside of "postprocessor":?

Here's an example config, which is an absolute minimal config except for Pinterest. You could try this as a starting point:

{
    "extractor":
    {

         "pinterest":
        {
            "pin":
            {
                "directory": ["Pinterest", "Selected Pins"]
            },
            "board":
            {
                "directory": ["Pinterest", "Boards", "{board[owner][username]}", "{board[name]}"]
            },
            "pinit":
            {
                "directory": ["Pinterest", "Pin-its"]
            },
            "sections": true,
            "videos": true,

            "filename": "{category}_{id}.{extension}"
        }

    }
}

@github-account1111
Copy link
Author

github-account1111 commented Mar 29, 2022

I guess I was tired 😄 copied it wrong.
Here's the actual portion:

{
  "extractor": {
    "pinterest": {
      "directory": ["{owner[username]}-pinterest"],
      "board": {
        "directory": ["bookmarks", "pinterest-{board[owner][username]}-{board[name]}"]
      }
    }
  }
}

It's not necessary to specify all subcategories, is it?
I am only interested in a different folder structure for boards.
For _created stuff I want it to go using the general Pinterest directory structure.

@Hrxn
Copy link
Contributor

Hrxn commented Mar 29, 2022

We've all been there.. 😄

{
  "extractor": {
    "pinterest": {
      "directory": ["{owner[username]}-pinterest"],
      "board": {
        "directory": ["bookmarks", "pinterest-{board[owner][username]}-{board[name]}"]
      }
    }
  }
}

Yeah, I think this should work.. 😑

It's not necessary to specify all subcategories, is it?

Nope, only the ones you want to change.

@github-account1111
Copy link
Author

github-account1111 commented Mar 29, 2022

Got it!
So the problem then is, I get an error with https://www.pinterest.com/amazon/_created:

[pinterest][error] NotFoundError: Requested board could not be found

... even though it seems to be allowed

test = (
("https://www.pinterest.de/g1952849/", {
"pattern": PinterestBoardExtractor.pattern,
"count": ">= 2",
}),
("https://www.pinterest.de/g1952849/_saved/"),
)

So I used https://www.pinterest.com/amazon instead, but that gets treated as a board for some reason and follows the board directory structure.

Edit: no wait I think I'm still tired.
_saved is not the same as _created!
So I guess there is no way to save only the user's original content?
I specifically want only the user's uploads (whatever is under https://www.pinterest.com/amazon/_created).

@Hrxn
Copy link
Contributor

Hrxn commented Mar 29, 2022

Edit: no wait I think I'm still tired. _saved is not the same as _created!

Indeed.. for the "user" sub-extractor, the input URL has to match this regular expression:

pattern = BASE_PATTERN + r"/(?!pin/)([^/?#&]+)(?:/_saved)?/?$"

So I guess there is no way to save only the user's original content? I specifically want only the user's uploads (whatever is under https://www.pinterest.com/amazon/_created).

Not yet.. but I think this should be relatively straightforward to add form here on..

By the way, if you run gallery-dl with the --verbose option, you should see which extractor including which sub-extractor get actually used in one of the first lines, as far as I know..

@mikf
Copy link
Owner

mikf commented Mar 30, 2022

User URLs get processed by fetching all boards for that account and then downloading from those, which is why all downloaded files have

subcategory
  board

You can enable category-transfer or you do something like this to be able to differentiate between regular boards and boards from user profiles.

/_created/ URLs are not supported and get treated as if they where a board URL. Same with /boards/.

@github-account1111
Copy link
Author

Apologies for being so cryptic in what I'm trying to achieve.
This probably stems from my unfamiliarity with how Pinterest works.
Should've put a bit more thought before starting an issue.

My goal boils down to differentiating between the _created user board and all the other user boards.
I want to save

  • original content by several users into the respective users' folders
  • all of my boards into the respective boards' folders

Not sure what is meant by regular boards though.
Aren't all boards created by users?

@mikf
Copy link
Owner

mikf commented Apr 7, 2022

Commit 9c5d2d7 adds support for pins listed under _created with its own created subcategory, and 0b33435 adds support for multiple files per pin, which was needed for the pins under /amazon/_created (and it was part of an old open issue)

This probably stems from my unfamiliarity with how Pinterest works.

same

Not sure what is meant by regular boards though.

I meant using a board URL as direct input to gallery-dl ("regular" board), or when such a URL comes from a user URL like https://www.pinterest.com/amazon.

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

3 participants