InstagramRegistration.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:Instagram-API 作者: danleyb2 项目源码 文件源码
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:]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号