rndme/download

Issue with mp4 download and filename parameter

Opened this issue · 2 comments

When I download an mp4 with only a single parameter all is good:
download(highestQuality);
If I add a filename parameter it downloads a text file with the URL as the contents:

downloadName = videoName + '.mp4';
download(highestQuality,downloadName);

I tried using a static string for the name and added the mimetype, but neither helped.

Am I misunderstanding something, or is this a limitation?
Thanks-
Matt

Have you sorted this out? or not?

Have you found a solution for this? I have the same issue. when fileName is provided, a blob is created with the url and that is what it's being download. I ended up adding this

if (!(payload instanceof myBlob)){
    anchor.href = payload;
    if(anchor.href.indexOf(payload) !== -1) {
        return saver(payload);
    }
}

after

if(/([\x80-\xff])/.test(payload)){
    .
    .
    .
}

I'm not 100% sure this doesn't break something else as I don't know when we would need to create a blob. You can see the change in the pull request #78