mirror of
https://github.com/tgbot-collection/ytdlbot.git
synced 2025-02-26 00:05:32 +08:00
supress error
This commit is contained in:
parent
941cc069cb
commit
dd0627c045
1 changed files with 5 additions and 2 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
__author__ = "Benny <benny.think@gmail.com>"
|
||||
|
||||
import contextlib
|
||||
import logging
|
||||
import os
|
||||
import random
|
||||
|
@ -354,8 +355,10 @@ def link_checker(url: str) -> str:
|
|||
|
||||
if re.findall(r"m3u8|\.m3u8|\.m3u$", url.lower()):
|
||||
return "m3u8 links are disabled."
|
||||
if ytdl.extract_info(url, download=False).get("live_status") == "is_live":
|
||||
return "Live stream links are disabled. Please download it after the stream ends."
|
||||
|
||||
with contextlib.suppress(yt_dlp.utils.DownloadError):
|
||||
if ytdl.extract_info(url, download=False).get("live_status") == "is_live":
|
||||
return "Live stream links are disabled. Please download it after the stream ends."
|
||||
|
||||
|
||||
@app.on_message(filters.incoming & filters.text)
|
||||
|
|
Loading…
Reference in a new issue