Skip to content

Commit f8d9429

Browse files
committed
Minor Fixes
1 parent 72fd39b commit f8d9429

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pyUltroid/fns/tools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def is_url_ok(url: str):
160160
async def metadata(file):
161161
out, _ = await bash(f'mediainfo "{_unquote_text(file)}" --Output=JSON')
162162
if _ and _.endswith("NOT_FOUND"):
163-
return _
163+
raise Exception(_)
164164
data = {}
165165
_info = json.loads(out)["media"]["track"]
166166
info = _info[0]
@@ -516,7 +516,7 @@ def telegraph_client():
516516
if TELEGRAPH:
517517
return TELEGRAPH[0]
518518

519-
from .. import udB
519+
from .. import udB, ultroid_bot
520520

521521
token = udB.get_key("_TELEGRAPH_TOKEN")
522522
TelegraphClient = Telegraph(token)

pyUltroid/startup/_database.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
except ImportError:
2424
LOGS.info("Installing 'redis' for database.")
2525
os.system("pip3 install -q redis hiredis")
26+
from redis import Redis
2627
elif Var.MONGO_URI:
2728
try:
2829
from pymongo import MongoClient
@@ -313,10 +314,9 @@ def __repr__(self):
313314

314315
def UltroidDB():
315316
_er = False
317+
from .. import HOSTED_ON
316318
try:
317319
if Redis:
318-
from .. import HOSTED_ON
319-
320320
return RedisDB(
321321
host=Var.REDIS_URI or Var.REDISHOST,
322322
password=Var.REDIS_PASSWORD or Var.REDISPASSWORD,

0 commit comments

Comments
 (0)