From e696eaa3750d8cc709f4f13867d3127cb9959d33 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sun, 14 Jul 2024 19:04:04 +0300 Subject: [PATCH] peertube api url in config file --- config.py.example | 3 +++ src/listener_mention.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.py.example b/config.py.example index 9606728..b602e53 100644 --- a/config.py.example +++ b/config.py.example @@ -2,6 +2,9 @@ admins_bot = ('drq@mastodon.ml',) # Адреса админов бота, кот # Example: ('admin_user', 'another_admin_user2@example.example') or ('admin_user',) bot_acct = 'fmn' # Ник бота на инстансе instance = 'pleroma.dark-alexandr.net' # Инстанс, где будет запущен бот +# Ссылка на live stream FMN (API) +peertube_strean_url = 'https://xxivproduction.video/api/v1/videos/1FZeVVVzWBFShaxQVkYiXd' + # Лимиты limit_movies_per_user = 2 # Ограничение количества фильмов на одного пользователя diff --git a/src/listener_mention.py b/src/listener_mention.py index db38831..e016dd3 100644 --- a/src/listener_mention.py +++ b/src/listener_mention.py @@ -1,7 +1,7 @@ from src.fedi_api import get_notifications, mark_as_read_notification, post_status, upload_attachment from src.fmn_states_db import write_states, states_stor from src.sheduler import check_stop_thread_scan -from config import admins_bot, limit_movies_per_user, limit_all_movies_poll, hour_poll_posting, fmn_next_watching_hour +from config import admins_bot, limit_movies_per_user, limit_all_movies_poll, hour_poll_posting, fmn_next_watching_hour, peertube_strean_url import threading import time @@ -15,7 +15,7 @@ from loguru import logger @logger.catch def get_peertube_stream_name(): try: - return requests.get("https://xxivproduction.video/api/v1/videos/1FZeVVVzWBFShaxQVkYiXd").json()['name'] + return requests.get(peertube_strean_url).json()['name'] except Exception as E: return f"[не удалось получить название {E}]"