634 |
635 | This program is free software: you can redistribute it and/or modify
636 | it under the terms of the GNU Affero General Public License as published
637 | by the Free Software Foundation, either version 3 of the License, or
638 | (at your option) any later version.
639 |
640 | This program is distributed in the hope that it will be useful,
641 | but WITHOUT ANY WARRANTY; without even the implied warranty of
642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
643 | GNU Affero General Public License for more details.
644 |
645 | You should have received a copy of the GNU Affero General Public License
646 | along with this program. If not, see .
647 |
648 | Also add information on how to contact you by electronic and paper mail.
649 |
650 | If your software can interact with users remotely through a computer
651 | network, you should also make sure that it provides a way for users to
652 | get its source. For example, if your program is a web application, its
653 | interface could display a "Source" link that leads users to an archive
654 | of the code. There are many ways you could offer source, and different
655 | solutions will be better for different programs; see section 13 for the
656 | specific requirements.
657 |
658 | You should also get your employer (if you work as a programmer) or school,
659 | if any, to sign a "copyright disclaimer" for the program, if necessary.
660 | For more information on this, and how to apply and follow the GNU AGPL, see
661 | .
662 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # nzbCheck
2 | command line tool to check nzb files:
3 | - First inside the nzb to see if each files has the expected number of Articles (following yEnc format for the subject of the files)
4 | - then we check their availability on Usenet using the [NNTP Stat command](https://tools.ietf.org/html/rfc3977#section-6.2.4).
5 |
6 | Implemented in C++11/Qt5, nzbCheck is released for Linux, Windows, MacOS and RPI.
7 |
8 | /!\ It is only checking if the Articles are available, there is no CRC check => some of them might be corrupted /!\
9 |
10 | ### Usage :
11 |
12 | Syntax: nzbcheck (options)* -i <nzb file>
13 | --help : Help: display syntax
14 | -v or --version : app version
15 | --progress : display progress bar
16 | -d or --debug : display debug information
17 | -q or --quit : quiet mode (no output on stdout)
18 | -i or --input : input file : nzb file to check
19 |
20 | // you can provide servers in one string using -S and/or split the parameters for ONE SINGLE server
21 | -S or --server : NNTP server following the format (<user>:<pass>@@@)?<host>:<port>:<nbCons>:(no)?ssl
22 | -h or --host : NNTP server hostname (or IP)
23 | -P or --port : NNTP server port
24 | -s or --ssl : use SSL
25 | -u or --user : NNTP server username
26 | -p or --pass : NNTP server password
27 | -n or --connection : number of NNTP connections
28 |
29 | Examples:
30 | - nzbcheck --progress -S "user:password@@@news.usenetserver.com:563:50:ssl" -i /nzb/myNzbFile.nzb
31 | - nzbcheck --quiet -h news.usenetserver.com -P 563 -u user -p password -n 50 -s -i /nzb/myNzbFile.nzb
32 |
33 |
34 | ### Output:
35 | number of missing Articles (or negative value if any syntax error or parsing issue)
36 |
37 | ### How to build
38 | #### Dependencies:
39 |
40 | build-essential (C++ compiler, libstdc++, make,...)
41 | qt5-default (Qt5 libraries and headers)
42 | qt5-qmake (to generate the moc files and create the Makefile)
43 | libssl (v1.0.2 or v1.1) but it should be already installed on your system
44 |
45 | #### Build:
46 |
47 | go to the src folder
48 | qmake
49 | make
50 |
51 | Easy! it should have generate the executable **nzbcheck**
52 | you can copy it somewhere in your PATH so it will be accessible from anywhere
53 |
54 | As it is made in C++/QT, you can build it and run it on any OS (Linux / Windows / MacOS / Android)
55 | releases have only been made for Linux x64 and Windows x64 (for 7 and above) and MacOS
56 | in order to build on other OS, the easiest way would be to [install QT](https://www.qt.io/download) and load the project in QtCreator
57 |
58 | ### Donations
59 | I'm Freelance nowadays, working on several personal projects, so if you use the app and would like to contribute to the effort, feel free to donate what you can.
60 |
61 |
62 | or in Bitcoin at this address: **3BGbnvnnBCCqrGuq1ytRqUMciAyMXjXAv6**
63 |
64 |
--------------------------------------------------------------------------------
/nzbCheck.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Type=Application
3 | Name=nzbCheck
4 | Exec=nzbcheck %F
5 | Icon=nzbCheck
6 | Comment=Test nzb files using the Nntp Stat command
7 | Terminal=true
8 | Categories=Network;
9 | X-AppImage-Version=
10 |
--------------------------------------------------------------------------------
/nzbCheck.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mbruel/nzbCheck/93cdd57e6d38373c94cecad67a9addf48de30030/nzbCheck.png
--------------------------------------------------------------------------------
/src/.gitignore:
--------------------------------------------------------------------------------
1 | nzbCheck.pro.user
2 | .qmake.stash
3 | *.o
4 | Makefile
5 | nzbcheck
6 | moc_*.cpp
7 | moc_predefs.h
8 | qrc_resources.cpp
9 |
--------------------------------------------------------------------------------
/src/Nntp.cpp:
--------------------------------------------------------------------------------
1 | //========================================================================
2 | //
3 | // Copyright (C) 2019 Matthieu Bruel
4 | //
5 | // This file is a part of ngPost : https://github.com/mbruel/ngPost
6 | //
7 | // ngPost is free software; you can redistribute it and/or modify
8 | // it under the terms of the GNU Lesser General Public License as
9 | // published by the Free Software Foundation; version 3.0 of the License.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser General Public License for more details.
15 | // You should have received a copy of the GNU Lesser General Public
16 | // License along with this program; if not, write to the Free Software
17 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
18 | // USA.
19 | //
20 | //========================================================================
21 |
22 | #include "Nntp.h"
23 |
24 | const std::map Nntp::sResponses = {
25 | {0, "000 UNKNOWN NNTP RESPONSE..."},
26 |
27 | //rfc977: 2.4.3 General Responses
28 | {200, "200 server ready - posting allowed"},
29 | {201, "201 server ready - no posting allowed"},
30 |
31 | {400, "400 service discontinued"},
32 | {500, "500 command not recognized"},
33 | {501, "501 command syntax error"},
34 | {502, "502 access restriction or permission denied"},
35 | {503, "503 program fault - command couldn't perform"},
36 |
37 |
38 | //rfc977: 3.2.2 The GROUP command
39 | {211, "211 "},
40 | {411, "411 no such news group"},
41 |
42 |
43 | //rfc977: 3.10.2 The POST command
44 | {240, "240 article posted ok"},
45 | {340, "340 send article to be posted. End with ."},
46 | {440, "440 posting not allowed"},
47 | {441, "441 posting failed"},
48 |
49 |
50 | //rfc977: 6.2.4. STAT
51 | {223, "223 0|n message-id Article exists"},
52 | {430, "430 No article with that message-id"},
53 |
54 |
55 | //rfc977: 3.11.2 The QUIT command
56 | {205, "205 closing connection - goodbye!"},
57 |
58 |
59 | //rfc4643: 2.3.1
60 | {281, "281 Authentication accepted"},
61 | {380, "380 More Authentication Required"},
62 | {381, "381 Password required"},
63 | {480, "480 Authentication Required"},
64 | {481, "481 Authentication failed/rejected"},
65 | {482, "482 Authentication commands issued out of sequence"},
66 | };
67 |
68 | const char * Nntp::getResponse(unsigned short aCode){
69 | try {
70 | return sResponses.at(aCode);
71 | } catch (const std::out_of_range &ex) {
72 | return sResponses.at(0);
73 | }
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/src/Nntp.h:
--------------------------------------------------------------------------------
1 | //========================================================================
2 | //
3 | // Copyright (C) 2019 Matthieu Bruel
4 | //
5 | // This file is a part of ngPost : https://github.com/mbruel/ngPost
6 | //
7 | // ngPost is free software; you can redistribute it and/or modify
8 | // it under the terms of the GNU Lesser General Public License as
9 | // published by the Free Software Foundation; version 3.0 of the License.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU Lesser General Public License for more details.
15 | // You should have received a copy of the GNU Lesser General Public
16 | // License along with this program; if not, write to the Free Software
17 | // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
18 | // USA.
19 | //
20 | //========================================================================
21 |
22 | #ifndef NNTP_H
23 | #define NNTP_H
24 |
25 | #include "PureStaticClass.h"
26 | #include