diff --git a/gallery_dl/extractor/pinterest.py b/gallery_dl/extractor/pinterest.py index 93ef7ff611..4b26393446 100644 --- a/gallery_dl/extractor/pinterest.py +++ b/gallery_dl/extractor/pinterest.py @@ -10,7 +10,6 @@ from .common import Extractor, Message from .. import text, util, exception -from ..cache import cache import itertools BASE_PATTERN = r"(?:https?://)?(?:\w+\.)?pinterest\.[\w.]+" @@ -33,7 +32,6 @@ def _init(self): self.api = PinterestAPI(self) def items(self): - self.api.login() data = self.metadata() videos = self.config("videos", True) @@ -416,41 +414,6 @@ def search(self, query): options = {"query": query, "scope": "pins", "rs": "typed"} return self._pagination("BaseSearch", options) - def login(self): - """Login and obtain session cookies""" - username, password = self.extractor._get_auth_info() - if username: - self.cookies.update(self._login_impl(username, password)) - - @cache(maxage=180*86400, keyarg=1) - def _login_impl(self, username, password): - self.extractor.log.info("Logging in as %s", username) - - url = self.root + "/resource/UserSessionResource/create/" - options = { - "username_or_email": username, - "password" : password, - } - data = { - "data" : util.json_dumps({"options": options}), - "source_url": "", - } - - try: - response = self.extractor.request( - url, method="POST", headers=self.headers, - cookies=self.cookies, data=data) - resource = response.json()["resource_response"] - except (exception.HttpError, ValueError, KeyError): - raise exception.AuthenticationError() - - if resource["status"] != "success": - raise exception.AuthenticationError() - return { - cookie.name: cookie.value - for cookie in response.cookies - } - def _call(self, resource, options): url = "{}/resource/{}Resource/get/".format(self.root, resource) params = {