Skip to content

Commit

Permalink
Minor Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
New-dev0 committed Aug 30, 2022
1 parent 72fd39b commit f8d9429
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pyUltroid/fns/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pyUltroid/startup/_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
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
Expand Down Expand Up @@ -313,10 +314,9 @@ def __repr__(self):

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,
Expand Down

0 comments on commit f8d9429

Please sign in to comment.