1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[instagram] use REST API by default

regardless of logged in status
This commit is contained in:
Mike Fährmann 2022-11-17 17:15:38 +01:00
parent 6e08ad26f7
commit 6379157543
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
3 changed files with 7 additions and 12 deletions

View File

@ -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

View File

@ -159,7 +159,7 @@
},
"instagram":
{
"api": "auto",
"api": "rest",
"cookies": null,
"include": "posts",
"sleep-request": [6.0, 12.0],

View File

@ -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)