NZBGet MySQL Extension Script
I wrote a simple plugin for NZBGet that inserts download history into a MySQL database. Having my download list in a database makes operations on the data easier than groking text logs.
I wanted to display my most recent downloads on a Grafana Dashboard:
To use simply copy the Mysql-Log.py
script into your NZBGet/scripts directory. In NZBGet, select settings and set the hostname of your MySQL instance.
You can download the plugin on github
This Plugin for NZBGet inserts a record into a user specified MySQL database. It requires these configuration options:
- hostname of the MySQL server
- MySQL port (optional)
- MySQL username
- MySQL password
- mysql database name
- table to insert records into
The script is written in python and requires the pymsql
module: sudo pip install pymysql
The purpose of this script is to allow you to create a dashboard or other reporting around your downloads. You can search or group by name or timestamp to create summaries, aggregate peak download times, or whatever you want to gauge.
Fell free to submit improvements with a Pull Request (PR) or fork the project. I’m new to Python and there is a lot of room for improvement in this extension script.
Installation:
Download and copy the Mysql-Log.py
file from this repo into your NZBGet/scripts
directory. Alternatively, you can clone this repo directly into the /scripts/ directory:
1 | # This directory will be where YOUR NZBGet installation is |
Usage:
In NZBGet go into Settings
and at the bottom left you should see MYSQL-LOG
:
Add the hostname of your MySQL server and optionally the port number (default is 3306), a username and password for the mysql server, the name of the database and the table to insert the download names into.
After this, click on CATEGORIES
, click Choose
and select which extensions you’d like to enable for that Category:
If configured properly, after a download you’ll see lines like this in your NZBGet Messages
:
Roadmap:
- Separate Show Name, Episode Name, Season and Episode info, Quality and Crew into separate columns in the DB.
Technology Used: | ||
---|---|---|
NZBGet MySQL Extension Script