Code Monkey home page Code Monkey logo

Comments (6)

Epicpkmn11 avatar Epicpkmn11 commented on August 22, 2024

Hmm yeah that seems smart, if you make a PR adding it I'll probably merge it, otherwise I can give it a try sometime soon. Note that it seems not all servers set the Content-Disposition so make sure that it can fall back to parsing the link if you PR it. (Tried a couple on U-DB and NitroHax's zip doesn't seem to have it)

from dsidl.

awkitsune avatar awkitsune commented on August 22, 2024

First, I need to figure out how and where exactly DSi Downloader parsing filename
Second, Header can be a primary option and parsing from url can be fallback option if header doesn't exists

from dsidl.

Epicpkmn11 avatar Epicpkmn11 commented on August 22, 2024

if(fileName == "") {
// Trim URL to just file name
std::string fileName = url.substr(url.find_last_of('/') + 1);
fileName = fileName.substr(0, fileName.find('?'));
fileName = fileName.substr(0, fileName.find('#'));
// Ask user to pick folder and ensure name is good
path = selectDir();
if(path == "")
return;
fileName = selectFile(fileName);
if(fileName == "")
return;
path += fileName;

It does that before the download so it'll require a bit of reworking to be able to get the headers first, might be best to just do a HEAD request, have the user check the file name, then do the actual download.

from dsidl.

awkitsune avatar awkitsune commented on August 22, 2024

Actually a good way, I will try to figure it out and make a pull request

from dsidl.

awkitsune avatar awkitsune commented on August 22, 2024

No chances of me doing it, my C knowledge is so poor

from dsidl.

awkitsune avatar awkitsune commented on August 22, 2024

Now my program doing both filename in link and in header, so issue is closed

from dsidl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.