From d97ac60b8ed940f8a57cecdb801b344a99e11421 Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 1 Apr 2021 11:51:29 -0400 Subject: [PATCH 1/3] update docs --- README.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++---- qbit_manage.py | 8 ++++--- 2 files changed, 62 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f64724d..9cb4843 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,59 @@ -# qbit_manage -Still a heavy WIP, but have fun. -A lot of influence came from https://github.com/bobokun/Qbittorrent-Scripts +# qBit Management +This is a program used to manage your qBitorrent instance such as: +* Tag torrents based on tracker URL (only tag torrents that have no tags) +* Update categories based on save directory +* Remove unregistered torrents (delete data & torrent if it is not being cross-seeded, otherwise it will just remove the torrent) +* Automatically add [cross-seed](https://github.com/mmgoodnow/cross-seed) torrents in paused state (used in conjunction with the [cross-seed](https://github.com/mmgoodnow/cross-seed) script) +* Recheck paused torrents sorted by lowest size. Resume if completed. +## Installation -Wiki and proper README coming soon. +#### Unraid Installation: +* [Guide to setup on Unraid](https://github.com/StuffAnThings/qbit_manage/wiki/qBit-Manager-on-unRAID) +#### Local Installation: +* Requires `python 3`. Dependencies must be installed by running: +``` +pip install -r requirements.txt +``` +If there are issues installing dependencies try: +``` +pip install -r requirements.txt --ignore-installed +``` + +## Usage +To run the script in an interactive terminal run: +* copy the `config.yml.sample` file to `config.yml` +* add your qBittorrent host, user and pass. If you are not using a username and password you can remove the `user` and `pass` lines. +* add your `cross_seed` and `root_dir`. If you are using a docker container you must fill out `remote_dir` as well. +* Add your categories and save path to match with what is being used in your qBitorrent instance. I suggest using the full path when defining `save_path` +* Add the `tag` definition based on tracker URL +* To run the script in an interactive terminal with a list of possible commands run: +``` +python qbit_manage.py -h +``` + +## Commands +| Name | Shell Command | Description | Default Value | +| :----------- | :------------ | :------------ | :------------ | +| Config | `-c CONFIG` or `--config-file CONFIG` | This is used if you want to use a different name for your config.yml. `Example: tv.yml` | config.yml | +| Log File| `-l LOGFILE,` or `--log-file LOGFILE,` | This is used if you want to use a different name for your log file. `Example: tv.log` | activity.log | +| Manage| `-m` or `--manage` | Use this if you would like to update your tags, categories, remove unregistered torrents, AND recheck/resume paused torrents. | | +| Cross-Seed| `-s` or `--cross-seed` | Use this after running [cross-seed script](https://github.com/mmgoodnow/cross-seed) to add torrents from the cross-seed output folder to qBittorrent | | +| Recheck| `-re` or `--recheck` | Recheck paused torrents sorted by lowest size. Resume if Completed. | | +| Update Category| `-g` or `--cat-update` | Use this if you would like to update your categories. | | +| Add Tags| `-t` or `--tag-update` | Use this if you would like to update your tags. (Only adds tags to untagged torrents) | | +| Remove Unregistered Torrents| `-r` or `--rem-unregistered` | Use this if you would like to remove unregistered torrents. (It will the delete data & torrent if it is not being cross-seeded, otherwise it will just remove the torrent without deleting data) | | +| Remove Orphaned Data| `-ro` or `--rem-orphaned` | Use this if you would like to remove orphaned files from your `root_dir` directory that are not referenced by any torrents. It will scan your `root_dir` directory and compare it with what is in Qbitorrent. Any data not referenced in Qbitorrent will be moved into `/data/torrents/orphaned_data` folder for you to review/delete. | | +| Dry-Run | `--dry-run` | If you would like to see what is gonna happen but not actually move/delete or tag/categorize anything. | | +| Log Level | `--log LOGLEVEL` | Change the ouput log level. | INFO | + +### Config +To choose the location of the YAML config file +``` +python qbit_manage.py --config-file +``` +### Log +To choose the location of the Log File +``` +python qbit_manage.py --log-file +``` \ No newline at end of file diff --git a/qbit_manage.py b/qbit_manage.py index 478b182..cd2043a 100644 --- a/qbit_manage.py +++ b/qbit_manage.py @@ -51,7 +51,7 @@ parser.add_argument('-t', '--tag-update', dest='tag_update', action='store_const', const='tag_update', - help='Use this if you would like to update your tags.') + help='Use this if you would like to update your tags. (Only adds tags to untagged torrents)') parser.add_argument('-r', '--rem-unregistered', dest='rem_unregistered', action='store_const', @@ -61,12 +61,14 @@ parser.add_argument('-ro', '--rem-orphaned', dest='rem_orphaned', action='store_const', const='rem_orphaned', - help='Use this if you would like to remove orphaned files from your downloads directory that are not referenced by any torrents') + help='Use this if you would like to remove orphaned files from your `root_dir` directory that are not referenced by any torrents.' + ' It will scan your `root_dir` directory and compare it with what is in Qbitorrent. Any data not referenced in Qbitorrent will be moved into ' + ' `/data/torrents/orphaned_data` folder for you to review/delete.') parser.add_argument('--dry-run', dest='dry_run', action='store_const', const='dry_run', - help='If you would like to see what is gonna happen but not actually delete or ' + help='If you would like to see what is gonna happen but not actually move/delete or ' 'tag/categorize anything.') parser.add_argument('--log', dest='loglevel', From 47cfe8c3990e57afa0de1f42bfc6baabea21d417 Mon Sep 17 00:00:00 2001 From: Visorask <54461452+Visorask@users.noreply.github.com> Date: Thu, 1 Apr 2021 11:05:55 -0500 Subject: [PATCH 2/3] Update README.md - Removed name column. --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 9cb4843..e896ba1 100644 --- a/README.md +++ b/README.md @@ -33,19 +33,19 @@ python qbit_manage.py -h ``` ## Commands -| Name | Shell Command | Description | Default Value | -| :----------- | :------------ | :------------ | :------------ | -| Config | `-c CONFIG` or `--config-file CONFIG` | This is used if you want to use a different name for your config.yml. `Example: tv.yml` | config.yml | -| Log File| `-l LOGFILE,` or `--log-file LOGFILE,` | This is used if you want to use a different name for your log file. `Example: tv.log` | activity.log | -| Manage| `-m` or `--manage` | Use this if you would like to update your tags, categories, remove unregistered torrents, AND recheck/resume paused torrents. | | -| Cross-Seed| `-s` or `--cross-seed` | Use this after running [cross-seed script](https://github.com/mmgoodnow/cross-seed) to add torrents from the cross-seed output folder to qBittorrent | | -| Recheck| `-re` or `--recheck` | Recheck paused torrents sorted by lowest size. Resume if Completed. | | -| Update Category| `-g` or `--cat-update` | Use this if you would like to update your categories. | | -| Add Tags| `-t` or `--tag-update` | Use this if you would like to update your tags. (Only adds tags to untagged torrents) | | -| Remove Unregistered Torrents| `-r` or `--rem-unregistered` | Use this if you would like to remove unregistered torrents. (It will the delete data & torrent if it is not being cross-seeded, otherwise it will just remove the torrent without deleting data) | | -| Remove Orphaned Data| `-ro` or `--rem-orphaned` | Use this if you would like to remove orphaned files from your `root_dir` directory that are not referenced by any torrents. It will scan your `root_dir` directory and compare it with what is in Qbitorrent. Any data not referenced in Qbitorrent will be moved into `/data/torrents/orphaned_data` folder for you to review/delete. | | -| Dry-Run | `--dry-run` | If you would like to see what is gonna happen but not actually move/delete or tag/categorize anything. | | -| Log Level | `--log LOGLEVEL` | Change the ouput log level. | INFO | +| Shell Command | Description | Default Value | +| :------------ | :------------ | :------------ | +| `-c CONFIG` or `--config-file CONFIG` | This is used if you want to use a different name for your config.yml. `Example: tv.yml` | config.yml | +| `-l LOGFILE,` or `--log-file LOGFILE,` | This is used if you want to use a different name for your log file. `Example: tv.log` | activity.log | +| `-m` or `--manage` | Use this if you would like to update your tags, categories, remove unregistered torrents, AND recheck/resume paused torrents. | | +| `-s` or `--cross-seed` | Use this after running [cross-seed script](https://github.com/mmgoodnow/cross-seed) to add torrents from the cross-seed output folder to qBittorrent | | +| `-re` or `--recheck` | Recheck paused torrents sorted by lowest size. Resume if Completed. | | +| `-g` or `--cat-update` | Use this if you would like to update your categories. | | +| `-t` or `--tag-update` | Use this if you would like to update your tags. (Only adds tags to untagged torrents) | | +| `-r` or `--rem-unregistered` | Use this if you would like to remove unregistered torrents. (It will the delete data & torrent if it is not being cross-seeded, otherwise it will just remove the torrent without deleting data) | | +| `-ro` or `--rem-orphaned` | Use this if you would like to remove orphaned files from your `root_dir` directory that are not referenced by any torrents. It will scan your `root_dir` directory and compare it with what is in Qbitorrent. Any data not referenced in Qbitorrent will be moved into `/data/torrents/orphaned_data` folder for you to review/delete. | | +| `--dry-run` | If you would like to see what is gonna happen but not actually move/delete or tag/categorize anything. | | +| `--log LOGLEVEL` | Change the ouput log level. | INFO | ### Config To choose the location of the YAML config file @@ -56,4 +56,4 @@ python qbit_manage.py --config-file To choose the location of the Log File ``` python qbit_manage.py --log-file -``` \ No newline at end of file +``` From d82bc3b51b74750e748b153ef49288583935f634 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 5 Apr 2021 19:48:42 -0400 Subject: [PATCH 3/3] Updated docs --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e896ba1..04462d8 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # qBit Management -This is a program used to manage your qBitorrent instance such as: +This is a program used to manage your qBittorrent instance such as: * Tag torrents based on tracker URL (only tag torrents that have no tags) * Update categories based on save directory * Remove unregistered torrents (delete data & torrent if it is not being cross-seeded, otherwise it will just remove the torrent) * Automatically add [cross-seed](https://github.com/mmgoodnow/cross-seed) torrents in paused state (used in conjunction with the [cross-seed](https://github.com/mmgoodnow/cross-seed) script) -* Recheck paused torrents sorted by lowest size. Resume if completed. +* Recheck paused torrents sorted by lowest size and resume if completed +* Remove orphaned files from your root directory that are not referenced by qBittorrent ## Installation @@ -25,7 +26,7 @@ To run the script in an interactive terminal run: * copy the `config.yml.sample` file to `config.yml` * add your qBittorrent host, user and pass. If you are not using a username and password you can remove the `user` and `pass` lines. * add your `cross_seed` and `root_dir`. If you are using a docker container you must fill out `remote_dir` as well. -* Add your categories and save path to match with what is being used in your qBitorrent instance. I suggest using the full path when defining `save_path` +* Add your categories and save path to match with what is being used in your qBittorrent instance. I suggest using the full path when defining `save_path` * Add the `tag` definition based on tracker URL * To run the script in an interactive terminal with a list of possible commands run: ``` @@ -43,7 +44,7 @@ python qbit_manage.py -h | `-g` or `--cat-update` | Use this if you would like to update your categories. | | | `-t` or `--tag-update` | Use this if you would like to update your tags. (Only adds tags to untagged torrents) | | | `-r` or `--rem-unregistered` | Use this if you would like to remove unregistered torrents. (It will the delete data & torrent if it is not being cross-seeded, otherwise it will just remove the torrent without deleting data) | | -| `-ro` or `--rem-orphaned` | Use this if you would like to remove orphaned files from your `root_dir` directory that are not referenced by any torrents. It will scan your `root_dir` directory and compare it with what is in Qbitorrent. Any data not referenced in Qbitorrent will be moved into `/data/torrents/orphaned_data` folder for you to review/delete. | | +| `-ro` or `--rem-orphaned` | Use this if you would like to remove orphaned files from your `root_dir` directory that are not referenced by any torrents. It will scan your `root_dir` directory and compare it with what is in qBittorrent. Any data not referenced in qBittorrent will be moved into `/data/torrents/orphaned_data` folder for you to review/delete. | | | `--dry-run` | If you would like to see what is gonna happen but not actually move/delete or tag/categorize anything. | | | `--log LOGLEVEL` | Change the ouput log level. | INFO |