mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 10:42:34 +01:00
[boosty] improve signedQuery & isMigrated handling (#2387)
This commit is contained in:
parent
cc38042500
commit
d14d04adbf
@ -81,9 +81,7 @@ class BoostyExtractor(Extractor):
|
|||||||
content.append(c[0])
|
content.append(c[0])
|
||||||
|
|
||||||
elif type == "image":
|
elif type == "image":
|
||||||
if post["signedQuery"]:
|
files.append(self._update_url(post, block))
|
||||||
block["url"] += post["signedQuery"]
|
|
||||||
files.append(block)
|
|
||||||
|
|
||||||
elif type == "ok_video":
|
elif type == "ok_video":
|
||||||
if not self.videos:
|
if not self.videos:
|
||||||
@ -116,9 +114,7 @@ class BoostyExtractor(Extractor):
|
|||||||
content.append(url)
|
content.append(url)
|
||||||
|
|
||||||
elif type == "audio_file":
|
elif type == "audio_file":
|
||||||
if post["signedQuery"]:
|
files.append(self._update_url(post, block))
|
||||||
block["url"] += post["signedQuery"]
|
|
||||||
files.append(block)
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
self.log.debug("%s: Unsupported data type '%s'",
|
self.log.debug("%s: Unsupported data type '%s'",
|
||||||
@ -129,6 +125,22 @@ class BoostyExtractor(Extractor):
|
|||||||
del post["data"]
|
del post["data"]
|
||||||
return files
|
return files
|
||||||
|
|
||||||
|
def _update_url(self, post, block):
|
||||||
|
url = block["url"]
|
||||||
|
sep = "&" if "?" in url else "?"
|
||||||
|
|
||||||
|
signed_query = post.get("signedQuery")
|
||||||
|
if signed_query:
|
||||||
|
url += sep + signed_query[1:]
|
||||||
|
sep = "&"
|
||||||
|
|
||||||
|
migrated = post.get("isMigrated")
|
||||||
|
if migrated is not None:
|
||||||
|
url += sep + "is_migrated=" + str(migrated).lower()
|
||||||
|
|
||||||
|
block["url"] = url
|
||||||
|
return block
|
||||||
|
|
||||||
|
|
||||||
class BoostyUserExtractor(BoostyExtractor):
|
class BoostyUserExtractor(BoostyExtractor):
|
||||||
"""Extractor for boosty.to user profiles"""
|
"""Extractor for boosty.to user profiles"""
|
||||||
|
Loading…
Reference in New Issue
Block a user