Stuk / jszip

Create, read and edit .zip files with Javascript
https://stuk.github.io/jszip/
Other
9.82k stars 1.3k forks source link

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

Open dejoski opened 3 years ago

dejoski commented 3 years ago

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.

guilledp commented 1 year ago

Hi! did you managed to do the decompresion?

noragalvin commented 7 months ago

I got the same message. any updates?