Giter VIP home page Giter VIP logo

Comments (8)

get-got avatar get-got commented on August 16, 2024

@macarooni-man Can you give me an example filename it would have, so I can try and replicate it for testing?

It only uses InvalidFilename if it doesn't detect the input as a filename with regex, so it's weird that it's doing that.

from discord-downloader-go.

macarooni-man avatar macarooni-man commented on August 16, 2024

Yeah for sure, I'll give a more detailed description. So essentially the file type I am using is a preset file for a VST plugin, it just loads the settings of the synth with a list in a text file with the extension ".vital". I modified the source code of the original program to allow it to download the patch from discord and it did the same thing with that one too. Here's what is happening with my modified version of the original;

pic 1

pic 2

With your version;

pic 3

pic 4

It's interesting because it saves the file in a working state. I wrote a PowerShell script that loops in the output folder to change the file extension while that program is open and the presets work, it's just that the name isn't saved (so jank LOL). But anyway I read through the code and it looks like the issue lies somewhere around line ~1020. I am not new to programming but I have no idea how to use golang syntax haha. Thanks for your help.

from discord-downloader-go.

macarooni-man avatar macarooni-man commented on August 16, 2024

I believe I have fixed it, I took a peek into the regex file and I found this;
REGEXP_FILENAME = ^^[^/\\:*?"<>|]{1,150}\.[A-Za-z0-9]{2,4}$$

The last part {2,4} I guessed that it was a limit for the file extension in characters and voila I bumped the 4 up to 5 and it works fine. I don't know how many file extensions actually have 5 characters but maybe it's something to consider.

from discord-downloader-go.

get-got avatar get-got commented on August 16, 2024

@macarooni-man So changing the max to 5 completely fixed your issue?

from discord-downloader-go.

macarooni-man avatar macarooni-man commented on August 16, 2024

Yeah for sure

from discord-downloader-go.

get-got avatar get-got commented on August 16, 2024

Glad you figured it out! I changed it to 2,5 for the next release.

from discord-downloader-go.

Hackebein avatar Hackebein commented on August 16, 2024

I just hit the same problem. I would recommend to completely remove the limits for file extensions because file extensions doesn't follow any pattern.
Here is a list of many known file extensions: https://en.wikipedia.org/wiki/List_of_filename_extensions
Here some examples for common file extension:

.c--/.h--
.c++/.h++
.dochtml/.docmhtml/.dothtml
.torrent
.unitypackage
.vbox-extpack

from discord-downloader-go.

get-got avatar get-got commented on August 16, 2024

I just hit the same problem. I would recommend to completely remove the limits for file extensions because file extensions doesn't follow any pattern.
Here is a list of many known file extensions: https://en.wikipedia.org/wiki/List_of_filename_extensions
Here some examples for common file extension:

.c--/.h--
.c++/.h++
.dochtml/.docmhtml/.dothtml
.torrent
.unitypackage
.vbox-extpack

5559230

from discord-downloader-go.

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.