boranblok / nntpPoster

A utility to post files and folders to usenet.
67 stars 14 forks source link

example form request #58

Open jaykae89 opened 4 years ago

jaykae89 commented 4 years ago

hi do you have a example form that will except the nzb file using the nzbpost notification feature?

i have newznab but unsure on what i need to add to receive the .nzb file using that nzbpost feature on your script

boranblok commented 4 years ago

Good question,

This feature is entirely untested due to lack of a test form in the first place. I just assumed standard http form logic.

In essence if you have a http page with a form with input field "nzbfile" for the nzb and "apikey" for the api key. And that form posts to http://api.test.com/nzbSubmit

then the parameters would look like this:

NotificationType=NzbPost
ObfuscatedNotificationUrl=http://api.test.com/nzbSubmit
NzbPostFilenameParam=nzbfile
NzbPostExtraParams="apikey=apikeyvalue"

Do note that once you have a working series of parameters you can easily distribute these settings to uploaders of your indexer by making an ini file that contains these settings. As long as it is alphabetically later than the standard settings this will overwrite other settings. (Like 99_indexerSetup.ini for example)

AdPatat commented 4 years ago

Hi there,

Just letting you know: The previous version (0.12) worked with a free account on https://nzbfinder.ws and its API.

Thanks for the great program boranblok, works great on my syno NAS.

AdPatat commented 4 years ago
[Indexer]
## enter your API key that is used for the indexer here. Then you can use ${ApiKey} in the urls below
ApiKey=32 digit apivalue
## Method used to notify the index of the new upload.
## Supported values are 'NewznabHash' which uses the newznab Method (default)
## or 'NzbPost' which sends the nzb file to the notification url.
NotificationType=NewznabHash

## API url that is used to notify the indexer of an obfuscated release.
## The following two parameters will be replaced:
##   {0} by the obfuscated name of the file/folder
##   {1} by the original name of the file/folder
##   optionally ${ApiKey} will be replaced by the value entered above
ObfuscatedNotificationUrl=https://nzbfinder.ws/?hash={0}&name={1}&apikey=${ApiKey}

## Method used to verify that the upload was placed on the index.
## Supported values are 'NewznabSearch' which uses the newznab method (default)
## 'PostVerify' which uses a custom post verification method.
## or 'Dummy' which always considers an upload as successful and therefore cleans up the backup folder after VerifierIntervalMinutes
VerificationType=PostVerify

## API url that is used to search the indexer.
## The following two parameters will be replaced:
##   {0} by the search query
##   {1} by the age + 1 of the post in days
##   optionally ${ApiKey} will be replaced by the value entered above
SearchUrl=https://nzbfinder.ws/?t=search&q={0}&maxage={1}&apikey=${ApiKey}

EDIT: Formatted it as code for readability.

jaykae89 commented 4 years ago

thanks for your reply boranblok

to confirm does the nzbpost send the .nzb to the web hosting form or does it send the .nzb contents (xml in plain text) then the site has to save it as a .nzb file?

AdPatat commented 4 years ago

Hi jaykae89

I've no idea but after filling in the above everyting becoms after posting it to usenet in the backupfolder, and not in the posting_failed folder so i think its oke for now.

GrTz AdPatat

boranblok commented 4 years ago

jaykae89 the nzb is sent as a file, the upload form must contain a file input field (usually these have a browse button etc). The saving as nzb file on the site's end is entirely their responsibility.

boranblok commented 4 years ago

AdPatat using PostVerify with NewznabHash is kind of a weird combination. PostVerify is a specific implementation used by one certain indexer, so the chances that nzbfinder implements this protocol correctly is rather slim, it makes more sense to use NewznabSearch verification method in this case. Your search url looks correct for this method by the way.

ghost commented 4 years ago

Just found this. NZB Finder does not support the uploading of NZBs by it's users.