Skip to content

Commit 512b710

Browse files
Update apksearch.py
1 parent 63f9a86 commit 512b710

File tree

1 file changed

+54
-11
lines changed

1 file changed

+54
-11
lines changed

info/apksearch.py

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,52 +23,70 @@
2323

2424
import_library("apksearch")
2525

26-
from apksearch import APKPure, APKMirror, AppTeka, APKCombo, APKFab
26+
from apksearch import APKPure, APKMirror, AppTeka, APKCombo, APKFab, APKad, Aptoide
2727

2828

2929
def search_apkmirror(query: str) -> str:
3030
apkmirror = APKMirror(query)
3131
result = apkmirror.search_apk()
3232
if result:
3333
title, apk_link = result
34-
return f"<b>{title}</b>:{apk_link}"
35-
return "<code>No results found</code>"
34+
return f"APKMirror:\n<b>{title}</b>:{apk_link}"
35+
return "APKMirror:<code>No results found</code>"
3636

3737

3838
def search_apkpure(query: str) -> str:
3939
apkpure = APKPure(query)
4040
result = apkpure.search_apk()
4141
if result:
4242
title, apk_link = result
43-
return f"<b>{title}</b>:{apk_link}"
44-
return "<code>No results found</code>"
43+
return f"APKPure:\n<b>{title}</b>:{apk_link}"
44+
return "APKPure:<code>No results found</code>"
4545

4646

4747
def search_appteka(query: str) -> str:
4848
appteka = AppTeka(query)
4949
result = appteka.search_apk()
5050
if result:
5151
title, apk_link = result
52-
return f"<b>{title}</b>:{apk_link}"
53-
return "<code>No results found</code>"
52+
return f"AppTeka:\n<b>{title}</b>:{apk_link}"
53+
return "AppTeka:<code>No results found</code>"
5454

5555

5656
def search_apkcombo(query: str) -> str:
5757
apkcombo = APKCombo(query)
5858
result = apkcombo.search_apk()
5959
if result:
6060
title, apk_link = result
61-
return f"<b>{title}</b>:{apk_link}"
62-
return "<code>No results found</code>"
61+
return f"APKCombo:\n<b>{title}</b>:{apk_link}"
62+
return "APKCombo:<code>No results found</code>"
6363

6464

6565
def search_apkfab(query: str) -> str:
6666
apkfab = APKFab(query)
6767
result = apkfab.search_apk()
6868
if result:
6969
title, apk_link = result
70-
return f"<b>{title}</b>:{apk_link}"
71-
return "<code>No results found</code>"
70+
return f"APKFab:\n<b>{title}</b>:{apk_link}"
71+
return "APKFab:<code>No results found</code>"
72+
73+
74+
def search_apkad(query: str) -> str:
75+
apkad = APKad(query)
76+
result = apkad.search_apk()
77+
if result:
78+
title, apk_link = result
79+
return f"APKad:\n<b>{title}</b>:{apk_link}"
80+
return "APKad:<code>No results found</code>"
81+
82+
83+
def search_aptoide(query: str) -> str:
84+
aptoide = Aptoide(query)
85+
result = aptoide.search_apk()
86+
if result:
87+
title, apk_link = result
88+
return f"Aptoide:\n<b>{title}</b>:{apk_link}"
89+
return "Aptoide:<code>No results found</code>"
7290

7391

7492
def apksearch(query: str) -> str:
@@ -77,12 +95,16 @@ def apksearch(query: str) -> str:
7795
appteka_result = search_appteka(query)
7896
apkcombo_result = search_apkcombo(query)
7997
apkfab_result = search_apkfab(query)
98+
apkad_result = search_apkad(query)
99+
aptoide_result = search_aptoide(query)
80100
results = [
81101
apkmirror_result,
82102
apkpure_result,
83103
appteka_result,
84104
apkcombo_result,
85105
apkfab_result,
106+
apkad_result,
107+
aptoide_result,
86108
]
87109
return "\n\n".join(results)
88110

@@ -132,11 +154,30 @@ async def appteka(_, message: Message):
132154
await message.edit_text(result, disable_web_page_preview=True)
133155

134156

157+
@Client.on_message(filters.command("apkad", prefix) & filters.me)
158+
async def appteka(_, message: Message):
159+
if len(message.command) > 2:
160+
return await message.edit("<code>No query provided</code>")
161+
query = message.text.split(maxsplit=1)[1]
162+
result = search_apkad(query)
163+
await message.edit_text(result, disable_web_page_preview=True)
164+
165+
166+
@Client.on_message(filters.command("aptoide", prefix) & filters.me)
167+
async def appteka(_, message: Message):
168+
if len(message.command) > 2:
169+
return await message.edit("<code>No query provided</code>")
170+
query = message.text.split(maxsplit=1)[1]
171+
result = search_aptoide(query)
172+
await message.edit_text(result, disable_web_page_preview=True)
173+
174+
135175
@Client.on_message(filters.command("apksearch", prefix) & filters.me)
136176
async def apks(_, message: Message):
137177
if len(message.command) > 2:
138178
return await message.edit("<code>No query provided</code>")
139179
query = message.text.split(maxsplit=1)[1]
180+
await message.edit("<code>Searching...</code>")
140181
result = apksearch(query)
141182
await message.edit_text(result, disable_web_page_preview=True)
142183

@@ -147,5 +188,7 @@ async def apks(_, message: Message):
147188
"appteka [package_name]*": "Search for an apk on appteka",
148189
"apksearch [package_name]*": "Search for an apk on apksearch",
149190
"apkpure [package_name]*": "Search for an apk on apkpure",
191+
"aptoide [package_name]*": "Search for an apk on aptoide",
192+
"apkad [package_name]*": "Search for an apk on apkad",
150193
"apksearch [package_name]*": "Search for an apk on all supported sources",
151194
}

0 commit comments

Comments
 (0)