Clean up docs, default NocoDB URL to xb.constantprojects.com
This commit is contained in:
@@ -1,26 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Seed Tracker - Match torrent files against qBittorrent session.
|
||||
|
||||
Compares {id}.torrent files against qBittorrent's BT_backup folder to determine
|
||||
which torrents are actively seeding, then updates a NocoDB database with the
|
||||
seeding user's name. Used for tracking who is seeding shared backup torrents.
|
||||
|
||||
Matching is done by:
|
||||
1. Info hash (exact match)
|
||||
2. Name + size fallback (for re-created torrents with different hashes)
|
||||
|
||||
Requirements:
|
||||
- Python 3.10+
|
||||
- No external dependencies (uses only stdlib)
|
||||
|
||||
Usage:
|
||||
python seed_tracker.py --id-folder ./torrents --bt-backup /path/to/BT_backup \\
|
||||
--nocodb-url https://noco.example.com --table-id tblXXX --api-token xc-xxx
|
||||
|
||||
To find NocoDB IDs:
|
||||
- Table ID: Click ... next to table name → Copy Table ID
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import csv
|
||||
@@ -302,14 +280,13 @@ def main():
|
||||
Examples:
|
||||
# API mode - update NocoDB directly:
|
||||
%(prog)s --id-folder ./torrents --bt-backup ~/.local/share/qBittorrent/BT_backup \\
|
||||
--nocodb-url https://noco.example.com --table-id tblXXXXX --api-token xc-xxxx
|
||||
--table-id tblXXXXX --api-token xx
|
||||
|
||||
# CSV mode - just output a file:
|
||||
%(prog)s --id-folder ./torrents --bt-backup /path/to/BT_backup --csv-only
|
||||
|
||||
# Upload a CSV generated by someone else:
|
||||
%(prog)s --upload-csv seeds.csv --nocodb-url https://noco.example.com \\
|
||||
--table-id tblXXXXX --api-token xc-xxxx
|
||||
%(prog)s --upload-csv seeds.csv --table-id tblXXXXX --api-token xx
|
||||
"""
|
||||
)
|
||||
|
||||
@@ -319,8 +296,8 @@ Examples:
|
||||
help="Path to qBittorrent's BT_backup folder")
|
||||
|
||||
# NocoDB API options
|
||||
parser.add_argument('--nocodb-url', type=str, default=None,
|
||||
help='NocoDB base URL (e.g., http://localhost:8080)')
|
||||
parser.add_argument('--nocodb-url', type=str, default='https://xb.constantprojects.com',
|
||||
help='NocoDB base URL (default: https://xb.constantprojects.com)')
|
||||
parser.add_argument('--table-id', type=str, default=None,
|
||||
help='NocoDB table ID (starts with "tbl")')
|
||||
parser.add_argument('--api-token', type=str, default=None,
|
||||
@@ -342,8 +319,8 @@ Examples:
|
||||
if not args.upload_csv.exists():
|
||||
print(f"Error: CSV file not found: {args.upload_csv}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
if not all([args.nocodb_url, args.table_id, args.api_token]):
|
||||
print("Error: --upload-csv requires --nocodb-url, --table-id, and --api-token", file=sys.stderr)
|
||||
if not all([args.table_id, args.api_token]):
|
||||
print("Error: --upload-csv requires --table-id and --api-token", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
else:
|
||||
if not args.id_folder or not args.bt_backup:
|
||||
@@ -435,8 +412,8 @@ Examples:
|
||||
print(f"Mode: {'NocoDB API' if use_api else 'CSV output'}")
|
||||
|
||||
if use_api:
|
||||
if not all([args.nocodb_url, args.table_id, args.api_token]):
|
||||
print("Error: API mode requires --nocodb-url, --table-id, and --api-token", file=sys.stderr)
|
||||
if not all([args.table_id, args.api_token]):
|
||||
print("Error: API mode requires --table-id and --api-token", file=sys.stderr)
|
||||
print(" Use --csv-only to skip API and just output CSV", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
noco = NocoDBClient(
|
||||
|
||||
Reference in New Issue
Block a user