@Akshin17
Пайтон програмист

Ошибка при пост запросе Json python?

пытаюсь получить ответ смог ли я авторизироваться но выдает ошибку
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Сам код:
import requests
import json



data = {"authentication_type": "password",
        "username": "sdgdfre@gmail.com",
        "password": "saefewfwef34wef",
        "client_id": "71a7beb8-f21a-47d9-a604-2e71bee24fe0",
        "session_id": "81150f95-0283-4f28-80ce-39af462cb0e7",
        "nection": "keep-alive",
        "Content-Length": "3506",
        "Cookie": "bm_sz=51FB8A6E49797D348FD8C30B29DBC889~YAAQJIQUAjT+ZjZxAQAAdhBmVgcW7BW8DtG3YOzVK00BtoPxyPJGa75kqt6ZHaSYFjHAxHFG5jYYXUJKjh0ACWdThJ2bIkRg3n9hDGSp1SQjj3L1QbQglPpvdP1sP+M3YX3RKwznJpGMQDTE7vWKXW8ua3NhLMR02MjRU73Y9+9wvfTTBzYjUaOUtY/7LjFRHBZP+SgTc6sX288iRz4hEOfQ; s_fid=69469C67FE887F9D-22D6724693954A9B; s_cc=true; ndcd=wc1.1.w-729460.1.2.DoAhAcoc59z6LOEx1i5nZQ%252C%252C.ip_xUgwzDza_KazLpD4k_kp9N-EuBZTdiPNIGfTf_lmts6dKetsy9CSPz7bq9GpTXaMqvv5nsFxMoR0NMX87oDcrScghLo0TDXUoP59_UwrtppgjzuzUn0SsIEXNcyGhEHRUjPpSaB0e9oUtPu8p37toCGkD-fYUKVqrk0db-16vFXHoUUrHY0MZ07MQPFVc; _abck=B3D11D3B9652858D3F6BB8A76EA7977D~0~YAAQj08VAgnbkRxxAQAACBp0VgNDEYIloNj7CgJagNJjRvVAAcUVONWT0mOQiz2H6BGfRiHg6q5O4Ocv0Ff40vT3M61rUzZ/Oj7O3vRUtPggHC/xBVtUuR41oWLHR3092j5mkPLaKkLc56oVze4uf+SEj7kYdxUs5NfURu5ckrY2w4sBMm70Uk90krmLjmoVLq7zqJVnxK26YCIyCoUYmXjUP3MA1fmhHjUgBwvP1XeXjkxVs4Sip0vuH0wweBK5whIxgTSvHAbJS3beXMVcKRe8rWLNY7Rd1uMURjisvLfospoYMmOuY1/AZnVFO+G+X29JgFKJMRjKE3Mm3y18BqTfRtioMNdA1A==~-1~-1~-1; s_sq=snepdrglobal%3D%2526c.%2526a.%2526activitymap.%2526page%253Dhttps%25253A%25252F%25252Fid.sonyentertainmentnetwork.com%25252Fsignin%25252F%25253Fresponse_type%25253Dxxxx%252526redirect_uri%25253Dxxxxx%2525259x%2525259x%2525259xxxxxx.xxxxxxxxxxx.xxx%2525259xxx-xx%2525259xxxxx%2525259xxxxxx-xxx99999-xxxxxxxxxxxxxxxx%252526client_id%25253Dx9x9999x-x999-9999-99x9-9999999999x9%252526scope%25253Dxxxxxx%2525259xxxxxxxxx_xxxxxx%2525259xxxxxxx%2525259xx%2526link%253D%2525D0%252592%2525D0%2525BE%2525D0%2525B9%2525D1%252582%2525D0%2525B8%252520%2525D0%2525B2%252520%2525D1%252581%2525D0%2525B5%2525D1%252582%2525D1%25258C%2526region%253Dember24%2526.activitymap%2526.a%2526.c",
        "Content-Type": "application/json; charset=UTF-8",
        'widget_data': '{"jvqtrgQngn":{"oq":"1496:723:1536:824:1536:824","wfi":"flap-139108","oc":"9nr12s5s7sqq2osp","fe":"1536k864 24","qvqgm":"-240","jxe":755748,"syi":"gehr","si":"si,btt,zc4,jroz","sn":"sn,zcrt,btt,jni","us":"7os1q32n7n2qp24q","cy":"Jva32","sg":"{\"zgc\":0,\"gf\":snyfr,\"gr\":snyfr}","sp":"{\"gp\":gehr,\"ap\":gehr}","sf":"gehr","jt":"s2nno0055p58o750","sz":"r0rq67ss2747oq0o","vce":"apvc,0,5r8pr752,2,1;fg,0,rzore19,0,rzore22,0;zz,4q65s,443,6,wf-FVRJF1yvo-urnqre-Pbagrag;gf,0,4q65s;zzf,3r9,0,n,42 0,331q 5580,153n,155r,-34898,1n0pp,-6spp;zzf,3r9,3r9,n,41 0,41 74,2p,2p,-507,2n8,-41;zzf,3r9,3r9,n,41 0,13s 0,2q,2r,-284,p37,139;xx,18r,0,rzore19;ss,0,rzore19;zp,53,2r0,182,rzore19;xq,67;xq,11;xq,94;xq,87;zzf,72,3r6,n,0 73,99n rp,282,27o,-58q7,47o2,202;xq,15;xq,8n;xq,64;zz,1s,2pn,189,rzore19;xq,217;xq,90;zzf,20,3r9,n,41 0,1p3 r5,o0,o0,-rnr,94p,-312;xq,212;zzf,1q5,3r7,n,ABC;xq,nq;xq,70;xq,1o8;xq,81;xq,70;zzf,22,3r8,n,ABC;xq,p1;xq,s0;xq,6r;xq,80;xq,9o;xq,n5;so,9,rzore19;xx,2,0,rzore22;ss,0,rzore22;zzf,1,3ro,n,ABC;xq,156;xq,2s;xq,no;xq,78;xq,p3;xq,3;zzf,77,3r5,n,ABC;xq,29;xq,45;xq,7;xq,7p;xq,5o;xq,2;zz,21,2p3,190,rzore22;xq,13;xq,n;xq,33;zzf,228,3r7,n,0 2o0,81 12pq,4q1,4q0,-9362,90on,on9;xq,105;xq,88;xq,66;so,159,rzore22;zz,22r7,268,1s6,;gf,0,523n2;zzf,r0,2713,32,21 3n,10no 26n,111,np4,-4nn4,51os,3r;xx,218,s,rzore22;ss,0,rzore22;so,n,rzore22;zp,5s,304,1p1,;zzf,2490,2711,32,0 3n,928 nn0,q5,84o,-3q40,44sp,-17p;zz,23oq,378,69,;gf,0,56s50;zzf,353,2710,32,417 5nr,1o13 55rp,1s1,1380,-1n189,1p035,-16;zzf,270s,270s,32,ABC;zzf,2710,2710,32,ABC;gf,0,5p0p2;zzf,2710,2710,32,ABC;zz,3r78,38r,93,;gf,0,6264n;zz,213p,50n,61,;zzf,8nns,rn63,1r,142 68,5rq 74,5n,1532,-2s9,24s,0;gf,0,6q235;zzf,rn60,rn60,1r,ABC;gf,0,7op95;zz,5qo2,228,13,wf-FVRJF1yvo-urnqre-RkcynvaGrkg;gf,0,81n47;zzf,8pnr,rn60,1r,0 2p9,735 2p1,5n,1506,-278,3qn,0;gf,0,8n6s5;zzf,rn60,rn60,1r,ABC;gf,0,99155;zzf,rn60,rn60,1r,ABC;gf,0,n7oo5;zz,p5qr,463,48,;gf,0,o4193;zz,12984,394,4,wf-FVRJF1yvo-urnqre-Pbagrag;gf,0,p6o17;zz,34n10,368,92,;gf,0,so527;zz,50qqr,399,8,wf-FVRJF1yvo-urnqre-Pbagrag;gf,0,14p305;zz,10896,348,8s,;gf,0,15po9o;zz,sr54,3po,3,wf-FVRJF1yvo-urnqre-PbagragNern;gf,0,16p9rs;zz,1s68,3o1,8o,;zz,r2n0,41r,7,wf-FVRJF1yvo-urnqre-Pbagrag;gf,0,17pos7;zz,3s06,3oo,1o,wf-FVRJF1yvo-urnqre-RkcynvaGrkg;gf,0,180nsq;zp,812,4o5,46,;zp,3q1,54o,17,wf-FVRJF1yvo-urnqre-PybfrVpba;zz,614,424,4n,;zz,607n5,411,2,;gf,0,1r2499;zz,1rnn,3p,175,;xx,1q8,0,rzore22;ss,0,rzore22;zp,67,254,102,rzore22;xq,2n;xq,7o;xq,106;xq,65;xq,3;xq,60;xq,41;xq,46;xq,25;xq,22;xq,46;so,102,rzore22;zp,59,2np,148,;zz,235r,3oq,59,;gf,0,1r6qp2;zp,q88,313,139,;zz,285,407,1rs,;zz,qrr8,50r,103,;gf,0,1s5po7;zz,162o1,2p1,s7,rzore22;gf,0,20os68;xx,527,0,rzore22;ss,0,rzore22;zp,21q,330,180,;so,251,rzore22;xx,3s7,0,rzore22;ss,0,rzore22;zp,7n,2s3,10n,rzore22;zz,221,2rs,104,rzore22;xq,43;xq,83;xq,qs;xq,pq;xq,p9;xq,ro;xq,p3;so,11p,rzore22;zp,67,2q3,141,;zz,q0p,5p2,10q,;","ns":""},"jg":"1.j-666234.1.2.D5OvqtaS7GCnmmrmC2-V5N,,.b8CsKg70ZJDbDPfA4qG1quWTyOnsHd4QZ6-P6UFljHyqxgCBTjpjEkiGcfcRqc7pAf4tkSsDx_5SBjm2TiI7wz2-Lk07sjT3fryAS7s0o6xezR9mfNsxpAC7RV6NnmBoJbcbuAQ0P1hdlZaQdAabIBhoYZLPMyp_FG5a52ZeBHjtxdS61bi8P6eOGUgMmW1RmmB24xOhU2nrIH3p3GCDl1Y8R51YTwn7d5sadu_O1z2dhH_TR8GJHUOyxrTk6_f7"}'}

hea = {"Accept": "*/*",
       "User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36 OPR/67.0.3575.115 (Edition Yx)",
       "Accept-Encoding":'gzip, deflate, br',
       "Accept-Language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
       "ost": "auth.api.sonyentertainmentnetwork.com",
        "Referer": "https://id.sonyentertainmentnetwork.com /",
       "X-Origin-ClientId": "f6c7057b-f688-4744-91c0-8179592371d2",
       "X-Referer-Info": "https://id.sonyentertainmentnetwork.com/signin/?response_type=code&redirect_uri=https%3A%2F%2Fstore.playstation.com%2Fru-ru%2Fhome%2FSTORE-MSF75508-MOBHOMEGAMESONLY&client_id=f6c7057b-f688-4744-91c0-8179592371d2&prompt=login&state=returning&request_locale=ru_RU&service_entity=urn%3Aservice-entity%3Apsn&hidePageElements=SENLogo&disableLinks=SENLink&ui=pr&error=login_required&error_code=4165&error_description=User+is+not+authenticated&no_captcha=false"}

s = requests.Session()
r = s.post('https://id.sonyentertainmentnetwork.com/signin/?response_type=code&redirect_uri=https%3A%2F%2Fstore.playstation.com%2Fru-ru%2Fhome%2FSTORE-MSF75508-MOBHOMEGAMESONLY&client_id=f6c7057b-f688-4744-91c0-8179592371d2&scope=kamaji%3Acommerce_native%2Ckamaji%3Acommerce_container%2Ckamaji%3Alists&prompt=login&state=returning&request_locale=ru_RU&service_entity=urn%3Aservice-entity%3Apsn&hidePageElements=SENLogo&disableLinks=SENLink&ui=pr&error=login_required&error_code=4165&error_description=User+is+not+authenticated&no_captcha=false#/signin?entry=%2Fsignin',data=data,headers=hea)
r2 = json.loads(r.text)
print(r2['message'])
  • Вопрос задан
  • 2784 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы