I am trying to download a file from github, but I am getting inconsistent sizes than if I download the raw file from github, I am using the download_url that I get from the directory listing from github. My code is:
async function getWaveDataFile(url) {
try {
const token = 'github_pat_personal-acess-token';
const instance = axios.create({
baseURL: url,
timeout: 5000,
headers: { Authorization: 'token ' + token },
});
console.log("axios Created BaseURL", instance.defaults.baseURL);
const res = await instance.get();
return res.data;
} catch (err) {
console.error('GG', err);
}
}
I get binary data result from this, but if I save it to a file the size is inconsistent with a manual file download.
Any help with this would be much appreciated