from myClass.myPickle import read_pickle_file

def get_cookeis_dict(cookies):
    '''
        'll="118318"; bid=ICuIvj3BSYg; _vwo_uuid_v2=D9A5BD54775C0A8ADA196ED7DD237E303|8357de64c78dca92d17b68504bf9f1c1; ct=y; gr_user_id=1d391c67-6d39-4aef-a805-385b39eb430d; _ga=GA1.1.1852380685.1624613315; _ga_RXNMP372GL=GS1.1.1628168451.1.1.1628168489.0; __yadk_uid=Xm3InJI7rtOYaiiJQ2J2Lj4HCKR2jaxO; viewed="4913064_35438602"; __utma=30149280.1852380685.1624613315.1628930406.1629721717.7; __utmz=30149280.1629721717.7.6.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmc=30149280; __utmt=1; dbcl2="172123593:j5u/XDBOMV8"; ck=nAmJ; ap_v=0,6.0; push_noty_num=0; push_doumail_num=0; __utmv=30149280.17212; __gads=ID=90244c96a19371be-220a66801acb0008:T=1625047326:RT=1629721870:S=ALNI_MZwGuXTny2lc6fsMvQ2DEKbGR-xqw; __utmb=30149280.17.10.1629721717; __utma=223695111.1154555244.1625047327.1628930406.1629721879.6; __utmb=223695111.0.10.1629721879; __utmc=223695111; __utmz=223695111.1629721879.6.5.utmcsr=douban.com|utmccn=(referral)|utmcmd=referral|utmcct=/gallery/; _pk_ref.100001.4cf6=%5B%22%22%2C%22%22%2C1629721880%2C%22https%3A%2F%2Fwww.douban.com%2Fgallery%2F%22%5D; _pk_id.100001.4cf6=3f95e8a8b90a65eb.1625047326.6.1629721880.1628930649.; _pk_ses.100001.4cf6=*'
        上面cookies转为
        {'name':'value'}
    '''

    cookies_dict = {}
    for i in cookies.split(';'):
        cookies_list = i.split('=')
        cookies_dict[cookies_list[0]] = cookies_list[1]
    return cookies_dict

def get_my_cookies_str():
    list_ = read_pickle_file(r'C:\Users\justin\Desktop\yilong\knowledgePoints\08_js逆向\02_58同城\58cookies.txt')
    for i in list_:
        print(i)


if __name__ == '__main__':
    cookies_douban = 'll="118318"; bid=ICuIvj3BSYg; _vwo_uuid_v2=D9A5BD54775C0A8ADA196ED7DD237E303|8357de64c78dca92d17b68504bf9f1c1; ct=y; gr_user_id=1d391c67-6d39-4aef-a805-385b39eb430d; _ga=GA1.1.1852380685.1624613315; _ga_RXNMP372GL=GS1.1.1628168451.1.1.1628168489.0; __yadk_uid=Xm3InJI7rtOYaiiJQ2J2Lj4HCKR2jaxO; viewed="4913064_35438602"; __utma=30149280.1852380685.1624613315.1628930406.1629721717.7; __utmz=30149280.1629721717.7.6.utmcsr=baidu|utmccn=(organic)|utmcmd=organic; __utmc=30149280; __utmt=1; dbcl2="172123593:j5u/XDBOMV8"; ck=nAmJ; ap_v=0,6.0; push_noty_num=0; push_doumail_num=0; __utmv=30149280.17212; __gads=ID=90244c96a19371be-220a66801acb0008:T=1625047326:RT=1629721870:S=ALNI_MZwGuXTny2lc6fsMvQ2DEKbGR-xqw; __utmb=30149280.17.10.1629721717; __utma=223695111.1154555244.1625047327.1628930406.1629721879.6; __utmb=223695111.0.10.1629721879; __utmc=223695111; __utmz=223695111.1629721879.6.5.utmcsr=douban.com|utmccn=(referral)|utmcmd=referral|utmcct=/gallery/; _pk_ref.100001.4cf6=%5B%22%22%2C%22%22%2C1629721880%2C%22https%3A%2F%2Fwww.douban.com%2Fgallery%2F%22%5D; _pk_id.100001.4cf6=3f95e8a8b90a65eb.1625047326.6.1629721880.1628930649.; _pk_ses.100001.4cf6=*'
    cookies_1688 = '_uab_collina=162970952860339372673772; lastRefresh=1629714276552; hng=CN%7Czh-CN%7CCNY%7C156; ali_ab=171.221.146.61.1623141936492.6; _bl_uid=p3k6FpLOoss0wnrRO8e2xgXeC11g; UM_distinctid=179eb98586b1b2-014e9ca1b8ad79-5771133-1ab260-179eb98586c6bd; taklid=74f94be574d6474fa4bf049abb0471ea; CNZZDATA1261052687=1650740512-1624085620-https%253A%252F%252Fdetail.1688.com%252F%7C1627614127; lid=%E5%B1%A5%E5%AE%9A%E4%BB%8A%E7%94%9F1; ali_apache_track=c_mid=b2b-22073265609037a402|c_lid=%E5%B1%A5%E5%AE%9A%E4%BB%8A%E7%94%9F1|c_ms=1|c_mt=3; cna=M+mnGRd/SAgCAavdkNALcwlX; xlly_s=1; last_mid=b2b-22073265609037a402; __rn_alert__=false; _m_h5_tk=ed703b9405c10ed00ecbeaaef6b6ac0b_1629723947157; _m_h5_tk_enc=1a1379e91cb1021da965df7df4b04f0f; t=e06431b4147938b53c8d60280a0fdd15; cookie1=Vv0uhZrnAL%2B48JD%2FpX2GVvvqAaLGiS8ul82LctjOLns%3D; cookie2=11c215be9d54827ea5254cd9e3d793c7; cookie17=UUphzWRb1SSlpSbV1g%3D%3D; _tb_token_=e383148e57e36; sg=134; csg=c64608a1; unb=2207326560903; uc4=id4=0%40U2grFntzCKo55iWoPL%2BS%2FC0fhYjwOvNG&nk4=0%40o7JuAzburPTBsK1zPNOQNDNGYH0%3D; __cn_logon__=true; __cn_logon_id__=%E5%B1%A5%E5%AE%9A%E4%BB%8A%E7%94%9F1; ali_apache_tracktmp=c_w_signed=Y; _nk_=%5Cu5C65%5Cu5B9A%5Cu4ECA%5Cu751F1; _csrf_token=1629719439922; firstRefresh=1629719447428; lastRefresh=1629719447428; _is_show_loginId_change_block_=b2b-22073265609037a402_false; _show_force_unbind_div_=b2b-22073265609037a402_false; _show_sys_unbind_div_=b2b-22073265609037a402_false; _show_user_unbind_div_=b2b-22073265609037a402_false; alicnweb=touch_tb_at%3D1629719448593%7Clastlogonid%3D%25E5%25B1%25A5%25E5%25AE%259A%25E4%25BB%258A%25E7%2594%259F1; CNZZDATA1253659577=1319754584-1629703507-%7C1629714307; JSESSIONID=A743FA0B43834EF376344EA22514AEDA; tfstk=c25NB7Y2a5FaBuObeCO41EMKLNAFZ0bGoR8yI9dsrOrS_3pGivov-tlhbg-8tdf..; l=eB_MO42VjC9w9hB9BOfaFurza7R3SIRfguPzaNbMiOCP96jp53qGW6ncX299CnNVn6zXJ3SW3fIbBjLu8yzhVxv9-eZOK3sZndLh.; isg=BDIySyB8h24Th7rOIW1RhenKg3gUwzZdsLDND_wLUuXQj9OJ5Vb5bKDlf2uV_671'
    cookies_baidu = 'BIDUPSID=F9789D624DAA5852480C89941BA645E0; PSTM=1616248343; BAIDUID=F9789D624DAA5852CE7FC82030239C37:FG=1; BD_UPN=12314753; __yjs_duid=1_2df4bc05440f0e15a21a96f9ffa7baec1619514497839; ispeed_lsm=2; MCITY=-%3A; BAIDUID_BFESS=F9789D624DAA5852CE7FC82030239C37:FG=1; __yjs_st=2_N2ViNDFiMmRiNjkwZmM3ODc4MzViNTYyMTZjZTBkOTdhZTJkOTA0NjY4YmY0YWM1NzY4ZmU5MWViZGQ0NjdkODU0Yzg4MzhmNTA3ZTBhNmU4OGMzNzE0NTk3YTkxNDQwNTdlYTUwZWUzMGJjNDQ2YmYzNzBhODM0NmIxYjlmODRkMjFmODNmMDIxOTI1ZDY3MWYyZGUyMzZiOTE0NjcwOTM4NmQwMmQ2NzNhNmFhN2U1OWYzZDNjNGUxNDA1NmNhYmIzY2U2ZTIyNzhlNDNmZjg5OWEzY2YxNTJiZDE3M2MzMTgwMDJjOTBlOTA5MDMyY2M0NGYxMGMwZmUzOGU4N2NjNzJkZWQ2Zjk3ZGQ2NzQxNGJkNjkzZDFhYzc0YTU5XzdfNDU1N2NkZjM=; Hm_lvt_aec699bb6442ba076c8981c6dc490771=1629704730; sug=3; sugstore=1; ORIGIN=0; bdime=0; BDUSS=WNLZkF1T2l4aHFwUGpKcVBNSy14Vm83VEtEN0dNTHRuWTdIVHY1OXRJaEI1VXBoRVFBQUFBJCQAAAAAAAAAAAEAAACiOdSjwfrBvNPqtcTL2LLEv-IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEFYI2FBWCNha; BDUSS_BFESS=WNLZkF1T2l4aHFwUGpKcVBNSy14Vm83VEtEN0dNTHRuWTdIVHY1OXRJaEI1VXBoRVFBQUFBJCQAAAAAAAAAAAEAAACiOdSjwfrBvNPqtcTL2LLEv-IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEFYI2FBWCNha; BDORZ=FFFB88E999055A3F8A630C64834BD6D0; COOKIE_SESSION=4197_0_5_5_10_35_1_2_5_5_2_0_4147_0_25_0_1629712451_0_1629712426%7C5%230_0_1629712426%7C1; BDRCVFR[sik10YimRpn]=EBD6F1bEM2tXZKdrHn8mvqV; BD_HOME=1; H_PS_PSSID=31254_26350; delPer=0; BD_CK_SAM=1; PSINO=7; H_PS_645EC=2ef0vAxShrV7IW5KKVGbeKuamZVPDe07VU9yL%2FV7A8gheJuU6gOAKkjGPy4rAffDQ5KdeKz7paYh; BA_HECTOR=85a5ah0g0la12k2he01gi72qt0r; BDSVRTM=0'
    # print(get_cookeis_dict(cookies_1688))
    # print(get_my_cookie_list('.douban.com', cookies_douban))
    get_my_cookies_str()
