1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

[patreon] use file extensions from original filenames (#268)

This commit is contained in:
Mike Fährmann 2019-05-20 15:46:59 +02:00
parent efa805c5d7
commit bb32a2d490
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -43,24 +43,23 @@ class PatreonExtractor(Extractor):
if postfile:
post["num"] += 1
url = postfile["url"]
yield Message.Url, url, text.nameext_from_url(url, post)
text.nameext_from_url(postfile["name"], post)
yield Message.Url, postfile["url"], post
for attachment in post["attachments"]:
post["num"] += 1
url = attachment["url"]
yield Message.Url, url, text.nameext_from_url(url, post)
text.nameext_from_url(attachment["name"], post)
yield Message.Url, attachment["url"], post
def posts(self):
"""Return all relevant post objects"""
def _pagination(self, url):
headers = {"Referer": self.root}
params = {}
empty = []
while url:
posts = self.request(url, headers=headers, params=params).json()
posts = self.request(url, headers=headers).json()
if "included" not in posts:
return