animetosho / Nyuu

Flexible usenet binary posting tool
226 stars 33 forks source link

Obfuscation #10

Closed ghost closed 8 years ago

ghost commented 8 years ago

Is it possible to automatically rename the source files & rar's to a hashed string while using the original filename as the filename of the NZB?

This will prevent takedowns but the indexer where the NZB is uploaded to will still know what the content is by using the filename of the NZB.

Also, I may be stupidly blind but this doesn't take care of creating split RAR files for the files right? I need to do that myself?

animetosho commented 8 years ago

It's possible to modify the config to do this, but as this is non-standard, you'll need to explicitly say how it exactly should be done.

In the .js config file (i.e. config.js) there are two lines that look something like Subject: null, - the one under postHeaders: refers to the Subject header that is sent to the NNTP server, whilst the one under nzb: and overrides: refers to the subject that is recorded in the NZB. By default, Nyuu copies the Subject header from the first posted article into the NZB (as per specification) so to have the original file name here, you'll need to override both settings.

For example, if you want to MD5 hash the filename that is sent to the server, use the following subject for postHeaders:

Subject: function(filenum, filenumtotal, filename, size, part, parts, chunkSize) {
    return '[' + filenum + '/' + filenumtotal + '] - "' +
        require('crypto').createHash('md5').update(filename).digest('hex') +
        '" yEnc (' + part + '/' + parts + ') ' + size;
},

Then to restore the correct header in the NZB, use this subject (note that this is "subject", not "Subject"):

subject: function(header_value, filenum, filenumtotal, filename, size, parts) {
    return '[' + filenum + '/' + filenumtotal + '] - "' +
        filename.replace(/"/g, '') +
        '" yEnc (1/' + parts + ') ' + size;
},

Nyuu does not create or split archives. You can create a simple batch/shell script to do this though.

ghost commented 8 years ago

Cheers! Will take a stab at it.