diff --git a/data/example-config.py b/data/example-config.py index 703614322..1e2a23f5d 100644 --- a/data/example-config.py +++ b/data/example-config.py @@ -1,16 +1,16 @@ config = { - "DEFAULT" : { - + "DEFAULT": { + # ------ READ THIS ------ # Any lines starting with the # symbol are commented and will not be used. # If you change any of these options, remove the # # ----------------------- - "tmdb_api" : "tmdb_api key", - "imgbb_api" : "imgbb api key", - "ptpimg_api" : "ptpimg api key", - "lensdump_api" : "lensdump api key", - "ptscreens_api" : "ptscreens api key", + "tmdb_api": "tmdb_api key", + "imgbb_api": "imgbb api key", + "ptpimg_api": "ptpimg api key", + "lensdump_api": "lensdump api key", + "ptscreens_api": "ptscreens api key", # Order of image hosts, and backup image hosts "img_host_1": "imgbb", @@ -21,35 +21,35 @@ "img_host_6": "ptscreens", - "screens" : "6", + "screens": "6", # Enable lossless PNG Compression (True/False) - "optimize_images" : True, + "optimize_images": True, # The name of your default torrent client, set in the torrent client sections below - "default_torrent_client" : "Client1", + "default_torrent_client": "Client1", # Play the bell sound effect when asking for confirmation - "sfx_on_prompt" : True, + "sfx_on_prompt": True, }, - "TRACKERS" : { + "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 - "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", + "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" : { - "useAPI" : False, # Set to True if using BLU - "api_key" : "BLU api key", - "announce_url" : "https://blutopia.cc/announce/customannounceurl", + "BLU": { + "useAPI": False, # Set to True if using BLU + "api_key": "BLU api key", + "announce_url": "https://blutopia.cc/announce/customannounceurl", # "anon" : False }, - "BHD" : { - "api_key" : "BHD api key", - "announce_url" : "https://beyond-hd.me/announce/customannounceurl", - "draft_default" : "True", + "BHD": { + "api_key": "BHD api key", + "announce_url": "https://beyond-hd.me/announce/customannounceurl", + "draft_default": "True", # "anon" : False }, "BHDTV": { @@ -59,174 +59,174 @@ "my_announce_url": "https://trackerr.bit-hdtv.com/passkey/announce", # "anon" : "False" }, - "PTP" : { - "useAPI" : False, # Set to True if using PTP - "add_web_source_to_desc" : True, - "ApiUser" : "ptp api user", - "ApiKey" : 'ptp api key', - "username" : "", - "password" : "", - "announce_url" : "" - }, - "AITHER" :{ - "api_key" : "AITHER api key", - "announce_url" : "https://aither.cc/announce/customannounceurl", + "PTP": { + "useAPI": False, # Set to True if using PTP + "add_web_source_to_desc": True, + "ApiUser": "ptp api user", + "ApiKey": 'ptp api key', + "username": "", + "password": "", + "announce_url": "" + }, + "AITHER": { + "api_key": "AITHER api key", + "announce_url": "https://aither.cc/announce/customannounceurl", # "anon" : False }, - "R4E" :{ - "api_key" : "R4E api key", - "announce_url" : "https://racing4everyone.eu/announce/customannounceurl", + "R4E": { + "api_key": "R4E api key", + "announce_url": "https://racing4everyone.eu/announce/customannounceurl", # "anon" : False }, - "HUNO" : { - "api_key" : "HUNO api key", - "announce_url" : "https://hawke.uno/announce/customannounceurl", + "HUNO": { + "api_key": "HUNO api key", + "announce_url": "https://hawke.uno/announce/customannounceurl", # "anon" : False }, "MTV": { - 'api_key' : 'get from security page', - 'username' : '', - 'password' : '', - 'announce_url' : "get from https://www.morethantv.me/upload.php", - 'anon' : False, + 'api_key': 'get from security page', + 'username': '', + 'password': '', + 'announce_url': "get from https://www.morethantv.me/upload.php", + 'anon': False, # 'otp_uri' : 'OTP URI, read the following for more information https://github.com/google/google-authenticator/wiki/Key-Uri-Format' }, - "STC" :{ - "api_key" : "STC", - "announce_url" : "https://skipthecommericals.xyz/announce/customannounceurl", + "STC": { + "api_key": "STC", + "announce_url": "https://skipthecommericals.xyz/announce/customannounceurl", # "anon" : False }, - "STT" :{ - "api_key" : "STC", - "announce_url" : "https://stt.xyz/announce/customannounceurl", + "STT": { + "api_key": "STC", + "announce_url": "https://stt.xyz/announce/customannounceurl", # "anon" : False }, "SN": { "api_key": "SN", "announce_url": "https://tracker.swarmazon.club:8443//announce", }, - "HP" :{ - "api_key" : "HP", - "announce_url" : "https://hidden-palace.net/announce/customannounceurl", + "HP": { + "api_key": "HP", + "announce_url": "https://hidden-palace.net/announce/customannounceurl", # "anon" : False }, - "ACM" :{ - "api_key" : "ACM api key", - "announce_url" : "https://asiancinema.me/announce/customannounceurl", + "ACM": { + "api_key": "ACM api key", + "announce_url": "https://asiancinema.me/announce/customannounceurl", # "anon" : False, # FOR INTERNAL USE ONLY: # "internal" : True, # "internal_groups" : ["What", "Internal", "Groups", "Are", "You", "In"], }, - "NBL" : { - "api_key" : "NBL api key", - "announce_url" : "https://nebulance.io/customannounceurl", + "NBL": { + "api_key": "NBL api key", + "announce_url": "https://nebulance.io/customannounceurl", }, - "ANT" :{ - "api_key" : "ANT api key", - "announce_url" : "https://anthelion.me/announce/customannounceurl", + "ANT": { + "api_key": "ANT api key", + "announce_url": "https://anthelion.me/announce/customannounceurl", # "anon" : False }, - "THR" : { - "username" : "username", - "password" : "password", - "img_api" : "get this from the forum post", - "announce_url" : "http://www.torrenthr.org/announce.php?passkey=yourpasskeyhere", - "pronfo_api_key" : "pronfo api key", - "pronfo_theme" : "pronfo theme code", - "pronfo_rapi_id" : "pronfo remote api id", + "THR": { + "username": "username", + "password": "password", + "img_api": "get this from the forum post", + "announce_url": "http://www.torrenthr.org/announce.php?passkey=yourpasskeyhere", + "pronfo_api_key": "pronfo api key", + "pronfo_theme": "pronfo theme code", + "pronfo_rapi_id": "pronfo remote api id", # "anon" : False }, - "LCD" : { - "api_key" : "LCD api key", - "announce_url" : "https://locadora.cc/announce/customannounceurl", + "LCD": { + "api_key": "LCD api key", + "announce_url": "https://locadora.cc/announce/customannounceurl", # "anon" : False }, - "CBR" : { - "api_key" : "CBR api key", - "announce_url" : "https://capybarabr.com/announce/customannounceurl", + "CBR": { + "api_key": "CBR api key", + "announce_url": "https://capybarabr.com/announce/customannounceurl", # "anon" : False }, - "LST" : { - "api_key" : "LST api key", - "announce_url" : "https://lst.gg/announce/customannounceurl", + "LST": { + "api_key": "LST api key", + "announce_url": "https://lst.gg/announce/customannounceurl", # "anon" : False }, - "LT" : { - "api_key" : "LT api key", - "announce_url" : "https://lat-team.com/announce/customannounceurl", + "LT": { + "api_key": "LT api key", + "announce_url": "https://lat-team.com/announce/customannounceurl", # "anon" : False }, - "PTER" : { - "passkey":'passkey', - "img_rehost" : False, - "username" : "", - "password" : "", + "PTER": { + "passkey": 'passkey', + "img_rehost": False, + "username": "", + "password": "", "ptgen_api": "", "anon": True, }, "TL": { "announce_key": "TL announce key", }, - "TDC" :{ - "api_key" : "TDC api key", - "announce_url" : "https://thedarkcommunity.cc/announce/customannounceurl", + "TDC": { + "api_key": "TDC api key", + "announce_url": "https://thedarkcommunity.cc/announce/customannounceurl", # "anon" : "False" }, - "HDT" : { - "username" : "username", - "password" : "password", + "HDT": { + "username": "username", + "password": "password", "my_announce_url": "https://hdts-announce.ru/announce.php?pid=", # "anon" : "False" - "announce_url" : "https://hdts-announce.ru/announce.php", #DO NOT EDIT THIS LINE + "announce_url": "https://hdts-announce.ru/announce.php", #DO NOT EDIT THIS LINE }, - "OE" : { - "api_key" : "OE api key", - "announce_url" : "https://onlyencodes.cc/announce/customannounceurl", + "OE": { + "api_key": "OE api key", + "announce_url": "https://onlyencodes.cc/announce/customannounceurl", # "anon" : False }, "RTF": { - "username" : "username", - "password" : "password", + "username": "username", + "password": "password", "api_key": 'get_it_by_running_/api/ login command from https://retroflix.club/api/doc', "announce_url": "get from upload page", # "tag": "RetroFlix, nd", "anon": True }, - "RF" : { - "api_key" : "RF api key", - "announce_url" : "https://reelflix.xyz/announce/customannounceurl", + "RF": { + "api_key": "RF api key", + "announce_url": "https://reelflix.xyz/announce/customannounceurl", # "anon" : False }, - "OTW" : { - "api_key" : "OTW api key", - "announce_url" : "https://oldtoons.world/announce/customannounceurl", + "OTW": { + "api_key": "OTW api key", + "announce_url": "https://oldtoons.world/announce/customannounceurl", # "anon" : False }, - "FNP" :{ - "api_key" : "FNP api key", - "announce_url" : "https://fearnopeer.com/announce/customannounceurl", + "FNP": { + "api_key": "FNP api key", + "announce_url": "https://fearnopeer.com/announce/customannounceurl", # "anon" : "False" }, - "UTP" : { - "api_key" : "UTP api key", - "announce_url" : "https://UTP/announce/customannounceurl", + "UTP": { + "api_key": "UTP api key", + "announce_url": "https://UTP/announce/customannounceurl", # "anon" : False }, - "AL" : { - "api_key" : "AL api key", - "announce_url" : "https://animelovers.club/announce/customannounceurl", + "AL": { + "api_key": "AL api key", + "announce_url": "https://animelovers.club/announce/customannounceurl", # "anon" : False }, - "HDB" : { - "useAPI" : True, - "username" : "HDB username", - "passkey" : "HDB passkey", - "announce_url" : "https://hdbits.org/announce/Custom_Announce_URL", - "anon" : False, + "HDB": { + "useAPI": True, + "username": "HDB username", + "passkey": "HDB passkey", + "announce_url": "https://hdbits.org/announce/Custom_Announce_URL", + "anon": False, }, - "MANUAL" : { + "MANUAL": { # Uncomment and replace link with filebrowser (https://github.com/filebrowser/filebrowser) link to the Upload-Assistant directory, this will link to your filebrowser instead of uploading to uguu.se # "filebrowser" : "https://domain.tld/filebrowser/files/Upload-Assistant/" }, @@ -235,36 +235,36 @@ # 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 - "TORRENT_CLIENTS" : { + "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 # See https://github.com/Audionut/Upload-Assistant/wiki - "Client1" : { - "torrent_client" : "qbit", - # "enable_search" : True, - "qbit_url" : "http://127.0.0.1", - "qbit_port" : "8080", - "qbit_user" : "username", - "qbit_pass" : "password", - # "torrent_storage_dir" : "path/to/BT_backup folder" + "Client1": { + "torrent_client": "qbit", + # "enable_search": True, + "qbit_url": "http://127.0.0.1", + "qbit_port": "8080", + "qbit_user": "username", + "qbit_pass": "password", + # "torrent_storage_dir": "path/to/BT_backup folder" # Remote path mapping (docker/etc.) CASE SENSITIVE - # "local_path" : "/LocalPath", - # "remote_path" : "/RemotePath" - }, - "qbit_sample" : { - "torrent_client" : "qbit", - "enable_search" : True, - "qbit_url" : "http://127.0.0.1", - "qbit_port" : "8080", - "qbit_user" : "username", - "qbit_pass" : "password", - # "torrent_storage_dir" : "path/to/BT_backup folder" - # "qbit_tag" : "tag", - # "qbit_cat" : "category" + # "local_path": "/LocalPath", + # "remote_path": "/RemotePath" + }, + "qbit_sample": { + "torrent_client": "qbit", + "enable_search": True, + "qbit_url": "http://127.0.0.1", + "qbit_port": "8080", + "qbit_user": "username", + "qbit_pass": "password", + # "torrent_storage_dir": "path/to/BT_backup folder" + # "qbit_tag": "tag", + # "qbit_cat": "category" # Content Layout for adding .torrents: "Original"(recommended)/"Subfolder"/"NoSubfolder" - "content_layout" : "Original" + "content_layout": "Original" # Enable automatic torrent management if listed path(s) are present in the path # If using remote path mapping, use remote path @@ -278,9 +278,9 @@ # "VERIFY_WEBUI_CERTIFICATE" : True }, - "rtorrent_sample" : { - "torrent_client" : "rtorrent", - "rtorrent_url" : "https://user:password@server.host.tld:443/username/rutorrent/plugins/httprpc/action.php", + "rtorrent_sample": { + "torrent_client": "rtorrent", + "rtorrent_url": "https://user:password@server.host.tld:443/username/rutorrent/plugins/httprpc/action.php", # "torrent_storage_dir" : "path/to/session folder", # "rtorrent_label" : "Add this label to all uploads" @@ -289,48 +289,47 @@ # "remote_path" : "/RemotePath" }, - "deluge_sample" : { - "torrent_client" : "deluge", - "deluge_url" : "localhost", - "deluge_port" : "8080", - "deluge_user" : "username", - "deluge_pass" : "password", + "deluge_sample": { + "torrent_client": "deluge", + "deluge_url": "localhost", + "deluge_port": "8080", + "deluge_user": "username", + "deluge_pass": "password", # "torrent_storage_dir" : "path/to/session folder", # Remote path mapping (docker/etc.) CASE SENSITIVE # "local_path" : "/LocalPath", # "remote_path" : "/RemotePath" }, - "watch_sample" : { - "torrent_client" : "watch", - "watch_folder" : "/Path/To/Watch/Folder" + "watch_sample": { + "torrent_client": "watch", + "watch_folder": "/Path/To/Watch/Folder" }, }, - "DISCORD" :{ - "discord_bot_token" : "discord bot token", - "discord_bot_description" : "L4G's Upload Assistant", - "command_prefix" : "!", - "discord_channel_id" : "discord channel id for use", - "admin_id" : "your discord user id", + "DISCORD": { + "discord_bot_token": "discord bot token", + "discord_bot_description": "L4G's Upload Assistant", + "command_prefix": "!", + "discord_channel_id": "discord channel id for use", + "admin_id": "your discord user id", - "search_dir" : "Path/to/downloads/folder/ this is used for search", + "search_dir": "Path/to/downloads/folder/ this is used for search", # Alternatively, search multiple folders: # "search_dir" : [ # "/downloads/dir1", # "/data/dir2", # ] - "discord_emojis" : { + "discord_emojis": { "BLU": "💙", "BHD": "🎉", "AITHER": "🛫", "STC": "📺", "ACM": "🍙", - "MANUAL" : "📩", - "UPLOAD" : "✅", - "CANCEL" : "🚫" + "MANUAL": "📩", + "UPLOAD": "✅", + "CANCEL": "🚫" } } -} - +} \ No newline at end of file diff --git a/src/prep.py b/src/prep.py index c06a8b4b5..87dc6d138 100644 --- a/src/prep.py +++ b/src/prep.py @@ -1967,7 +1967,6 @@ def get_distributor(self, distributor_in): distributor_out = each return distributor_out - def get_video_codec(self, bdinfo): codecs = { "MPEG-2 Video" : "MPEG-2", @@ -2019,7 +2018,6 @@ def get_video_encode(self, mi, type, bdinfo): video_codec = f"MPEG-{mi['media']['track'][1].get('Format_Version')}" return video_encode, video_codec, has_encode_settings, bit_depth - def get_edition(self, video, bdinfo, filelist, manual_edition): if video.lower().startswith('dc'): video = video.replace('dc', '', 1) @@ -2227,7 +2225,6 @@ def create_base_from_existing_torrent(self, torrentpath, base_dir, uuid): base_torrent.private = True Torrent.copy(base_torrent).write(f"{base_dir}/tmp/{uuid}/BASE.torrent", overwrite=True) - """ Upload Screenshots """ @@ -2498,7 +2495,6 @@ async def get_name(self, meta): name = f"{title} {year} {alt_title} {season}{episode} {episode_title} {part} {edition} {repack} {resolution} {source} {audio} {video_encode}" potential_missing = [] - try: name = ' '.join(name.split()) except: @@ -2513,9 +2509,6 @@ async def get_name(self, meta): clean_name = self.clean_filename(name) return name_notag, name, clean_name, potential_missing - - - async def get_season_episode(self, video, meta): if meta['category'] == 'TV': filelist = meta['filelist'] @@ -2681,16 +2674,6 @@ async def get_season_episode(self, video, meta): console.print(f"[bold yellow]{meta['title']} does not exist on thexem, guessing {season}") console.print(f"[bold yellow]If [green]{season}[/green] is incorrect, use --season to correct") await asyncio.sleep(3) - # try: - # version = parsed['release_version'] - # if int(version) == 2: - # meta['repack'] = "REPACK" - # elif int(version) > 2: - # meta['repack'] = f"REPACK{int(version) - 1}" - # # version = f"v{version}" - # except Exception: - # # version = "" - # pass if meta.get('manual_season', None) == None: meta['season'] = season @@ -2722,7 +2705,6 @@ async def get_season_episode(self, video, meta): return meta - def get_service(self, video, tag, audio, guess_title): service = guessit(video).get('streaming_service', "") services = { @@ -2771,8 +2753,7 @@ def get_service(self, video, tag, audio, guess_title): 'W Network': 'WNET', 'WWEN': 'WWEN', 'WWE Network': 'WWEN', 'XBOX': 'XBOX', 'Xbox Video': 'XBOX', 'YHOO': 'YHOO', 'Yahoo': 'YHOO', 'YT': 'YT', 'ZDF': 'ZDF', 'iP': 'iP', 'BBC iPlayer': 'iP', 'iQIYI': 'iQIYI', 'iT': 'iT', 'iTunes': 'iT' } - - + video_name = re.sub(r"[.()]", " ", video.replace(tag, '').replace(guess_title, '')) if "DTS-HD MA" in audio: video_name = video_name.replace("DTS-HD.MA.", "").replace("DTS-HD MA ", "") @@ -2789,8 +2770,6 @@ def get_service(self, video, tag, audio, guess_title): service_longname = "Amazon" return service, service_longname - - def stream_optimized(self, stream_opt): if stream_opt == True: stream = 1 @@ -2826,15 +2805,13 @@ async def upload_image(self, session, url, data, headers, files): async with session.post(url=url, data=data, headers=headers, files=files) as resp: response = await resp.json() return response - - + def clean_filename(self, name): invalid = '<>:"/\|?*' for char in invalid: name = name.replace(char, '-') return name - async def gen_desc(self, meta): desclink = meta.get('desclink', None) descfile = meta.get('descfile', None) @@ -2892,7 +2869,7 @@ async def gen_desc(self, meta): description.write(requests.get(raw).text) description.write("\n") meta['description'] = "CUSTOM" - + if descfile != None: if os.path.isfile(descfile) == True: text = open(descfile, 'r').read() @@ -2904,7 +2881,7 @@ async def gen_desc(self, meta): meta['description'] = "CUSTOM" description.write("\n") return meta - + async def tag_override(self, meta): with open(f"{meta['base_dir']}/data/tags.json", 'r', encoding="utf-8") as f: tags = json.load(f) diff --git a/src/trackers/BHD.py b/src/trackers/BHD.py index d9e73acdf..8909f3f46 100644 --- a/src/trackers/BHD.py +++ b/src/trackers/BHD.py @@ -24,7 +24,7 @@ def __init__(self, config): self.tracker = 'BHD' self.source_flag = 'BHD' self.upload_url = 'https://beyond-hd.me/api/upload/' - self.signature = f"\n[center][url=https://beyond-hd.me/forums/topic/toolpython-l4gs-upload-assistant.5456]Created by L4G's Upload Assistant[/url][/center]" + self.signature = f"\n[center][url=https://beyond-hd.me/forums/topic/toolpython-l4gs-upload-assistant.5456/post/138087#post-138087]Created by L4G's Upload Assistant[/url][/center]" self.banned_groups = ['Sicario', 'TOMMY', 'x0r', 'nikt0', 'FGT', 'd3g', 'MeGusta', 'YIFY', 'tigole', 'TEKNO3D', 'C4K', 'RARBG', '4K4U', 'EASports', 'ReaLHD'] pass @@ -43,12 +43,12 @@ async def upload(self, meta): anon = 0 else: anon = 1 - + if meta['bdinfo'] != None: mi_dump = open(f"{meta['base_dir']}/tmp/{meta['uuid']}/BD_SUMMARY_00.txt", 'r', encoding='utf-8') else: mi_dump = open(f"{meta['base_dir']}/tmp/{meta['uuid']}/MEDIAINFO.txt", 'r', encoding='utf-8') - + desc = open(f"{meta['base_dir']}/tmp/{meta['uuid']}/[{self.tracker}]DESCRIPTION.txt", 'r').read() torrent_file = f"{meta['base_dir']}/tmp/{meta['uuid']}/[{self.tracker}]{meta['clean_name']}.torrent" files = { @@ -58,18 +58,18 @@ async def upload(self, meta): open_torrent = open(f"{meta['base_dir']}/tmp/{meta['uuid']}/[{self.tracker}]{meta['clean_name']}.torrent", 'rb') files['file'] = open_torrent.read() open_torrent.close() - + data = { - 'name' : bhd_name, - 'category_id' : cat_id, - 'type' : type_id, + 'name': bhd_name, + 'category_id': cat_id, + 'type': type_id, 'source': source_id, - 'imdb_id' : meta['imdb_id'].replace('tt', ''), - 'tmdb_id' : meta['tmdb'], - 'description' : desc, - 'anon' : anon, - 'sd' : meta.get('sd', 0), - 'live' : draft + 'imdb_id': meta['imdb_id'].replace('tt', ''), + 'tmdb_id': meta['tmdb'], + 'description': desc, + 'anon': anon, + 'sd': meta.get('sd', 0), + 'live': draft # 'internal' : 0, # 'featured' : 0, # 'free' : 0, @@ -80,7 +80,7 @@ async def upload(self, meta): if self.config['TRACKERS'][self.tracker].get('internal', False) == True: if meta['tag'] != "" and (meta['tag'][1:] in self.config['TRACKERS'][self.tracker].get('internal_groups', [])): data['internal'] = 1 - + if meta.get('tv_pack', 0) == 1: data['pack'] = 1 if meta.get('season', None) == "S00": @@ -96,7 +96,7 @@ async def upload(self, meta): headers = { 'User-Agent': f'Upload Assistant/2.1 ({platform.system()} {platform.release()})' } - + url = self.upload_url + self.config['TRACKERS'][self.tracker]['api_key'].strip() if meta['debug'] == False: response = requests.post(url=url, files=files, data=data, headers=headers) @@ -118,12 +118,6 @@ async def upload(self, meta): else: console.print(f"[cyan]Request Data:") console.print(data) - - - - - - async def get_cat_id(self, category_name): category_id = { @@ -144,7 +138,7 @@ async def get_source(self, source): "NTSC" : "DVD", "NTSC DVD" : "DVD", "PAL" : "DVD", "PAL DVD": "DVD", } - + source_id = sources.get(source) return source_id @@ -184,8 +178,6 @@ async def get_type(self, meta): else: type_id = "Other" return type_id - - async def edit_desc(self, meta): base = open(f"{meta['base_dir']}/tmp/{meta['uuid']}/DESCRIPTION.txt", 'r').read() @@ -220,8 +212,6 @@ async def edit_desc(self, meta): desc.write(self.signature) desc.close() return - - async def search_existing(self, meta): dupes = [] diff --git a/src/trackers/HDB.py b/src/trackers/HDB.py index 893ae9a25..f71187d72 100644 --- a/src/trackers/HDB.py +++ b/src/trackers/HDB.py @@ -264,7 +264,7 @@ async def upload(self, meta): else: torrentFileName = unidecode(os.path.basename(meta['path']).replace(' ', '.')) files = { - 'file': (f"{torrentFileName}.torrent", torrentFile, "application/x-bittorent") + 'file': (f"{torrentFileName}.torrent", torrentFile, "application/x-bittorrent") } data = { 'name': hdb_name,