https://github.com/zigai/qbittorrent-sync
Sync qBitTorrent information between operating system installations
https://github.com/zigai/qbittorrent-sync
dual-boot dualboot qbittorrent qbittorrent-api qbittorrent-webui torrent
Last synced: about 1 year ago
JSON representation
Sync qBitTorrent information between operating system installations
- Host: GitHub
- URL: https://github.com/zigai/qbittorrent-sync
- Owner: zigai
- License: gpl-3.0
- Created: 2022-08-30T23:28:46.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-14T11:16:13.000Z (over 1 year ago)
- Last Synced: 2025-02-24T02:12:07.418Z (over 1 year ago)
- Topics: dual-boot, dualboot, qbittorrent, qbittorrent-api, qbittorrent-webui, torrent
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qBitTorrent Sync
Sync qBitTorrent information between various operating system installations that share a hard drive.
## Installation
``` bash
git clone https://github.com/zigai/qbittorrent-sync.git
cd qbittorrent-sync
pip install -r requirements.txt
```
Make sure to enable the WebUI in qBittorrent by going to ```Tools -> Preferences -> Web UI```.
## Example exported torrent:
``` json
{
"name": "ubuntu-mate-22.04.1-desktop-amd64.iso",
"urls": "magnet:?xt=urn:btih:de9bff3b76489706867baa8021d7e3367998ebba&dn=ubuntu-mate-22.04.1-desktop-amd64.iso&tr=https%3a%2f%2ftorrent.ubuntu.com%2fannounce",
"save_path": "/mnt/e/files/downloads/",
"category": "",
"tags": []
}
```
## Usage
### As a Command Line Interface
**NOTE**:
The script will attempt to convert torrent paths from Windows to Unix paths by default. It will map Windows drives to /mnt/. ``` eg. "D:\folder\file.ext" to "/mnt/d/folder/file.ext" ```.
This can be changed by using the script as a Python package and defining a custom function to transform paths.
```
usage: qbittorrent_sync.py [-h] [-host HOST] [-port PORT] [-username USERNAME] [-password PASSWORD] action path
Sync qBitTorrent information between various operating system installations.
positional arguments:
action import/export
path File path
options:
-h, --help show this help message and exit
-host HOST Default: localhost
-port PORT Default: 8080
-username USERNAME Default: admin
-password PASSWORD Default: adminadmin
```
### As Python package
``` python
from qbittorrent_sync import QbitTorrentSync
def custom_path_func(path: str) -> str:
# Custom function for transforming torrent save path when importing
...
client = QbitTorrentSync(path_transform_func=custom_path_func)
client.import_torrents("./torrents.json")
```
## License
[GPLv3](LICENSE)