Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Audionut committed Sep 8, 2024
1 parent 9c38e53 commit ea14209
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 36 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ A simple tool to take the work out of uploading.
- Generates and Parses MediaInfo/BDInfo.
- Generates and Uploads screenshots.
- Uses srrdb to fix scene filenames
- Can grab descriptions from PTP (automatically on filename match or arg) / BLU (arg)
- Can grab descriptions from PTP/BLU (automatically on filename match or arg) / Aither/LST/OE (with arg)
- Can strip existing screenshots from descriptions to skip screenshot generation and uploading
- Obtains TMDb/IMDb/MAL identifiers.
- Converts absolute to season episode numbering for Anime
- Generates custom .torrents without useless top level folders/nfos.
- Can re-use existing torrents instead of hashing new
- Generates proper name for your upload using Mediainfo/BDInfo and TMDb/IMDb conforming to site rules
- Checks for existing releases already on site
- Uploads to PTP/BLU/BHD/Aither/THR/STC/R4E(limited)/STT/HP/ACM/LCD/LST/NBL/ANT/FL/HUNO/RF/SN/RTF/OTW/FNP/CBR/UTP/HDB/AL/SHRI
- Uploads to PTP/BLU/BHD/Aither/THR/STC/R4E(limited)/STT/HP/ACM/LCD/LST/NBL/ANT/FL/HUNO/RF/SN/RTF/OTW/FNP/CBR/UTP/HDB/AL/SHRI/OE/TL/BHDTV/HDT/JPTV/LT/MTV/PTER/TDC/TTG/UTP
- Adds to your client with fast resume, seeding instantly (rtorrent/qbittorrent/deluge/watch folder)
- ALL WITH MINIMAL INPUT!
- Currently works with .mkv/.mp4/Blu-ray/DVD/HD-DVDs
Expand All @@ -33,7 +34,7 @@ Built with updated BDInfoCLI from https://github.com/rokibhasansagar/BDInfoCLI-n
- Also needs MediaInfo and ffmpeg installed on your system
- On Windows systems, ffmpeg must be added to PATH (https://windowsloop.com/install-ffmpeg-windows-10/)
- On linux systems, get it from your favorite package manager
- Clone the repo to your system `git clone https://github.com/Audionut/Upload-Assistant.git`
- Clone the repo to your system `git clone https://github.com/Audionut/Upload-Assistant.git` - or download a zip of the source
- Copy and Rename `data/example-config.py` to `data/config.py`
- Edit `config.py` to use your information (more detailed information in the [wiki](https://github.com/Audionut/Upload-Assistant/wiki))
- tmdb_api (v3) key can be obtained from https://developers.themoviedb.org/3/getting-started/introduction
Expand All @@ -50,6 +51,7 @@ Built with updated BDInfoCLI from https://github.com/rokibhasansagar/BDInfoCLI-n
- To update first navigate into the Upload-Assistant directory: `cd Upload-Assistant`
- Run a `git pull` to grab latest updates
- Run `python3 -m pip install --user -U -r requirements.txt` to ensure dependencies are up to date
- Or download a fresh zip and overwrite existing files
## **CLI Usage:**

`python3 upload.py /downloads/path/to/content --args`
Expand Down
8 changes: 4 additions & 4 deletions data/example-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"TRACKERS": {
# Which trackers do you want to upload to?
# Available tracker: BLU, BHD, AITHER, STC, STT, SN, THR, R4E, HP, ACM, PTP, LCD, LST, PTER, NBL, ANT, MTV, CBR, RTF, HUNO, BHDTV, LT, PTER, TL, TDC, HDT, OE, RF, OTW, FNP, UTP, AL, HDB
# Remove the ones not used to save being asked everytime
# Remove the trackers from the default_trackers list that are not used, to save being asked everytime
"default_trackers": "BLU, BHD, AITHER, STC, STT, SN, THR, R4E, HP, ACM, PTP, LCD, LST, PTER, NBL, ANT, MTV, CBR, RTF, HUNO, BHDTV, LT, PTER, TL, TDC, HDT, OE, RF, OTW, FNP, UTP, AL, HDB",

"BLU": {
Expand Down Expand Up @@ -241,9 +241,9 @@
},
},

# enable_search to true will automatically try and find a suitable hash to save having to rehash when creating torrents
# enable_search to True will automatically try and find a suitable hash to save having to rehash when creating torrents
# Should use the qbit API, but will also use the torrent_storage_dir to find suitable hashes
# If you find issue, use the "--debug" command option to print out some related details
# If you find issue, use the "--debug" argument to print out some related details
"TORRENT_CLIENTS": {
# Name your torrent clients here, for example, this example is named "Client1" and is set as default_torrent_client above
# All options relate to the webui, make sure you have the webui secured if it has WAN access
Expand All @@ -255,7 +255,7 @@
"qbit_port": "8080",
"qbit_user": "username",
"qbit_pass": "password",
# "torrent_storage_dir": "path/to/BT_backup folder"
# "torrent_storage_dir": "path/to/BT_backup folder" ## use double-backslash on windows eg: "C:\\client\\backup"

# Remote path mapping (docker/etc.) CASE SENSITIVE
# "local_path": "/LocalPath",
Expand Down
39 changes: 10 additions & 29 deletions upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ async def do_the_thing(base_dir):
####### Upload to Trackers ####### # noqa #F266
####################################
common = COMMON(config=config)
api_trackers = ['BLU', 'AITHER', 'STC', 'R4E', 'STT', 'RF', 'ACM', 'LCD', 'HUNO', 'SN', 'LT', 'NBL', 'ANT', 'JPTV', 'TDC', 'OE', 'BHDTV', 'RTF', 'OTW', 'FNP', 'CBR', 'UTP', 'AL', 'HDB', 'SHRI', 'LST', 'BHD']
http_trackers = ['TTG', 'FL', 'PTER', 'HDT', 'MTV']
api_trackers = ['BLU', 'AITHER', 'STC', 'R4E', 'STT', 'RF', 'ACM', 'LCD', 'HUNO', 'SN', 'LT', 'NBL', 'ANT', 'JPTV', 'TDC', 'OE', 'BHDTV', 'RTF', 'OTW', 'FNP', 'CBR', 'UTP', 'AL', 'SHRI', 'LST', 'BHD', 'TL']
http_trackers = ['HDB', 'TTG', 'FL', 'PTER', 'HDT', 'MTV']
tracker_class_map = {
'BLU': BLU, 'BHD': BHD, 'AITHER': AITHER, 'STC': STC, 'R4E': R4E, 'THR': THR, 'STT': STT, 'HP': HP, 'PTP': PTP, 'RF': RF, 'SN': SN,
'ACM': ACM, 'HDB': HDB, 'LCD': LCD, 'TTG': TTG, 'LST': LST, 'HUNO': HUNO, 'FL': FL, 'LT': LT, 'NBL': NBL, 'ANT': ANT, 'PTER': PTER, 'JPTV': JPTV,
Expand Down Expand Up @@ -322,16 +322,17 @@ async def check_mod_q_and_draft(tracker_class, meta, debug):
if check_banned_group(tracker_class.tracker, tracker_class.banned_groups, meta):
continue

# Perform the existing checks for dupes
if tracker == "RTF":
await tracker_class.api_test(meta)
# Perform the existing checks for dupes except TL
if tracker != "TL":
if tracker == "RTF":
await tracker_class.api_test(meta)

dupes = await tracker_class.search_existing(meta)
dupes = await common.filter_dupes(dupes, meta)
meta = dupe_check(dupes, meta)
dupes = await tracker_class.search_existing(meta)
dupes = await common.filter_dupes(dupes, meta)
meta = dupe_check(dupes, meta)

# Proceed with upload if the meta is set to upload
if meta['upload']:
if tracker == "TL" or meta.get('upload', False):
await tracker_class.upload(meta)
if tracker == 'SN':
await asyncio.sleep(16)
Expand Down Expand Up @@ -463,26 +464,6 @@ async def check_mod_q_and_draft(tracker_class, meta, debug):
except Exception:
console.print(traceback.print_exc())

if tracker == "TL":
tracker_class = tracker_class_map[tracker](config=config)
if meta['unattended']:
upload_to_tracker = True
else:
try:
upload_to_ptp = cli_ui.ask_yes_no(
f"Upload to {tracker}? {debug}",
default=meta['unattended']
)
except (KeyboardInterrupt, EOFError):
sys.exit(1) # Exit immediately

if upload_to_tracker:
console.print(f"Uploading to {tracker_class.tracker}")
if check_banned_group(tracker_class.tracker, tracker_class.banned_groups, meta):
continue
await tracker_class.upload(meta)
await client.add_to_client(meta, tracker_class.tracker)


def get_confirmation(meta):
if meta['debug'] is True:
Expand Down

0 comments on commit ea14209

Please sign in to comment.