mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-22 02:32:33 +01:00
[instagram] add 'api' option
This commit is contained in:
parent
6f77193a24
commit
aa49bf13d2
@ -1468,6 +1468,20 @@ Description
|
||||
for details)
|
||||
|
||||
|
||||
extractor.instagram.api
|
||||
-----------------------
|
||||
Type
|
||||
``string``
|
||||
Default
|
||||
``"auto"``
|
||||
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
|
||||
|
||||
|
||||
extractor.instagram.include
|
||||
---------------------------
|
||||
Type
|
||||
|
@ -156,8 +156,9 @@
|
||||
{
|
||||
"username": null,
|
||||
"password": null,
|
||||
"api": "auto",
|
||||
"include": "posts",
|
||||
"sleep-request": 8.0,
|
||||
"sleep-request": [6.0, 12.0],
|
||||
"videos": true
|
||||
},
|
||||
"khinsider":
|
||||
|
@ -43,8 +43,15 @@ class InstagramExtractor(Extractor):
|
||||
|
||||
def items(self):
|
||||
self.login()
|
||||
self.api = (InstagramRestAPI(self) if self._logged_in else
|
||||
InstagramGraphqlAPI(self))
|
||||
|
||||
api = self.config("api")
|
||||
if api is None or api == "auto":
|
||||
api = InstagramRestAPI if self._logged_in else InstagramGraphqlAPI
|
||||
elif api == "graphql":
|
||||
api = InstagramGraphqlAPI
|
||||
else:
|
||||
api = InstagramRestAPI
|
||||
self.api = api(self)
|
||||
|
||||
data = self.metadata()
|
||||
videos = self.config("videos", True)
|
||||
|
Loading…
Reference in New Issue
Block a user