python-transloadit
python-transloadit copied to clipboard
JSONDecodeError: Extra data in json.loads
In the response from TransloadIt, we get:
'9fd\r\n{"ok":"ASSEMBLY_EXECUTING","message":"The assembly is currently being executed.","assembly_id":"6d4792703d6011e582c053c1511679dc","parent_id":null,"account_id":"11e55caee7f54b2d981dcb123508cdf4","template_id":"8eede6c62a854cad8ad41cfdb4a7e467","instance":"darian.transloadit.com","assembly_url":"http://api2.darian.transloadit.com/assemblies/6d4792703d6011e582c053c1511679dc","assembly_ssl_url":"https://darian.transloadit.com/assemblies/6d4792703d6011e582c053c1511679dc","bytes_received":599,"bytes_expected":599,"upload_duration":3.225,"client_agent":null,"client_ip":"10.159.9.211","client_referer":null,"start_date":"2015/08/08 00:00:06 GMT","is_infinite":false,"has_dupe_jobs":false,"execution_start":"2015/08/08 00:00:09 GMT","execution_duration":0.001,"notify_start":null,"notify_url":null,"notify_status":null,"notify_response_code":null,"notify_duration":null,"last_job_completed":null,"fields":{},"running_jobs":[],"bytes_usage":0,"executing_jobs":[":original"],"started_jobs":[":original:::original"],"parent_assembly_status":null,"params":"{\\"steps\\":{\\":original\\":{\\"url\\":\\"https://cashstar-faceplates-upload.s3.amazonaws.com/87/0381203d5011e58620c373c2e1aff3/egift-card.jpg\\",\\"robot\\":\\"/http/import\\"}},\\"template_id\\":\\"8eede6c62a854cad8ad41cfdb4a7e467\\",\\"auth\\":{\\"expires\\":\\"2015/08/08 19:59:01\\",\\"key\\":\\"****\\"}}","template":"{\\"steps\\":{\\"convert\\":{\\"robot\\":\\"/image/resize\\",\\"width\\":\\"650\\",\\"height\\":\\"296\\",\\"format\\":\\"jpg\\",\\"strip\\":true,\\"zoom\\":true,\\"resize_strategy\\":\\"stretch\\"},\\"full\\":{\\"use\\":\\"convert\\",\\"robot\\":\\"/image/resize\\",\\"width\\":\\"650\\",\\"height\\":\\"296\\"},\\"preview\\":{\\"use\\":\\"convert\\",\\"robot\\":\\"/image/resize\\",\\"width\\":\\"450\\",\\"height\\":\\"205\\"},\\"cropped\\":{\\"use\\":\\"convert\\",\\"robot\\":\\"/image/resize\\",\\"resize_stragey\\":\\"crop\\",\\"crop\\":{\\"x1\\":0,\\"y1\\":0,\\"x2\\":415,\\"y2\\":296}},\\"carousel\\":{\\"use\\":\\"cropped\\",\\"robot\\":\\"/image/resize\\",\\"width\\":\\"158\\",\\"height\\":\\"112\\",\\"zoom\\":true,\\"resize_strategy\\":\\"stretch\\"},\\"thumb\\":{\\"use\\":\\"cropped\\",\\"robot\\":\\"/image/resize\\",\\"width\\":\\"75\\",\\"height\\":\\"53\\",\\"zoom\\":true,\\"resize_strategy\\":\\"stretch\\"},\\"mobile\\":{\\"use\\":\\"cropped\\",\\"robot\\":\\"/image/resize\\",\\"resize_stragey\\":\\"stretch\\",\\"width\\":\\"251\\",\\"height\\":\\"175\\"},\\"export\\":{\\"use\\":[\\"full\\",\\"preview\\",\\"carousel\\",\\"thumb\\",\\"mobile\\"],\\"robot\\":\\"/s3/store\\",\\"key\\":\\"****\\",\\"secret\\":\\"****\\",\\"bucket\\":\\"cashstar-faceplates-upload\\",\\"url_prefix\\":\\"https://cashstar-faceplates-upload.s3.amazonaws.com/\\"}}}","uploads":[],"results":{}}\r\n0\r\n\r\n'
and the extra characters at the beginning and end of the response data cause the function to blow up when the data gets loaded within the transloadit library using json.loads().
Any progress on this? We also get the same error.
I have a PR out to fix this.