1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-23 11:12:40 +01:00

[instagram] update API domain and headers

This commit is contained in:
Mike Fährmann 2023-01-21 17:30:39 +01:00
parent 137de090dd
commit fc6ea8ee5c
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright 2018-2020 Leonardo Taccari # Copyright 2018-2020 Leonardo Taccari
# Copyright 2018-2022 Mike Fährmann # Copyright 2018-2023 Mike Fährmann
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License version 2 as
@ -794,7 +794,12 @@ class InstagramRestAPI():
def user_clips(self, user_id): def user_clips(self, user_id):
endpoint = "/v1/clips/user/" endpoint = "/v1/clips/user/"
data = {"target_user_id": user_id, "page_size": "50"} data = {
"target_user_id": user_id,
"page_size": "50",
"max_id": None,
"include_feed_video": "true",
}
return self._pagination_post(endpoint, data) return self._pagination_post(endpoint, data)
def user_collection(self, collection_id): def user_collection(self, collection_id):
@ -820,14 +825,16 @@ class InstagramRestAPI():
def _call(self, endpoint, **kwargs): def _call(self, endpoint, **kwargs):
extr = self.extractor extr = self.extractor
url = "https://i.instagram.com/api" + endpoint url = "https://www.instagram.com/api" + endpoint
kwargs["headers"] = { kwargs["headers"] = {
"Accept" : "*/*",
"X-CSRFToken" : extr.csrf_token, "X-CSRFToken" : extr.csrf_token,
"X-Instagram-AJAX": "1006242110", "X-Instagram-AJAX": "1006242110",
"X-IG-App-ID" : "936619743392459", "X-IG-App-ID" : "936619743392459",
"X-ASBD-ID" : "198387", "X-ASBD-ID" : "198387",
"X-IG-WWW-Claim" : extr.www_claim, "X-IG-WWW-Claim" : extr.www_claim,
"Origin" : extr.root, "X-Requested-With": "XMLHttpRequest",
"Alt-Used" : "www.instagram.com",
"Referer" : extr.root + "/", "Referer" : extr.root + "/",
} }
kwargs["cookies"] = { kwargs["cookies"] = {