Skip to content

Commit

Permalink
[instagram] Fix extraction after `rhx_gis' field removal
Browse files Browse the repository at this point in the history
  • Loading branch information
iamleot authored and mikf committed May 17, 2019
1 parent 7a14aae commit fb09dd9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions gallery_dl/extractor/instagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ def _extract_page(self, url, page_type):
if 'entry_data' in shared_data:
base_shared_data = shared_data['entry_data'][page_type][0]['graphql']

# `rhx_gis' and variables_id are available only in the first page
rhx_gis = shared_data['rhx_gis']
# variables_id is available only in the first page
variables_id = base_shared_data[psdf['node']][psdf['node_id']]
else:
base_shared_data = shared_data['data']
Expand All @@ -143,10 +142,9 @@ def _extract_page(self, url, page_type):
variables_id,
end_cursor,
)
xigis = '{}:{}'.format(rhx_gis, variables)
headers = {
"X-Requested-With": "XMLHttpRequest",
"X-Instagram-GIS": hashlib.md5(xigis.encode()).hexdigest(),
"X-Instagram-GIS": hashlib.md5(variables.encode()).hexdigest(),
}
url = '{}/graphql/query/?query_hash={}&variables={}'.format(
self.root,
Expand Down

0 comments on commit fb09dd9

Please sign in to comment.