diff --git a/data/interfaces/default/config.html b/data/interfaces/default/config.html index 5bc2edea..5dc6ab58 100644 --- a/data/interfaces/default/config.html +++ b/data/interfaces/default/config.html @@ -633,24 +633,24 @@
- +
- +
- +
- +
- +
@@ -2439,7 +2439,7 @@ initConfigCheckbox("#use_mininova"); initConfigCheckbox("#use_waffles"); initConfigCheckbox("#use_rutracker"); - initConfigCheckbox("#use_whatcd"); + initConfigCheckbox("#use_apollo"); initConfigCheckbox("#use_pth"); initConfigCheckbox("#use_strike"); initConfigCheckbox("#api_enabled"); diff --git a/headphones/config.py b/headphones/config.py index 46efed19..20129cb7 100644 --- a/headphones/config.py +++ b/headphones/config.py @@ -39,6 +39,11 @@ _CONFIG_DEFINITIONS = { 'ALBUM_COMPLETION_PCT': (int, 'Advanced', 80), 'API_ENABLED': (int, 'General', 0), 'API_KEY': (str, 'General', ''), + 'APOLLO': (int, 'Apollo.rip', 0), + 'APOLLO_PASSWORD': (str, 'Apollo.rip', ''), + 'APOLLO_RATIO': (str, 'Apollo.rip', ''), + 'APOLLO_USERNAME': (str, 'Apollo.rip', ''), + 'APOLLO_URL': (str, 'Apollo.rip', 'https://apollo.rip'), 'AUTOWANT_ALL': (int, 'General', 0), 'AUTOWANT_MANUALLY_ADDED': (int, 'General', 1), 'AUTOWANT_UPCOMING': (int, 'General', 1), @@ -289,11 +294,6 @@ _CONFIG_DEFINITIONS = { 'WAFFLES_PASSKEY': (str, 'Waffles', ''), 'WAFFLES_RATIO': (str, 'Waffles', ''), 'WAFFLES_UID': (str, 'Waffles', ''), - 'WHATCD': (int, 'What.cd', 0), - 'WHATCD_PASSWORD': (str, 'What.cd', ''), - 'WHATCD_RATIO': (str, 'What.cd', ''), - 'WHATCD_USERNAME': (str, 'What.cd', ''), - 'WHATCD_URL': (str, 'What.cd', 'https://what.cd'), 'PTH': (int, 'PassTheHeadphones.me', 0), 'PTH_PASSWORD': (str, 'PassTheHeadphones.me', ''), 'PTH_RATIO': (str, 'PassTheHeadphones.me', ''), diff --git a/headphones/searcher.py b/headphones/searcher.py index 7b19eb26..2c8ee2e6 100644 --- a/headphones/searcher.py +++ b/headphones/searcher.py @@ -45,7 +45,7 @@ TORRENT_TO_MAGNET_SERVICES = [ 'https://torcache.net/torrent/%s.torrent', ] -# Persistent What.cd API object +# Persistent Apollo.rip API object gazelle = None ruobj = None @@ -160,8 +160,8 @@ def get_seed_ratio(provider): seed_ratio = headphones.CONFIG.RUTRACKER_RATIO elif provider == 'Kick Ass Torrents': seed_ratio = headphones.CONFIG.KAT_RATIO - elif provider == 'What.cd': - seed_ratio = headphones.CONFIG.WHATCD_RATIO + elif provider == 'Apollo.rip': + seed_ratio = headphones.CONFIG.APOLLO_RATIO elif provider == 'PassTheHeadphones.Me': seed_ratio = headphones.CONFIG.PTH_RATIO elif provider == 'The Pirate Bay': @@ -274,7 +274,7 @@ def do_sorted_search(album, new, losslessOnly, choose_specific_download=False): headphones.CONFIG.MININOVA or headphones.CONFIG.WAFFLES or headphones.CONFIG.RUTRACKER or - headphones.CONFIG.WHATCD or + headphones.CONFIG.APOLLO or headphones.CONFIG.PTH or headphones.CONFIG.STRIKE) @@ -1176,7 +1176,7 @@ def verifyresult(title, artistterm, term, lossless): def searchTorrent(album, new=False, losslessOnly=False, albumlength=None, choose_specific_download=False): - global gazelle # persistent what.cd api object to reduce number of login attempts + global gazelle # persistent apollo.rip api object to reduce number of login attempts global ruobj # and rutracker reldate = album['ReleaseDate'] @@ -1468,9 +1468,9 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None, if rulist: resultlist.extend(rulist) - if headphones.CONFIG.WHATCD: - provider = "What.cd" - providerurl = "http://what.cd/" + if headphones.CONFIG.APOLLO: + provider = "Apollo.rip" + providerurl = "http://apollo.rip/" bitrate = None bitrate_string = bitrate @@ -1493,7 +1493,7 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None, bitrate_string = encoding_string if bitrate_string not in gazelleencoding.ALL_ENCODINGS: logger.info( - u"Your preferred bitrate is not one of the available What.cd filters, so not using it as a search parameter.") + u"Your preferred bitrate is not one of the available Apollo.rip filters, so not using it as a search parameter.") maxsize = 10000000000 elif headphones.CONFIG.PREFERRED_QUALITY == 1 or allow_lossless: # Highest quality including lossless search_formats = [gazelleformat.FLAC, gazelleformat.MP3] @@ -1504,14 +1504,14 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None, if not gazelle or not gazelle.logged_in(): try: - logger.info(u"Attempting to log in to What.cd...") - gazelle = gazelleapi.GazelleAPI(headphones.CONFIG.WHATCD_USERNAME, - headphones.CONFIG.WHATCD_PASSWORD, - headphones.CONFIG.WHATCD_URL) + logger.info(u"Attempting to log in to Apollo.rip...") + gazelle = gazelleapi.GazelleAPI(headphones.CONFIG.APOLLO_USERNAME, + headphones.CONFIG.APOLLO_PASSWORD, + headphones.CONFIG.APOLLO_URL) gazelle._login() except Exception as e: gazelle = None - logger.error(u"What.cd credentials incorrect or site is down. Error: %s %s" % ( + logger.error(u"Apollo.rip credentials incorrect or site is down. Error: %s %s" % ( e.__class__.__name__, str(e))) if gazelle and gazelle.logged_in(): @@ -1593,7 +1593,7 @@ def searchTorrent(album, new=False, losslessOnly=False, albumlength=None, bitrate_string = encoding_string if bitrate_string not in gazelleencoding.ALL_ENCODINGS: logger.info( - u"Your preferred bitrate is not one of the available What.cd filters, so not using it as a search parameter.") + u"Your preferred bitrate is not one of the available PTH filters, so not using it as a search parameter.") maxsize = 10000000000 elif headphones.CONFIG.PREFERRED_QUALITY == 1 or allow_lossless: # Highest quality including lossless search_formats = [gazelleformat.FLAC, gazelleformat.MP3] @@ -2008,7 +2008,7 @@ def preprocess(resultlist): if result[3] == 'Kick Ass Torrents': headers['Referer'] = 'https://torcache.net/' headers['User-Agent'] = USER_AGENT - elif result[3] == 'What.cd': + elif result[3] == 'Apollo.rip': headers['User-Agent'] = 'Headphones' elif result[3] == 'PassTheHeadphones.me': headers['User-Agent'] = 'Headphones' diff --git a/headphones/webserve.py b/headphones/webserve.py index 368a5327..278e512b 100644 --- a/headphones/webserve.py +++ b/headphones/webserve.py @@ -1224,11 +1224,11 @@ class WebInterface(object): "rutracker_user": headphones.CONFIG.RUTRACKER_USER, "rutracker_password": headphones.CONFIG.RUTRACKER_PASSWORD, "rutracker_ratio": headphones.CONFIG.RUTRACKER_RATIO, - "use_whatcd": checked(headphones.CONFIG.WHATCD), - "whatcd_username": headphones.CONFIG.WHATCD_USERNAME, - "whatcd_password": headphones.CONFIG.WHATCD_PASSWORD, - "whatcd_ratio": headphones.CONFIG.WHATCD_RATIO, - "whatcd_url": headphones.CONFIG.WHATCD_URL, + "use_apollo": checked(headphones.CONFIG.APOLLO), + "apollo_username": headphones.CONFIG.APOLLO_USERNAME, + "apollo_password": headphones.CONFIG.APOLLO_PASSWORD, + "apollo_ratio": headphones.CONFIG.APOLLO_RATIO, + "apollo_url": headphones.CONFIG.APOLLO_URL, "use_pth": checked(headphones.CONFIG.PTH), "pth_username": headphones.CONFIG.PTH_USERNAME, "pth_password": headphones.CONFIG.PTH_PASSWORD, @@ -1435,7 +1435,7 @@ class WebInterface(object): "use_newznab", "newznab_enabled", "use_torznab", "torznab_enabled", "use_nzbsorg", "use_omgwtfnzbs", "use_kat", "use_piratebay", "use_oldpiratebay", "use_mininova", "use_waffles", "use_rutracker", - "use_whatcd", "use_strike", "use_tquattrecentonze", "preferred_bitrate_allow_lossless", "detect_bitrate", + "use_apollo", "use_strike", "use_tquattrecentonze", "preferred_bitrate_allow_lossless", "detect_bitrate", "ignore_clean_releases", "freeze_db", "cue_split", "move_files", "rename_files", "correct_metadata", "cleanup_files", "keep_nfo", "add_album_art", "embed_album_art", "embed_lyrics",