mirror of
https://github.com/anasty17/mirror-leech-telegram-bot.git
synced 2025-01-08 12:07:33 +08:00
Hide pymongo info logs
Signed-off-by: anasty17 <e.anastayyar@gmail.com>
This commit is contained in:
parent
3145af0416
commit
0fd663c8f4
@ -35,6 +35,7 @@ getLogger("requests").setLevel(INFO)
|
||||
getLogger("urllib3").setLevel(INFO)
|
||||
getLogger("pyrogram").setLevel(ERROR)
|
||||
getLogger("httpx").setLevel(ERROR)
|
||||
getLogger("pymongo").setLevel(ERROR)
|
||||
|
||||
botStartTime = time()
|
||||
|
||||
|
@ -937,11 +937,11 @@ def gofile(url):
|
||||
"Accept": "*/*",
|
||||
"Connection": "keep-alive",
|
||||
}
|
||||
__url = f"https://api.gofile.io/accounts"
|
||||
__url = "https://api.gofile.io/accounts"
|
||||
try:
|
||||
__res = session.post(__url, headers=headers).json()
|
||||
if __res["status"] != "ok":
|
||||
raise DirectDownloadLinkException(f"ERROR: Failed to get token.")
|
||||
raise DirectDownloadLinkException("ERROR: Failed to get token.")
|
||||
return __res["data"]["token"]
|
||||
except Exception as e:
|
||||
raise e
|
||||
|
@ -120,12 +120,11 @@ async def add_jd_download(listener, path):
|
||||
elif odl := await retry_function(
|
||||
jdownloader.device.linkgrabber.query_packages, [{}]
|
||||
):
|
||||
odl_list = [
|
||||
if odl_list := [
|
||||
od["uuid"]
|
||||
for od in odl
|
||||
if od.get("saveTo", "").startswith("/root/Downloads/")
|
||||
]
|
||||
if odl_list:
|
||||
]:
|
||||
await retry_function(
|
||||
jdownloader.device.linkgrabber.remove_links,
|
||||
package_ids=odl_list,
|
||||
|
@ -6,12 +6,16 @@ from logging import (
|
||||
basicConfig,
|
||||
error as log_error,
|
||||
info as log_info,
|
||||
getLogger,
|
||||
ERROR,
|
||||
)
|
||||
from os import path, environ, remove
|
||||
from pymongo.mongo_client import MongoClient
|
||||
from pymongo.server_api import ServerApi
|
||||
from subprocess import run as srun
|
||||
|
||||
getLogger("pymongo").setLevel(ERROR)
|
||||
|
||||
if path.exists("log.txt"):
|
||||
with open("log.txt", "r+") as f:
|
||||
f.truncate(0)
|
||||
|
Loading…
Reference in New Issue
Block a user