关于python:抖音-用户id转uid

46次阅读

共计 1615 个字符,预计需要花费 5 分钟才能阅读完成。

​本文所有教程及源码、软件仅为技术钻研。不波及计算机信息零碎性能的删除、批改、减少、烦扰,更不会影响计算机信息零碎的失常运行。不得将代码用于非法用处,如侵立删!​用户 id 转 uid 环境 win10Python3.9PyQt5 成果

抖音 id 转 sec_uiddef get_sec_uid(self, un_id):    headers = {“Accept”: “application/json, text/plain, /“,        “Referer”: “https://www.douyin.com/”,        “Accept-Language”: “zh-CN,zh;q=0.9”,        “Proxy-Tunnel”: str(random.randint(1, 10000))  # 设置 IP 切换头   }    response = requests.get(url, headers=headers)    print(response.text)    user_info = response.json()    if not user_info:        return None    sec_uid = user_info.get(“sec_uid”)    nickname = user_info.get(“nickname”)    return sec_uid, nicknamesec_uid 转 uiddef get_uid(self, sec_uid):    headers = {“Host”: “imdesktop.douyin.com”,            “Accept-Language”: “zh-CN”,            “Sec-Fetch-Dest”: “empty”,            “Sec-Fetch-Mode”: “cors”,            “Sec-Fetch-Site”: “cross-site”,            “User-Agent”: “Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) ????/1.0.6 Chrome/104.0.5112.102 Electron/20.1.0-tt.4.release.main.4 TTElectron/20.1.0-tt.4.release.main.4 Safari/537.36”,            “accept”: “application/json, text/plain, /“,            “bd-ticket-guard-version”: “1”,            “referer”: “https://imdesktop.douyin.com”,            “sdk-version”: “2”,            “sec-ch-ua”: “\” Not A;Brand\”;v=\”99\”, \”Chromium\”;v=\”104\””,            “sec-ch-ua-mobile”: “?0”,            “sec-ch-ua-platform”: “\”Windows\””,            “x-tt-disable-sessionid”: “1”,       }    response = requests.get(url, headers=headers)    print(response.text)    user_info = response.json()    if not user_info:        return None    uid= user_info.get(“uid”)    return uid 资源下载 https://download.csdn.net/download/qq_38154948/87769887 链接:https://pan.baidu.com/s/19WE7lI85uFzhUuwzEzJLDA?pwd=0oi2
提取码:0oi2​本文仅供学习交换应用,如侵立删!​

正文完
 0