'name': 'Links', 'value': "[MyAnimeList]({}) | [Anilist]({}) | [Kitsu]({})".format( str.strip(_MAL_ANI_BASE + str(hisha.id_mal)), str.strip(_ANI_ANI_BASE + str(hisha.id)), str.strip(_KIT_ANI_BASE + str(hisha.id_kitsu))) }) webhook['embeds'].append(embed) return webhook # Retry on all instances except @retry(delay=60, backoff=1.5, max_delay=3600, logger=Ayumi.get_logger()) def consume(): try: with rabbitpy.Connection( 'amqp://{username}:{password}@{host}:{port}/{vhost}'.format( username=settings.get('RABBITMQ_USERNAME'), password=settings.get('RABBITMQ_PASSWORD'), host=settings.get('RABBITMQ_HOST'), port=settings.get('RABBITMQ_PORT'), vhost=settings.get('RABBITMQ_VHOST'))) as conn: with conn.channel() as channel: Ayumi.set_rabbitpy_channel(channel) queue = rabbitpy.Queue( channel,
Ayumi.info('Detected new creation event under path "{}", running preflight checks.'.format(event.src_path), color=Ayumi.LCYAN) # Do not process new directory events if event.is_directory: Ayumi.info('Detected new event directory under path "{}", ignoring.'.format(event.src_path), color=Ayumi.LYELLOW) return if not os.path.exists(event.src_path): Ayumi.info("Event detected as false positive, will not proceed.", color=Ayumi.LYELLOW) return Ayumi.info("Preflight check good, starting pipeline.", color=Ayumi.LGREEN) on_new_file(event.src_path, self.channel) @retry(delay=60, tries=3, exceptions=(shikyou.ShikyouResponseException, shikyou.ShikyouTimeoutException), backoff=1.5, max_delay=3600, logger=Ayumi.get_logger()) def on_new_file(src_path, channel): show_name = None episode_name = None new_file = src_path.replace(os.path.commonpath([settings.get('KOTEN_WATCH_PATH', DEFAULT_WATCH_PATH), src_path]) + "/", "") if m := util._show_manually_specified(new_file): Ayumi.info("Detected show name and episode name in event, using Mode 1.") show_name = m.group(1) episode_name = util._clean_episode_name(m.group(2)) Ayumi.info("New show name: {}".format(show_name), color=Ayumi.LYELLOW) Ayumi.info("New episode name: {}".format(episode_name), color=Ayumi.LYELLOW) else: Ayumi.debug("Non-conformant episode provided, using Naomi to find show name.")