【发布时间】:2019-05-26 06:18:13
【问题描述】:
我在 Python3.7 中编写了以下函数来生成 x-instagram-gis。根据我对这个主题的研究,我收集到我只需要 rhx_gis 和变量(id:profile_id,first:int
def generate_x_instagram_gis(rhx_gis, cursor, profile_id):
params = {
"id": profile_id,
"first": 12,
"after": cursor,
}
json_params = json.dumps(params, separators=(',', ':'))
values = "{}:{}".format(rhx_gis, json_params)
return hashlib.md5(values.encode('utf-8')).hexdigest()
运行以下应该返回:90bd6b662f328642477076d92d599064
rhx_gis = "7733066781d53e86a089eeb454c5446d"
cursor = "QVFBZWRqS0RnbGMtaXJhQzhlRW01R0I2YngtVXNQOGRTZzdHZEdseGcyVE1MdUxFYmYyY011Zkx6dFZtQUlsYWNvRl9DWnhtalpXZ2daSU5YQnFNTFBGRg=="
profile_id = "6822549659" #https://www.instagram.com/kimimatiasraikkonen/
print(generate_x_instagram_gis(rhx_gis, cursor, profile_id))
但它返回:f5e1e4be6612701d43523d707e36672b
作为参考,这些是我看过的来源:
- https://github.com/rarcega/instagram-scraper/issues/205
- How to perform unauthenticated Instagram web scraping in response to recent private API changes?
我不完全确定我做错了什么,当我用我的整个程序运行它时它不起作用,这是经过多次测试后唯一导致问题的部分。我注意到的另一件事是,在 Python3.7 和 Python2.7 上运行时,MD5 是不同的
【问题讨论】:
标签: python python-3.x instagram instagram-api