mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
[pinterest] fix section URLs for boards with /?# in name (#5104)
This commit is contained in:
parent
de752eb7b1
commit
d7823b9f81
@ -149,8 +149,7 @@ class PinterestBoardExtractor(PinterestExtractor):
|
||||
pins = self.api.board_pins(board["id"])
|
||||
|
||||
if board["section_count"] and self.config("sections", True):
|
||||
base = "{}/{}/{}/id:".format(
|
||||
self.root, board["owner"]["username"], board["name"])
|
||||
base = "{}{}id:".format(self.root, board["url"])
|
||||
data = {"_extractor": PinterestSectionExtractor}
|
||||
sections = [(base + section["id"], data)
|
||||
for section in self.api.board_sections(board["id"])]
|
||||
@ -220,7 +219,7 @@ class PinterestSectionExtractor(PinterestExtractor):
|
||||
"{board[name]}", "{section[title]}")
|
||||
archive_fmt = "{board[id]}_{id}"
|
||||
pattern = BASE_PATTERN + r"/(?!pin/)([^/?#]+)/([^/?#]+)/([^/?#]+)"
|
||||
example = "https://www.pinterest.com/USER/BOARD/SEcTION"
|
||||
example = "https://www.pinterest.com/USER/BOARD/SECTION"
|
||||
|
||||
def __init__(self, match):
|
||||
PinterestExtractor.__init__(self, match)
|
||||
|
@ -52,6 +52,15 @@ __tests__ = (
|
||||
"#count" : 4,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.pinterest.jp/gdldev/bname/",
|
||||
"#comment" : "board & section with /?# in name (#5104)",
|
||||
"#category": ("", "pinterest", "board"),
|
||||
"#class" : pinterest.PinterestBoardExtractor,
|
||||
"#options" : {"sections": True},
|
||||
"#urls" : "https://www.pinterest.jp/gdldev/bname/id:5345901183739414095",
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.pinterest.de/g1952849/secret/",
|
||||
"#comment" : "secret board (#1055)",
|
||||
|
Loading…
Reference in New Issue
Block a user