def parse(announcement): global name if 'TV' not in announcement: return decolored = utils.strip_irc_color_codes(announcement) # extract required information from announcement torrent_title = utils.substr(decolored, '] ', ' (', True) torrent_id = utils.get_id(decolored, 0) # pass announcement to sonarr if torrent_id is not None and torrent_title is not None: download_link = get_torrent_link( torrent_id, utils.replace_spaces(torrent_title, '.')) announced = db.Announced(date=datetime.datetime.now(), title=utils.replace_spaces( torrent_title, '.'), indexer=name, torrent=download_link) approved = sonarr.wanted(torrent_title, download_link, name) if approved: logger.debug("Sonarr approved release: %s", torrent_title) snatched = db.Snatched(date=datetime.datetime.now(), title=utils.replace_spaces( torrent_title, '.'), indexer=name, torrent=download_link) else: logger.debug("Sonarr rejected release: %s", torrent_title)
def parse(announcement): global name decolored = utils.strip_irc_color_codes(announcement) if '!new ' not in decolored: return # extract required information from announcement torrent_title = utils.replace_spaces( utils.substr(decolored, '!new ', ' | ', True), '.') torrent_id = utils.substr(decolored, '?id=', '&', True) if '| TV/' in decolored: notify_pvr(torrent_id, torrent_title, auth_key, torrent_pass, name, 'Sonarr') elif '| Movies/' in decolored: notify_pvr(torrent_id, torrent_title, auth_key, torrent_pass, name, 'Radarr')
def parse(announcement): global name decolored = utils.strip_irc_color_codes(announcement) if 'https://pretome.info/details.php' not in decolored: return # extract required information from announcement torrent_substr = utils.substr(decolored, '] ', ' https', True) torrent_title = utils.replace_spaces( utils.substr(torrent_substr, '', ' ::', True), '.') torrent_id = utils.get_id(decolored, 0) if 'TV|' in decolored: notify_pvr(torrent_id, torrent_title, auth_key, torrent_pass, name, 'Sonarr') elif 'Movies|' in decolored: notify_pvr(torrent_id, torrent_title, auth_key, torrent_pass, name, 'Radarr')
def parse(announcement): global name decolored = utils.strip_irc_color_codes(announcement) if 'New Torrent Announcement: <' not in decolored: return # extract required information from announcement torrent_title = utils.replace_spaces(utils.substr(decolored, 'Name:\'', '\' uploaded', True), '.') torrent_id = decolored.split('/')[-1] if '<TV ::' in decolored: notify_pvr(torrent_id, torrent_title, auth_key, torrent_pass, name, 'Sonarr') elif '<Movies ::' in decolored: notify_pvr(torrent_id, torrent_title, auth_key, torrent_pass, name, 'Radarr')
def parse(announcement): global name decolored = utils.strip_irc_color_codes(announcement) if 'https://beyond-hd.me/torrents/autodl' not in decolored: return # extract required information from announcement torrent_title = utils.substr(decolored, 'New Torrent: ', ' Category:', True) torrent_id = utils.get_id(decolored, 0) if 'Category: TV' in decolored: notify_pvr(torrent_id, torrent_title, auth_key, torrent_pass, name, 'Sonarr') elif 'Category: Movies' in decolored: notify_pvr(torrent_id, torrent_title, auth_key, torrent_pass, name, 'Radarr')
def parse(announcement): global name decolored = utils.strip_irc_color_codes(announcement) if ' - http://www.iptorrents.com/details.php?id=' not in decolored: return # extract required information from announcement torrent_title = utils.replace_spaces( utils.substr(decolored, '] ', ' - http', True), '.') torrent_id = utils.get_id(decolored, 0) if 'TV/' in decolored: notify_pvr(torrent_id, torrent_title, auth_key, torrent_pass, name, 'Sonarr') elif 'Movie/' in decolored: notify_pvr(torrent_id, torrent_title, auth_key, torrent_pass, name, 'Radarr')
def parse(announcement): global name, torrent_title decolored = utils.strip_irc_color_codes(announcement) # extract required information from decolored if 'NOW BROADCASTING' in decolored: torrent_title = utils.substr(decolored, '[ ', ' ]', True) torrent_id = utils.get_id(decolored, 1) # pass announcement to sonarr if torrent_id is not None and torrent_title is not None: download_link = get_torrent_link( torrent_id, utils.replace_spaces(torrent_title, '.')) announced = db.Announced(date=datetime.datetime.now(), title=utils.replace_spaces( torrent_title, '.'), indexer=name, torrent=download_link, pvr='Sonarr') if delay > 0: logger.debug("Waiting %s seconds to check %s", delay, torrent_title) time.sleep(delay) approved = sonarr.wanted(torrent_title, download_link, name) if approved: logger.debug("Sonarr approved release: %s", torrent_title) snatched = db.Snatched(date=datetime.datetime.now(), title=utils.replace_spaces( torrent_title, '.'), indexer=name, torrent=download_link) else: logger.debug("Sonarr rejected release: %s", torrent_title) torrent_title = None