jszip icon indicating copy to clipboard operation
jszip copied to clipboard

TradingView webhook returns a base64 encoded “zip file”? I need to decode it in python

Open dejoski opened this issue 3 years ago • 2 comments

In my python script, TradingView webhook returns a base64 encoded "zip file" during the first data webhook.

When I add a study, returns a variable called dataCompressed which has a base64 string that I need the contents of: https://gist.github.com/dejoski/fe62c9e704d57bfcc712ffd8d2b1e879

I was able to read the data by using a javascript library called jszip. See the code below, it seems pretty simple and it works.

(obviously replace the variable dataCompressed with the base64 string from pastebin.)

(async() => { var JSZip = require("jszip"); var zip = new JSZip(); var dataCompressed = "UEsDBBQACAgIAA..." var x = zip.loadAsync(dataCompressed,{base64: !0}); var data = await x console.log(data) })() I have tried many simple python codes and some online base64 to zip file services and I am still only able to read the data by using the javascript code.

dejoski avatar Jul 01 '21 01:07 dejoski

Hi! did you managed to do the decompresion?

guilledp avatar Jun 09 '23 18:06 guilledp