sealedtx / java-youtube-downloader

Simple, almost zero-dependency java parser for retrieving youtube video metadata
Other
426 stars 116 forks source link

output file naming bug #56

Closed 3yong2ya closed 4 years ago

3yong2ya commented 4 years ago

thank you for your program!

java.io.FileNotFoundException

com/github/kiulian/downloader/model/Utils.java

static File getOutputFile(final String name, Format format, File outDir, boolean overwrite) { String fileName = removeIllegalChars(name) + "." + format.extension().value(); File outputFile = new File(outDir, fileName);

    if (!overwrite) {
        int i = 1;
        while (outputFile.exists()) {
            fileName = name + "(" + i++ + ")" + "." + format.extension().value();
            ===>> fileName = removeIllegalChars(name) + "(" + i++ + ")" + "." + format.extension().value();
            outputFile = new File(outDir, fileName);
        }
    }

    return outputFile;
}
sealedtx commented 4 years ago

@3yong2ya Hi, thank you very much! Fixed in https://github.com/sealedtx/java-youtube-downloader/commit/6b2f21d3dd3ed92a7de2a68e5512ea674a51587a This patch will be included in the next release. Let me know if this fix is critical for you, so I draft a release sooner.