mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-25 04:02:32 +01:00
[patreon] support '/c/' before creator name in URLs (#6348)
and avoid '/CREATOR/posts' redirects
This commit is contained in:
parent
00436d6027
commit
eacd4479a2
@ -311,7 +311,7 @@ class PatreonCreatorExtractor(PatreonExtractor):
|
||||
subcategory = "creator"
|
||||
pattern = (r"(?:https?://)?(?:www\.)?patreon\.com"
|
||||
r"/(?!(?:home|join|posts|login|signup)(?:$|[/?#]))"
|
||||
r"([^/?#]+)(?:/posts)?/?(?:\?([^#]+))?")
|
||||
r"(?:c/)?([^/?#]+)(?:/posts)?/?(?:\?([^#]+))?")
|
||||
example = "https://www.patreon.com/USER"
|
||||
|
||||
def posts(self):
|
||||
@ -341,9 +341,9 @@ class PatreonCreatorExtractor(PatreonExtractor):
|
||||
|
||||
user_id = query.get("u")
|
||||
if user_id:
|
||||
url = "{}/user/posts?u={}".format(self.root, user_id)
|
||||
url = "{}/user?u={}".format(self.root, user_id)
|
||||
else:
|
||||
url = "{}/{}/posts".format(self.root, creator)
|
||||
url = "{}/{}".format(self.root, creator)
|
||||
page = self.request(url, notfound="creator").text
|
||||
|
||||
try:
|
||||
|
@ -43,6 +43,11 @@ __tests__ = (
|
||||
"#exception": exception.NotFoundError,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.patreon.com/c/koveliana",
|
||||
"#class" : patreon.PatreonCreatorExtractor,
|
||||
},
|
||||
|
||||
{
|
||||
"#url" : "https://www.patreon.com/user?u=2931440",
|
||||
"#class" : patreon.PatreonCreatorExtractor,
|
||||
|
Loading…
Reference in New Issue
Block a user