diff --git a/requirements.txt b/requirements.txt index 61341ca..4d0dc0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -22,4 +22,3 @@ ffpb==0.4.1 youtube-search-python==1.6.6 token-bucket==0.3.0 coloredlogs==15.0.1 -sentry-sdk==1.29.2 diff --git a/ytdlbot/config.py b/ytdlbot/config.py index 67200b5..c432d44 100644 --- a/ytdlbot/config.py +++ b/ytdlbot/config.py @@ -63,5 +63,4 @@ TOKEN_PRICE = os.getenv("BUY_UNIT", 20) # one USD=20 credits RATE_LIMIT = os.getenv("RATE_LIMIT", 20) -DSN = os.getenv("DSN") SS_YOUTUBE = os.getenv("SS_YOUTUBE", "https://ytdlbot.dmesg.app?token=123456") diff --git a/ytdlbot/tasks.py b/ytdlbot/tasks.py index 89516cf..a8215c8 100644 --- a/ytdlbot/tasks.py +++ b/ytdlbot/tasks.py @@ -26,21 +26,18 @@ import filetype import psutil import pyrogram.errors import requests -import sentry_sdk from apscheduler.schedulers.background import BackgroundScheduler from celery import Celery from celery.worker.control import Panel from pyrogram import Client, idle, types from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message from requests_toolbelt import MultipartEncoder, MultipartEncoderMonitor -from sentry_sdk.integrations.celery import CeleryIntegration from channel import Channel from client_init import create_app from config import ( ARCHIVE_ID, BROKER, - DSN, ENABLE_CELERY, ENABLE_QUEUE, ENABLE_VIP, @@ -74,8 +71,6 @@ channel = Channel() session = "ytdl-celery" celery_client = create_app(session) -if DSN: - sentry_sdk.init(DSN, integrations=[CeleryIntegration()]) def get_messages(chat_id, message_id): diff --git a/ytdlbot/ytdl_bot.py b/ytdlbot/ytdl_bot.py index 246d078..fa6305c 100644 --- a/ytdlbot/ytdl_bot.py +++ b/ytdlbot/ytdl_bot.py @@ -20,7 +20,6 @@ from io import BytesIO import pyrogram.errors import requests -import sentry_sdk import yt_dlp from apscheduler.schedulers.background import BackgroundScheduler from pyrogram import Client, filters, types @@ -34,7 +33,6 @@ from channel import Channel from client_init import create_app from config import ( AUTHORIZED_USER, - DSN, ENABLE_CELERY, ENABLE_FFMPEG, ENABLE_VIP, @@ -66,8 +64,6 @@ app = create_app(session) logging.info("Authorized users are %s", AUTHORIZED_USER) redis = Redis() channel = Channel() -if DSN: - sentry_sdk.init(dsn=DSN) def private_use(func): @@ -355,12 +351,8 @@ def link_checker(url: str) -> str: return "" ytdl = yt_dlp.YoutubeDL() - if ( - not PLAYLIST_SUPPORT - and ( - re.findall(r"^https://www\.youtube\.com/channel/", Channel.extract_canonical_link(url)) - or "list" in url - ) + if not PLAYLIST_SUPPORT and ( + re.findall(r"^https://www\.youtube\.com/channel/", Channel.extract_canonical_link(url)) or "list" in url ): return "Playlist or channel links are disabled."