From 90e50db2e3c38f523bb5195d295290b06e5cedb0 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Sun, 3 May 2020 00:06:40 -0400 Subject: New upstream version 1.13.6 --- gallery_dl/cloudflare.py | 24 ++++++++----- gallery_dl/downloader/http.py | 4 +++ gallery_dl/extractor/__init__.py | 1 + gallery_dl/extractor/artstation.py | 5 +-- gallery_dl/extractor/blogger.py | 8 ++--- gallery_dl/extractor/deviantart.py | 3 +- gallery_dl/extractor/newgrounds.py | 10 +++--- gallery_dl/extractor/patreon.py | 46 +++++++++++++++++------- gallery_dl/extractor/realbooru.py | 2 +- gallery_dl/extractor/speakerdeck.py | 70 +++++++++++++++++++++++++++++++++++++ gallery_dl/extractor/twitter.py | 10 +++++- gallery_dl/extractor/vsco.py | 15 +++----- gallery_dl/extractor/weibo.py | 4 ++- gallery_dl/version.py | 2 +- 14 files changed, 156 insertions(+), 48 deletions(-) create mode 100644 gallery_dl/extractor/speakerdeck.py (limited to 'gallery_dl') diff --git a/gallery_dl/cloudflare.py b/gallery_dl/cloudflare.py index e3ebd1a..43ccdeb 100644 --- a/gallery_dl/cloudflare.py +++ b/gallery_dl/cloudflare.py @@ -144,11 +144,15 @@ def evaluate_expression(expr, page, netloc, *, # evaluate them, # and accumulate their values in 'result' result = "" - for subexpr in split_re.findall(expr) or (expr,): - result += str(sum( - VALUES[part] - for part in subexpr.split("[]") - )) + for subexpr in expr.strip("+()").split(")+("): + value = 0 + for part in subexpr.split("+"): + if "-" in part: + p1, _, p2 = part.partition("-") + value += VALUES[p1] - VALUES[p2] + else: + value += VALUES[part] + result += str(value) return int(result) @@ -158,12 +162,14 @@ OPERATORS = { "*": operator.mul, } + VALUES = { "": 0, - "+": 0, - "!+": 1, - "!!": 1, - "+!!": 1, + "!": 1, + "[]": 0, + "!![]": 1, + "(!![]": 1, + "(!![])": 1, } diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py index 64a2978..021dc16 100644 --- a/gallery_dl/downloader/http.py +++ b/gallery_dl/downloader/http.py @@ -243,6 +243,10 @@ MIMETYPE_MAP = { "image/webp": "webp", "image/svg+xml": "svg", + "image/vnd.adobe.photoshop": "psd", + "image/x-photoshop": "psd", + "application/x-photoshop": "psd", + "video/webm": "webm", "video/ogg": "ogg", "video/mp4": "mp4", diff --git a/gallery_dl/extractor/__init__.py b/gallery_dl/extractor/__init__.py index 2c87eb3..85fbddb 100644 --- a/gallery_dl/extractor/__init__.py +++ b/gallery_dl/extractor/__init__.py @@ -105,6 +105,7 @@ modules = [ "slickpic", "slideshare", "smugmug", + "speakerdeck", "tsumino", "tumblr", "twitter", diff --git a/gallery_dl/extractor/artstation.py b/gallery_dl/extractor/artstation.py index ceda29c..c504dba 100644 --- a/gallery_dl/extractor/artstation.py +++ b/gallery_dl/extractor/artstation.py @@ -39,8 +39,9 @@ class ArtstationExtractor(Extractor): if adict["has_embedded_player"] and self.external: player = adict["player_embedded"] - url = text.extract(player, 'src="', '"')[0] - if not url.startswith(self.root): + url = text.extract(player, 'src="', '"')[0] or \ + text.extract(player, "src='", "'")[0] + if url and not url.startswith(self.root): asset["extension"] = None yield Message.Url, "ytdl:" + url, asset continue diff --git a/gallery_dl/extractor/blogger.py b/gallery_dl/extractor/blogger.py index 2657b5d..331cfc2 100644 --- a/gallery_dl/extractor/blogger.py +++ b/gallery_dl/extractor/blogger.py @@ -109,7 +109,7 @@ class BloggerPostExtractor(BloggerExtractor): "posts" : int, "published" : "2010-11-21T10:19:42-08:00", "updated" : str, - "url" : "http://www.julianbunker.com/", + "url" : "http://julianbphotography.blogspot.com/", }, "post": { "author" : "Julian Bunker", @@ -128,9 +128,7 @@ class BloggerPostExtractor(BloggerExtractor): "url": str, }, }), - ("blogger:http://www.julianbunker.com/2010/12/moon-rise.html", { - "url": "9928429fb62f712eb4de80f53625eccecc614aae", - }), + ("blogger:http://www.julianbunker.com/2010/12/moon-rise.html"), # video (#587) (("http://cfnmscenesinmovies.blogspot.com/2011/11/" "cfnm-scene-jenna-fischer-in-office.html"), { @@ -156,7 +154,7 @@ class BloggerBlogExtractor(BloggerExtractor): "count": 25, "pattern": r"https://\d\.bp\.blogspot\.com/.*/s0/[^.]+\.jpg", }), - ("blogger:http://www.julianbunker.com/", { + ("blogger:https://www.kefblog.com.ng/", { "range": "1-25", "count": 25, }), diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index ca722b8..2631052 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -1006,7 +1006,8 @@ class DeviantartOAuthAPI(): msg = "API responded with {} {}".format( status, response.reason) if status == 429: - self.delay += 1 + if self.delay < 9: + self.delay += 1 self.log.warning("%s. Using %ds delay.", msg, 2 ** self.delay) else: self.log.error(msg) diff --git a/gallery_dl/extractor/newgrounds.py b/gallery_dl/extractor/newgrounds.py index bb87a69..17fe935 100644 --- a/gallery_dl/extractor/newgrounds.py +++ b/gallery_dl/extractor/newgrounds.py @@ -288,7 +288,7 @@ class NewgroundsMediaExtractor(NewgroundsExtractor): class NewgroundsArtExtractor(NewgroundsExtractor): """Extractor for all images of a newgrounds user""" subcategory = "art" - pattern = r"(?:https?://)?([^.]+)\.newgrounds\.com/art/?$" + pattern = r"(?:https?://)?([\w-]+)\.newgrounds\.com/art/?$" test = ("https://tomfulp.newgrounds.com/art", { "pattern": NewgroundsImageExtractor.pattern, "count": ">= 3", @@ -298,7 +298,7 @@ class NewgroundsArtExtractor(NewgroundsExtractor): class NewgroundsAudioExtractor(NewgroundsExtractor): """Extractor for all audio submissions of a newgrounds user""" subcategory = "audio" - pattern = r"(?:https?://)?([^.]+)\.newgrounds\.com/audio/?$" + pattern = r"(?:https?://)?([\w-]+)\.newgrounds\.com/audio/?$" test = ("https://tomfulp.newgrounds.com/audio", { "pattern": r"https://audio.ngfiles.com/\d+/\d+_.+\.mp3", "count": ">= 4", @@ -308,7 +308,7 @@ class NewgroundsAudioExtractor(NewgroundsExtractor): class NewgroundsMoviesExtractor(NewgroundsExtractor): """Extractor for all movies of a newgrounds user""" subcategory = "movies" - pattern = r"(?:https?://)?([^.]+)\.newgrounds\.com/movies/?$" + pattern = r"(?:https?://)?([\w-]+)\.newgrounds\.com/movies/?$" test = ("https://tomfulp.newgrounds.com/movies", { "pattern": r"https://uploads.ungrounded.net(/alternate)?/\d+/\d+_.+", "range": "1-10", @@ -319,7 +319,7 @@ class NewgroundsMoviesExtractor(NewgroundsExtractor): class NewgroundsUserExtractor(NewgroundsExtractor): """Extractor for a newgrounds user profile""" subcategory = "user" - pattern = r"(?:https?://)?([^.]+)\.newgrounds\.com/?$" + pattern = r"(?:https?://)?([\w-]+)\.newgrounds\.com/?$" test = ( ("https://tomfulp.newgrounds.com", { "pattern": "https://tomfulp.newgrounds.com/art$", @@ -414,6 +414,6 @@ class NewgroundsFollowingExtractor(NewgroundsFavoriteExtractor): @staticmethod def _extract_favorites(page): return [ - "https://" + user.rpartition('"')[2] + "https://" + user.rpartition('"')[2].lstrip("/:") for user in text.extract_iter(page, 'class="item-user', '">