"GET /fdfe/delivery HTTP/1.1" 400 1555
I am able to retrieve the download token after sending the purchase request. But while trying to get the download URL while sending he delivery request, I'm facing the Bad Request error. Could anyone please help me with this?
What package are you trying to download? If it is a paid app, and you never purchased it on regular Play Store, it will give you a App not purchased error. If it's a paid app you already purchased on regular Play Store, you should directly use delivery without download. If it's a free app then there's some problem. Can you post the complete output of the error?
Its a free app (com.denite.watchface.diamondelegance). However I've never downloaded it before. Is that why I'm facing the issue?
Below is the log of the exception faced.
INFO:Starting new HTTPS connection (1): android.clients.google.com DEBUG:"POST /fdfe/purchase HTTP/1.1" 200 None DEBUG:AB-xQnqLWShl3fVflo4jvDP3-rNcIJNSYDsl8NxnKV8ZFjvepWadDWMYDRtUXqMurBiFldAwizC_wL8sjU1ETIkMVd7WOB9GX7X3pF6iWGt2UD3y4ZszhNro0fjR9ebukWfDJ5g2c9UR (This is the download token I received) INFO:Routing via Tor now INFO:Starting new HTTPS connection (1): android.clients.google.com DEBUG:"GET /fdfe/delivery HTTP/1.1" 400 1555 DEBUG:400 WARNING:could not download... Error : Unexpected end-group tag.
These are the headers I have used -
headers = { "Accept-Language": self.lang, "Authorization": "GoogleLogin auth=%s" % self.authSubToken, "X-DFE-Supported-Targets": "12603130,12603248,12603505,12604226,739,12602035,12602049,12602373,12602392,12602623,12602624,12602636,12602761,12602795,12602981,12603101,12603131,12603159,12603193,12603210,12603385,12603406,12603428,12603513,12603514,12603602,12603746,12603844,12603948,12604079,12604142,12604155,12604230,12604266,12604268,12604305,12605120,12605124", "X-Ad-Id": "30f94931-7b7c-4823-89f0-8d54fb3d1455", "X-DFE-Content-Filters": "", "X-DFE-Request-Params": "timeoutMs=2500", "X-DFE-Cookie": "EAEYACICR0I", "X-DFE-Device-Id": self.androidId, "X-DFE-Client-Id": "am-android-google", "User-Agent": "Android-Finsky/6.0.5(api=3,versionCode=80430500,sdk=23,device=bullhead,hardware=bullhead,product=bullhead,platformVersionRelease=6.0.1,model=Nexus%205X,buildId=MMB29Q,isWideScreen=0)", "X-Limit-Ad-Tracking-Enabled": False, "X-DFE-Other-Targets": "17,18,19,20,21,22,24,35,56,216,253,295,473,578,580,741,744,748,855,859,862,863,910,1001,1060,12602000,12602001,12602002,12602005,12602007,12602010,12602011,12602020,12602028,12602029,12602036,12602037,12602038,12602039,12602040,12602042,12602044,12602045,12602051,12602052,12602053,12602055,12602056,12602062,12602063,12602064,12602068,12602073,12602098,12602104,12602118,12602121,12602122,12602127,12602129,12602141,12602142,12602143,12602144,12602149,12602150,12602151,12602152,12602313,12602314,12602322,12602350,12602351,12602370,12602377,12602378,12602379,12602430,12602605,12602683,12602787,12602797,12602825,12602826,12602827,12602837,12602993,12603068,12603152,12603387,12603482,12603508,12603509,12603630,12603633,12603729,12603763,12603767,12603790,12603823,12603825,12603930,12603934,12604019,12604095,12604130,12604138,12604158,12604189,12604269,12604286,12604288,12604290,12604292,12604294,12604296,12604298,12604359,12604384,12604484,12604491,12604492,12604494,12604501,12604505,12604530,12604532,12604579,12604592,12604636,12604703,12604988,12605008,12605051,12605359,12605398,12605406,12605505,12605538,12605545,12605550,12605553,12605554,12605559,12605560,12605656,12605657,12605662,12605727,12605739,12605740,12605756,12605766,12605897,12605959,12605984,12605997,12605998,12605999,12606001,12606483,12606488,12606498,12606553,12606554,12606631,12606678,12606679,12606733", "Accept-Language": "en-US", "X-DFE-Filter-Level": 3, "Host": "android.clients.google.com"}
Not sure, with latest commit I can succesfully download that app with this code
test = server.details('com.denite.watchface.diamondelegance')
fl = server.download(test['docId'], test['versionCode'], progress_bar=True)
with open(test['docId'] + '.apk', 'wb') as f:
f.write(fl['data'])
print('\nDownload successful\n')
Output:
[################################] 12192/12192 - 00:00:01
Download successful
Have you tried using another device? Try using the default bacon.
If you want to try it with latest token fix, i'll upload new version in a moment.