Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example in config.js doesn't work #115

Open
Ravencentric opened this issue Aug 22, 2023 · 2 comments
Open

Example in config.js doesn't work #115

Ravencentric opened this issue Aug 22, 2023 · 2 comments

Comments

@Ravencentric
Copy link
Contributor

I'm talking about this example

Steps to reproduce

  1. Uncomment this example
  2. Comment this
  3. Run nyuu -h abc.provider.com -S -u user -p password-n40 -k10 -g alt.binaries.boneless "folder with mkv files"

Current behavior

No NZB output

What am I trying to achieve?

I'm trying to provide a folder of mkv files as an input and have nyuu generate one nzb for each set of mkv+par2 files

When the example didn't work, I also tried to edit (below) but to no avail

nzb: function(filenum, filenumtotal, filename, filesize) {
    let baseFileName;

    // Split the filename by periods
    const parts = filename.split('.');
    
    // If it's an .mkv file, use everything before the last period as the base file name
    if (filename.endsWith('.mkv')) {
        baseFileName = parts.slice(0, -1).join('.');
    } 
    // If it's a .par or .par2-related file, look for ".vol" to determine the base file name
    else if (filename.includes('.vol') && filename.endsWith('.par2')) {
        const volIndex = filename.indexOf('.vol');
        baseFileName = filename.substring(0, volIndex);
    } 
    // For base .par2 files
    else if (filename.endsWith('.par2')) {
        baseFileName = parts.slice(0, -1).join('.');
    } 
    else {
        return;  // If the file doesn't match the expected patterns, do not add to any NZB
    }

    return [
        baseFileName,
        {
            writeTo: baseFileName + '.nzb',  // Each group will have its own NZB file named after the base filename
            writeOpts: {flags: 'w'}
        }
    ];
},
animetosho added a commit that referenced this issue Aug 23, 2023
@animetosho
Copy link
Owner

Thanks for reporting.
Am I getting the same thing as you? I get a crash, which I've fixed, but not a successful run without an NZB.

@Ravencentric
Copy link
Contributor Author

Ravencentric commented Aug 25, 2023

My first run was successful with no NZB but that's likely because config.js wasn't being used. I re-ran it with the config specified and it crashed. I'll test again and get back to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants