[pinterest] fix section URLs for boards with /?# in name (#5104)

pull/5186/head
Mike Fährmann 8 months ago
parent de752eb7b1
commit d7823b9f81
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -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…
Cancel
Save