解析京东cookie
该脚本会自动解析剪贴板内的cookie内容,免去手动寻找pin和key的麻烦
# -*- coding: utf-8 -*-
# @Time : 2022/9/30
# @Author : Naihe
# @Email : 239144498@qq.com
# @File : jdcookie获取.py
# @Software: PyCharm
import pyperclip
import re
# cookie = " "
cookie = pyperclip.paste() # 从剪贴板内获取cookie
cookie = re.findall(r"(pt_key=.*?\;) .*(pt_pin=.*?\;)", cookie)
try:
data = " ".join(cookie[0])
pyperclip.copy(data) # 将解析后的内容复制到剪贴板
print("解析到剪贴板cookie内容:", data)
except:
print("未解析到cookie内容")