From 63791575431b5a7e51101797a585d4a8b322585c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 17 Nov 2022 17:15:38 +0100 Subject: [PATCH] [instagram] use REST API by default regardless of logged in status --- docs/configuration.rst | 7 +++---- docs/gallery-dl.conf | 2 +- gallery_dl/extractor/instagram.py | 10 +++------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/docs/configuration.rst b/docs/configuration.rst index e73e49e9..d6b385ae 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -1514,13 +1514,12 @@ extractor.instagram.api Type ``string`` Default - ``"auto"`` + ``"rest"`` Description Selects which API endpoints to use. - * ``"rest"``: REST API - higher-resolution media, only usable when logged in - * ``"graphql"``: GraphQL API - lower-resolution media, partially accessible when not logged in - * ``"auto"``: Use REST API when logged in, GraphQL API otherwise + * ``"rest"``: REST API - higher-resolution media + * ``"graphql"``: GraphQL API - lower-resolution media extractor.instagram.include diff --git a/docs/gallery-dl.conf b/docs/gallery-dl.conf index e65a5647..becf599c 100644 --- a/docs/gallery-dl.conf +++ b/docs/gallery-dl.conf @@ -159,7 +159,7 @@ }, "instagram": { - "api": "auto", + "api": "rest", "cookies": null, "include": "posts", "sleep-request": [6.0, 12.0], diff --git a/gallery_dl/extractor/instagram.py b/gallery_dl/extractor/instagram.py index 78c9de1e..c6b7fb79 100644 --- a/gallery_dl/extractor/instagram.py +++ b/gallery_dl/extractor/instagram.py @@ -44,14 +44,10 @@ class InstagramExtractor(Extractor): def items(self): self.login() - api = self.config("api") - if api is None or api == "auto": - api = InstagramRestAPI if self._logged_in else InstagramGraphqlAPI - elif api == "graphql": - api = InstagramGraphqlAPI + if self.config("api") == "graphql": + self.api = InstagramGraphqlAPI(self) else: - api = InstagramRestAPI - self.api = api(self) + self.api = InstagramRestAPI(self) data = self.metadata() videos = self.config("videos", True)