Skip to content

Commit

Permalink
Fixes v0.0.6 2021/05/09
Browse files Browse the repository at this point in the history
* PluginChannel Error Fixed

* Fixed Stop autoname + minor bugs


Co-authored-by: Anonymous <[email protected]>
  • Loading branch information
1Danish-00 and New-dev0 authored May 8, 2021
1 parent 702dfab commit 427b6f5
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 39 deletions.
8 changes: 4 additions & 4 deletions plugins/autopic.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ async def autopic(e):
await eor(e, get_string("autopic_3").format(search))
udB.set("AUTOPIC", "True")
while True:
ge = udB.get("AUTOPIC")
if not ge == "True":
return
for lie in clls:
ge = udB.get("AUTOPIC")
if not ge == "True":
return
au = "https://unsplash.com" + lie["href"]
et = await ultroid_bot(getweb(au))
try:
Expand All @@ -56,7 +56,7 @@ async def autopic(e):
file = await ultroid_bot.upload_file(kar)
await ultroid_bot(UploadProfilePhotoRequest(file))
os.remove(kar)
await asyncio.sleep(1100)
await asyncio.sleep(1111)


@ultroid_cmd(pattern="stoppic$")
Expand Down
File renamed without changes.
32 changes: 28 additions & 4 deletions plugins/fakeaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ async def _(e):
if not (t or t.isdigit()):
t = 100
else:
t = int(t)
try:
t = int(t)
except BaseException:
try:
t = await ban_time(e, t)
except BaseException:
return await eod(e, "`Incorrect Format`")
await eod(e, f"Starting Fake Typing For {t} sec.")
async with e.client.action(e.chat_id, "typing"):
await asyncio.sleep(t)
Expand All @@ -42,7 +48,13 @@ async def _(e):
if not (t or t.isdigit()):
t = 100
else:
t = int(t)
try:
t = int(t)
except BaseException:
try:
t = await ban_time(e, t)
except BaseException:
return await eod(e, "`Incorrect Format`")
await eod(e, f"Starting Fake audio recording For {t} sec.")
async with e.client.action(e.chat_id, "record-audio"):
await asyncio.sleep(t)
Expand All @@ -54,7 +66,13 @@ async def _(e):
if not (t or t.isdigit()):
t = 100
else:
t = int(t)
try:
t = int(t)
except BaseException:
try:
t = await ban_time(e, t)
except BaseException:
return await eod(e, "`Incorrect Format`")
await eod(e, f"Starting Fake video recording For {t} sec.")
async with e.client.action(e.chat_id, "record-video"):
await asyncio.sleep(t)
Expand All @@ -66,7 +84,13 @@ async def _(e):
if not (t or t.isdigit()):
t = 100
else:
t = int(t)
try:
t = int(t)
except BaseException:
try:
t = await ban_time(e, t)
except BaseException:
return await eod(e, "`Incorrect Format`")
await eod(e, f"Starting Fake Game Playing For {t} sec.")
async with e.client.action(e.chat_id, "game"):
await asyncio.sleep(t)
Expand Down
44 changes: 28 additions & 16 deletions plugins/pdftools.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import os
import shutil
import time

import cv2
import imutils
Expand All @@ -47,16 +48,25 @@
async def pdfseimg(event):
ok = await event.get_reply_message()
msg = event.pattern_match.group(1)
if not ok and ok.document and ok.document.mime_type == "application/pdf":
if not (ok and (ok.document and (ok.document.mime_type == "application/pdf"))):
await eor(event, "`Reply The pdf u Want to Download..`")
return
xx = await eor(event, "Processing...")
file = ok.media.document
k = time.time()
filename = "hehe.pdf"
result = await downloader(
"pdf/" + filename,
file,
xx,
k,
"Downloading " + filename + "...",
)
await result.delete()
pdfp = "pdf/hehe.pdf"
pdfp.replace(".pdf", "")
pdf = PdfFileReader(pdfp)
if not msg:
d = os.path.join("pdf/", "hehe.pdf")
await event.client.download_media(ok, d)
pdfp = "pdf/hehe.pdf"
pdfp.replace(".pdf", "")
pdf = PdfFileReader(pdfp)
for num in range(pdf.numPages):
pw = PdfFileWriter()
pw.addPage(pdf.getPage(num))
Expand All @@ -72,11 +82,6 @@ async def pdfseimg(event):
await xx.delete()
if msg:
o = int(msg) - 1
d = os.path.join("pdf/", "hehe.pdf")
await event.client.download_media(ok, d)
pdfp = "pdf/hehe.pdf"
pdfp.replace(".pdf", "")
pdf = PdfFileReader(pdfp)
pw = PdfFileWriter()
pw.addPage(pdf.getPage(o))
with open(os.path.join("ult.png"), "wb") as f:
Expand All @@ -88,7 +93,6 @@ async def pdfseimg(event):
reply_to=event.reply_to_msg_id,
)
os.remove("ult.png")
await xx.delete()


@ultroid_cmd(
Expand All @@ -101,8 +105,19 @@ async def pdfsetxt(event):
await eor(event, "`Reply The pdf u Want to Download..`")
return
xx = await eor(event, "`Processing...`")
file = ok.media.document
k = time.time()
filename = ok.file.name
result = await downloader(
filename,
file,
xx,
k,
"Downloading " + filename + "...",
)
await result.delete()
dl = result.name
if not msg:
dl = await event.client.download_media(ok)
pdf = PdfFileReader(dl)
text = f"{dl.split('.')[0]}.txt"
with open(text, "w") as f:
Expand All @@ -123,7 +138,6 @@ async def pdfsetxt(event):
return
if "_" in msg:
u, d = msg.split("_")
dl = await event.client.download_media(ok)
a = PdfFileReader(dl)
str = ""
for i in range(int(u) - 1, int(d)):
Expand All @@ -140,7 +154,6 @@ async def pdfsetxt(event):
os.remove(dl)
else:
u = int(msg) - 1
dl = await event.client.download_media(ok)
a = PdfFileReader(dl)
str = a.getPage(u).extractText()
text = f"{dl.split('.')[0]} Pg-{msg}.txt"
Expand All @@ -153,7 +166,6 @@ async def pdfsetxt(event):
)
os.remove(text)
os.remove(dl)
await xx.delete()


@ultroid_cmd(
Expand Down
2 changes: 1 addition & 1 deletion plugins/saavn.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async def siesace(e):
try:
k = (r.get(url)).json()[0]
except IndexError:
return await eod(e, "`Song Not Found.. `")
return await eod(lol, "`Song Not Found.. `")
title = k["song"]
urrl = k["media_url"]
img = k["image"]
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
py-Ultroid==2021.5.8
py-Ultroid==2021.5.9
42 changes: 29 additions & 13 deletions resources/extras/local-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,47 @@
# Local Requirements.

asyncurban
carbonnow
cairosvg
emoji
git+https://github.com/buddhhu/search-engine-parser.git
git+https://github.com/ProgrammingError/rextester_py.git
GitPython
google-api-python-client==1.7.11
googletrans==3.1.0a0
heroku3
httplib2==0.13.1
html-telegraph-poster
googletrans==4.0.0rc1
git+https://github.com/ProgrammingError/heroku3.py
imutils
lottie
lxml
moviepy
numpy
oauth2client==4.1.3
opencv-python-headless
Pillow>=7.0.0
play-scraper
psutil
py-Ultroid
pyaml
PyDictionary
PyPDF2
psutil
pytz
requests>=2.18.4
scikit-image
speedtest-cli==2.1.2
selenium
speedtest-cli==2.1.3
telegraph
validators
youtube-search-python
youtube_dl
youtube-search-python
google-api-python-client==1.7.11
google-auth==1.27.1
google-auth-httplib2==0.0.4
google-auth-oauthlib==0.4.4
googletrans==4.0.0rc1
oauth2client==4.1.3
httplib2==0.13.1
git+https://github.com/buddhhu/search-engine-parser.git
git+https://github.com/buddhhu/ofox.git
google-assistant-grpc
tenacity
google-assistant-sdk
gingerit
html-telegraph-poster
pyyaml
hachoir
aria2p
gdown

0 comments on commit 427b6f5

Please sign in to comment.