peertube api url in config file

This commit is contained in:
localhost_frssoft 2024-07-14 19:04:04 +03:00
parent 973e25adfa
commit e696eaa375
2 changed files with 5 additions and 2 deletions

View File

@ -2,6 +2,9 @@ admins_bot = ('drq@mastodon.ml',) # Адреса админов бота, кот
# Example: ('admin_user', 'another_admin_user2@example.example') or ('admin_user',) # Example: ('admin_user', 'another_admin_user2@example.example') or ('admin_user',)
bot_acct = 'fmn' # Ник бота на инстансе bot_acct = 'fmn' # Ник бота на инстансе
instance = 'pleroma.dark-alexandr.net' # Инстанс, где будет запущен бот instance = 'pleroma.dark-alexandr.net' # Инстанс, где будет запущен бот
# Ссылка на live stream FMN (API)
peertube_strean_url = 'https://xxivproduction.video/api/v1/videos/1FZeVVVzWBFShaxQVkYiXd'
# Лимиты # Лимиты
limit_movies_per_user = 2 # Ограничение количества фильмов на одного пользователя limit_movies_per_user = 2 # Ограничение количества фильмов на одного пользователя

View File

@ -1,7 +1,7 @@
from src.fedi_api import get_notifications, mark_as_read_notification, post_status, upload_attachment 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.fmn_states_db import write_states, states_stor
from src.sheduler import check_stop_thread_scan 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 threading
import time import time
@ -15,7 +15,7 @@ from loguru import logger
@logger.catch @logger.catch
def get_peertube_stream_name(): def get_peertube_stream_name():
try: 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: except Exception as E:
return f"[не удалось получить название {E}]" return f"[не удалось получить название {E}]"