def getCsfrtoken(self):
fetch = self.request('si/fetch_headers/', None, True)
header = fetch[0]
response = ChallengeResponse(fetch[1])
if not header or not response.isOk():
raise InstagramException("Couldn't get challenge, check your connection")
# return response #fixme unreachable code
match = re.search(r'^Set-Cookie: csrftoken=([^;]+)', fetch[0], re.MULTILINE)
if not match:
raise InstagramException("Missing csfrtoken")
# return $response #fixme unreachable code
token = match.group(1)
return token[22:]
评论列表
文章目录