import re

import random
import requests

sw = {
    "token": "2076998652",
    "cookie": "appmsglist_action_3524986952=card; ua_id=j6t2xNuC0mv6dLVbAAAAAMPRLKj1sVGSlMDwNFJKE3s=; wxuin=93278011749821; mm_lang=zh_CN; qm_authimgs_id=1; qm_verifyimagesession=h01dd7009a9ae4356f2df8938753c3bf06763c3fd0efcd26130b2271121aa189755d8b9248e61f889fa; rewardsn=; wxtokenkey=777; cert=z67ZyYTz9FXkSX2cQZdPaM6e78I7bOWN; pgv_info=ssid=s2787649785; pgv_pvid=6815195556; uin=; _clck=3524986952|1|fes|0; sig=h01f9888664abf07056513662d12369144e08d65c6fff8789e768a5a07ef768ebff5fdcde113a72f054; uuid=849e11e97012667f0309400ca8864e62; rand_info=CAESIFl6WMLWuhktQLjMDXVTQp3kHcJULDTRs8QuD3WzjTt5; slave_bizuin=3578761722; data_bizuin=3578761722; bizuin=3578761722; data_ticket=W1xaV+6ozgZcLsUPELDt74vidI043lgnk+eVXEqWqfuKVkjL9KWycFenmiSXGF8Q; slave_sid=bjl0M2NyQlNhSkM2bXBVT2NqdDF1Mm1aSVBPWWhnX2hIM3pJSkNiZ1kyVFBpSml2TlpzcnlVSzBxTEtocVltOENnUkRUaUdkdV9Wbk1qNEcxazlmMDE5MndIMU9ZbFZQX3dfYWtCbDU1NGdreGZYdGhNQXN5SXluWWRqejRGQWU2VGNjdlM0Sm5qSlgxZzZl; slave_user=gh_a0af577a3b94; xid=679801273876af682b524b9f5b8274bd; _clsk=da8rsa|1694003070287|2|1|mp.weixin.qq.com/weheat-agent/payload/record"
}

ljh = {
    "token": "254572819",
    "cookie": "appmsglist_action_3524986952=card; ua_id=j6t2xNuC0mv6dLVbAAAAAMPRLKj1sVGSlMDwNFJKE3s=; wxuin=93278011749821; mm_lang=zh_CN; qm_authimgs_id=1; qm_verifyimagesession=h01dd7009a9ae4356f2df8938753c3bf06763c3fd0efcd26130b2271121aa189755d8b9248e61f889fa; rewardsn=; wxtokenkey=777; cert=z67ZyYTz9FXkSX2cQZdPaM6e78I7bOWN; pgv_info=ssid=s2787649785; pgv_pvid=6815195556; uin=; sig=h01f9888664abf07056513662d12369144e08d65c6fff8789e768a5a07ef768ebff5fdcde113a72f054; _clck=3524986952|1|feu|0; noticeLoginFlag=1; remember_acct=2071735594%40qq.com; openid2ticket_ox8VH6rMbm8oMFh_VY2os9-LvSng=jnVihrfn9nn52IBQhTVFhnMBIhFdGmPxLKh/VjeQXV0=; uuid=70795ed42bd976d62ee74006747663a2; rand_info=CAESIPBfBxyAgiRrFlMZ4XVpz/7y/9qbaDdl2ZYwY/+IQJHh; slave_bizuin=3524986952; data_bizuin=3524986952; bizuin=3524986952; data_ticket=H2H//IJujjPGQR/uTA/HIjBoODBLFEn1NEVfQph29DbRUXH7o5cbWQeOHrvkYlAd; slave_sid=Q3NBdkg1eVRuNnJic05Kc2E5cjNSNXNlbno3czk5S2xLRFBNUkE2bDAyTWtJUnNlYWw5elY0cXM2TmtybmNONHdVYkhtdExWNDVGVWZEcXlJNktkdjhkZ0tzMDlhcjZ6UkI4NTl2R1pJVWhkS2pLS1VvNHR6aHVhZ2lDcjkzVDB5SENCNW53bnNuN1UzcU1p; slave_user=gh_0d8cf8319a3b; xid=ac626a011aeb12319b4542ad0e4c5885; _clsk=oiyg8u|1694139205020|5|1|mp.weixin.qq.com/weheat-agent/payload/record"
}

lyk = {
    "token": "1489440721",
    "cookie": "appmsglist_action_3524986952=card; ua_id=j6t2xNuC0mv6dLVbAAAAAMPRLKj1sVGSlMDwNFJKE3s=; wxuin=93278011749821; mm_lang=zh_CN; pgv_pvid=6815195556; noticeLoginFlag=1; openid2ticket_oPVHrwAFRuGeLabUv9_owuPvR7sc=EjqBbWJx8I6AJ4U0hXi2w4JeyZbh5A/Ut3bh6m16ohY=; remember_acct=2071735594%40qq.com; rewardsn=; cert=TWF7TDUtzPkwyiiwuRH8aWJ1ZsZVZACX; wxtokenkey=777; _clck=3930572231|1|fex|0; uuid=cf6ea6705921fe74e50b52c096658feb; rand_info=CAESIOJnBLod7Nuzqvx8WCg6qGw65qdqv8SFCeZqrTsRnsd/; slave_bizuin=3930572231; data_bizuin=3930572231; bizuin=3930572231; data_ticket=ROSsIXktKBr47RL5iYT6f+MICbD/+57NC1+cmoWNVJYLiIGu0inzT155Xaa/IiA0; slave_sid=SktkQUM0Vk5TRWdBVnNia04yZjM0VWl0aWh2bDkyX3lrVjNockU0a08xOGx2cHpSdF9vcWRxV3NoQjA3czVwWG1qdVBzR0pLc0prRG1zeURZQzdHUllSanBTTWc3S0dKbkQ1NVNpWEFKMmJmNFloYUk4QU80MWFEaHdtakN1Tk5kbk92ekF5WnhNOE15Q2U3; slave_user=gh_deef7ad59a83; xid=47a36bbb57c765a0a28c83b5cc8869e0; _clsk=9z6sj6|1694398338553|4|1|mp.weixin.qq.com/weheat-agent/payload/record"
}

gzq = {
    "token": "1244362903",
    "cookie": "appmsglist_action_3524986952=card; ua_id=j6t2xNuC0mv6dLVbAAAAAMPRLKj1sVGSlMDwNFJKE3s=; wxuin=93278011749821; mm_lang=zh_CN; pgv_pvid=6815195556; noticeLoginFlag=1; remember_acct=2071735594%40qq.com; rewardsn=; cert=TWF7TDUtzPkwyiiwuRH8aWJ1ZsZVZACX; wxtokenkey=777; _clck=3930572231|1|fex|0; uuid=0158799cbdb235cd43a2f5217219f916; rand_info=CAESIBP4Int6bgJCQgR9eC+1qP7muPHMSSra0sJ5HNg04k5B; slave_bizuin=3236647229; data_bizuin=3236647229; bizuin=3236647229; data_ticket=SXxZvfJVlDdoBGxzmFik/0MkeBVg6eKENIX7iY5yZo0H3lubhUHFDOVcij+VEjN+; slave_sid=ZU0zTk9hM29scWlwajVJdVU5R1JHTmZDT1RRdEVuUWxRVmNJUFEyT0llWHFGeFBxWlhTek1QYVN1XzU2NWg1Z1JlRjNyQ3pFeWtGd3VRTlhnN0dUSlZMU0VVY0ZOWHdWd3d6ZXB0WXJKWUNCajg1MlBBTVBPNjdOTVZFYWtOTjI1WThPRjdkYWVrSHlQZVph; slave_user=gh_d284c09295eb; xid=4100c66614456ec32b92bbc7854eca65; _clsk=9z6sj6|1694400060949|11|1|mp.weixin.qq.com/weheat-agent/payload/record"
}


def return_token():
    token_list = [lyk, gzq]
    return gzq


def get_token():
    cookies = []
    cookie = {}
    for items in cookies:
        cookie[items.get("name")] = items.get("value")
    url = "https://mp.weixin.qq.com"
    response = requests.get(url, cookies=cookie)
    # print(response)
    token = re.findall(r'token=(\d+)', str(response.url))[0]  # 从url中获取token
    # print(token)
    return token
