From de83ae45766833738ab8286eab2403c3c312e8a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 5 Nov 2019 17:28:09 +0100 Subject: [PATCH] make 'method' argument of Extractor.request keyword-only --- gallery_dl/extractor/common.py | 2 +- gallery_dl/extractor/imgbb.py | 2 +- gallery_dl/extractor/plurk.py | 5 +++-- gallery_dl/oauth.py | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 20e3c7fd..97897246 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -68,7 +68,7 @@ class Extractor(): return config.interpolate( ("extractor", self.category, self.subcategory, key), default) - def request(self, url, method="GET", *, session=None, retries=None, + def request(self, url, *, method="GET", session=None, retries=None, encoding=None, fatal=True, notfound=None, **kwargs): tries = 1 retries = self._retries if retries is None else retries diff --git a/gallery_dl/extractor/imgbb.py b/gallery_dl/extractor/imgbb.py index 2a8dcadd..fb321d02 100644 --- a/gallery_dl/extractor/imgbb.py +++ b/gallery_dl/extractor/imgbb.py @@ -90,7 +90,7 @@ class ImgbbExtractor(Extractor): return params["seek"] = data["seekEnd"] params["page"] += 1 - data = self.request(endpoint, "POST", data=params).json() + data = self.request(endpoint, method="POST", data=params).json() page = data["html"] diff --git a/gallery_dl/extractor/plurk.py b/gallery_dl/extractor/plurk.py index 325c6a06..2bb66ac5 100644 --- a/gallery_dl/extractor/plurk.py +++ b/gallery_dl/extractor/plurk.py @@ -49,7 +49,7 @@ class PlurkExtractor(Extractor): data = {"plurk_id": plurk["id"], "count": "200"} while True: - info = self.request(url, "POST", data=data).json() + info = self.request(url, method="POST", data=data).json() yield from info["responses"] if not info["has_newer"]: return @@ -91,7 +91,8 @@ class PlurkTimelineExtractor(PlurkExtractor): offset = datetime.datetime.strptime( plurks[-1]["posted"], "%a, %d %b %Y %H:%M:%S %Z") data["offset"] = offset.strftime("%Y-%m-%dT%H:%M:%S.000Z") - response = self.request(url, "POST", headers=headers, data=data) + response = self.request( + url, method="POST", headers=headers, data=data) plurks = response.json()["plurks"] diff --git a/gallery_dl/oauth.py b/gallery_dl/oauth.py index 69ab4f61..3093a729 100644 --- a/gallery_dl/oauth.py +++ b/gallery_dl/oauth.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2018 Mike Fährmann +# Copyright 2018-2019 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -126,7 +126,7 @@ class OAuth1API(): self.session = extractor.session self.api_key = api_key - def request(self, url, method="GET", **kwargs): + def request(self, url, **kwargs): kwargs["fatal"] = None kwargs["session"] = self.session - return self.extractor.request(url, method, **kwargs) + return self.extractor.request(url, **kwargs)