Private Server Down Detector
It's an open-source internal tool for Metin2dev, not for private servers.
[Hidden Content]
This tool is scanning the entire database.json file, which contains all topics in the private servers category, along with their associated content.
The topic post is HTML code which is checked with a regex to find all valid hrefs links, as well as ignoring those in the 'ignored urls.json' file to avoid making unnecessary requests.
The links are then tested with a HEAD request to determine whether or not the server is online.
This will allow us to get rid of the servers that are no longer operational and tidy up the relevant forum category.
Topics without URLs will be archived immediately.
The output features are still being worked on, but the tool is fully functional:
[x] Quickly generating a graph of the server statistics:
[x] Offline
[x] Online
[x] Unknown (no urls) (TODO)
[x] Generating a custom output file with the results of the scan.
[x] Constructing an automatic query to move offline servers to the archive category.
How to use
Clone the repository
git clone [Hidden Content].git
Install the latest version of Python, 3.11 or higher.
Install virtual environment:
# Install virtualenv
py -3 -m venv venv
# Activate virtualenv (Windows)
./venv/scripts/activate
# Activate virtualenv (Linux)
source ./venv/bin/activate
# Install the requirements
pip install -r requirements.txt
Available command line arguments (optional)
--version - Show the version of the script
--help - Show help message with available arguments
--input - JSON database file default: database.json
--output - Output path directory default: ./output
--exclude - JSON excluded urls file default: ignored_urls.json
--timeout - Timeout for HTTP requests default: None (wait until the request is finished)
--logging - Enable console output default = True
--domain - URL of the topic forum's domain default = [Hidden Content]
--threads - The maximum number of threads that can be used for parallel processing default = None (all available threads)
Run the script via the command line:
python main.py --input ./database.json
Namespace(input='database.json', output='output', exclude='ignored_urls.json', timeout=None, logging=False, threads=None, domain='[Hidden Content]')
You can also run the script from your preferred IDE, such as PyCharm or VSCode and it will use the default arguments.
How to contribute
Fork the repository
Create a new branch
Make your changes
Create a pull request
Wait for the review
Author
Vegas007
License