2021年3月5日星期五

Error when decompressing base64decode decoded string

So I am working with an API which returns a Base64 gzipped string. When I tried to decompress and decode it with the following code, wich I found online, I got an error.

decoded_data = zlib.decompress(base64.b64decode(data)).decode()

The error is zlib.error: Error -3 while decompressing data: incorrect header check

How can I fix this error?

The String to decode & decompress:

H4sIAAAAAAAAANWX3XLTRhTHNySkjmnJlKEMZWiroUmnGXeJvrWbu8TfNLZD7NhJbpiVdmXLyJZHkoHkCXrTR+CuM3mBPkEehbve9Qk6PbIT6hhDkw50wBey1jp7dM7Z8/vvOo3QEprz0gihhWvomsfn8By6ng2G/XgujeZj1p5DN/b6dijYU2b7Ym4eLZU8Lgo+a0cw6a80+ox70cBnR0toYTsIRQp+XUbfnZ5Y9TgU/Xbc2ZBOT5wMgSv9cWcYCilD1tAPYJANvVjKdljfEWMbRV6dsILRGlo5t8uxHmuf2ZFJMwJWGbDaCvrDSNqMY+Y8leoDIfjYWJ801sEYjZyWBPPHsbGMSaTSzqRLGK6NcsgJV/QjMTajUzncT5I8fxHLKJOxjyMv92Ph+15bnKXIMkS76AOhb05PzMLQ96W6iKVREhtSy4uEtOUHAUcPwM2m7fle7IlI6rBnIvGjrid+rMCV4o5AX8Btj/WZ5ARR/BB8fgU+T0/87XwxX81t7h5IW7Vaoz6PrjuBH4Ro7c8/UmihynoCfQ2Wo2BGr8yFrB30IYogjlAaLedfxCGDkoaePYxFlDp3kNaVDVWXN1RNS6FFO4iiMkcrTFNc4lADG4YlsK5bBFOdEayormkYLrFVU06hdDRgz/uCF8DPiqxS0zJVDeumIFh3uYxtTVgwhVjU4NSwLCeFUr2Ae64nQrQwGCYtthSEXtvrN1gbLW3V6vUnud3aTirpX/Rlq1zPw3izWKs+GaUNqQ6H8GTFcikVpuliRzgQH4VImUEFFpZOiC2rpsYt8B17PRHFrDdAN7V1Y11VJH1Do9JOBaFraHHchyi5T3D5aQoXoAAWu4OSz39B59ZHjs7qFDqKPJMdaZodxdQ+BDzLMN4Jg1g4sQeN20Tfw8RiyPpxNHZrJF+vXv4inUUDjx9+IOjuTkMHd8VytTiTu/uzuNsWbejq9uXRexcYNx/vlbM/P8nubhYaEMWYjtuTdJzHl0afJz0LResJKNw8Sg9elxTyuo5eE2RSIROZ6Vi1hY51C1iiQrMwkakpuKrrpqa8hSBDfwtBmfdM0O1PjCBV1i5H0HT3vx+CbsC4GAbP4w7Q8+AiPVZCj/Pq5W/SOOARPB8TcvemkcuW8vXGzvZmIz8Lum9nQZftQK9CD8Xi6jse4Y5g3NSx68gO7GGWiZktNGwQVSjcch2u8akdz3BlrlFZB0PCsO6oNrZNAheiU9fRTEoM92o73p1Jpv8pwL9RPY8W26N1v4i45UDojFNMHZVjnSgGphqTsWCqSR2ZEEtWLyC+rK1rCeKKuqGa0uZMxn99B+NvQp2uP4U+qUHJQsgwqbOtORZlJsOKrDGsaY6LCRMqNixqqapp6FSjMA/aciDCpIGWUCoWL2IoXZScbedgHZvMHwr0uzh6JB/ud2S+/8h3jsomjBt12a+VuwPgpXlkZ8tmuQfPS1vHNY8848WmzkvNo8P9ytBu+cPDVvXooHUob/cMn2fpa1/bx3tarcG71WPePVCbfkWtPK8WK8eHxaZ/mHO0Sm7PqLaanVqu6h80Cn4tt9uttfJytVs2DrqOUlELvWrr8XG1UehWitVupVHoVI8fe+6+QiGDmVJ39xOTOsW4pNRpV5K61ZlS94aT/03rQKZooxOE/Ugql8ujNTqbwxJzY1R9yxktiBQHI6ehsIEPnjynq2eSx0dLIfEknuR0YdlJyVmcaCF8JQsgwg8lrXempbWU367kG+dSem+WlJaE3xPxTBm98knl1qSqjd/9hqItxqMqJyJyWXljssqJTW1MZWJh3XZA6CxBsWMIbsO/AdMklz7BzCP0N6dM36tADwAA

https://stackoverflow.com/questions/66501364/error-when-decompressing-base64decode-decoded-string March 06, 2021 at 08:59AM

没有评论:

发表评论