Minor Fixes

This commit is contained in:
Devesh Pal
2022-08-30 20:20:06 +05:30
parent 72fd39b153
commit f8d9429e7e
2 changed files with 4 additions and 4 deletions

View File

@@ -160,7 +160,7 @@ def is_url_ok(url: str):
async def metadata(file):
out, _ = await bash(f'mediainfo "{_unquote_text(file)}" --Output=JSON')
if _ and _.endswith("NOT_FOUND"):
return _
raise Exception(_)
data = {}
_info = json.loads(out)["media"]["track"]
info = _info[0]
@@ -516,7 +516,7 @@ def telegraph_client():
if TELEGRAPH:
return TELEGRAPH[0]
from .. import udB
from .. import udB, ultroid_bot
token = udB.get_key("_TELEGRAPH_TOKEN")
TelegraphClient = Telegraph(token)

View File

@@ -23,6 +23,7 @@ if (Var.REDIS_URI or Var.REDISHOST):
except ImportError:
LOGS.info("Installing 'redis' for database.")
os.system("pip3 install -q redis hiredis")
from redis import Redis
elif Var.MONGO_URI:
try:
from pymongo import MongoClient
@@ -313,10 +314,9 @@ class LocalDB(_BaseDatabase):
def UltroidDB():
_er = False
from .. import HOSTED_ON
try:
if Redis:
from .. import HOSTED_ON
return RedisDB(
host=Var.REDIS_URI or Var.REDISHOST,
password=Var.REDIS_PASSWORD or Var.REDISPASSWORD,