Download telebot/plugins/app.py from thenamk3/cc: direct link, hf CLI and curl.
- Browser
- Download file 5.54 kB
-
https://huggingface.co/spaces/thenamk3/cc/resolve/main/telebot/plugins/app.py
- Command line
-
hf download hf://spaces/thenamk3/cc/telebot/plugins/app.py
-
curl -L -o app.py https://huggingface.co/spaces/thenamk3/cc/resolve/main/telebot/plugins/app.py
5.54 kB
| """ | |
| Fetch App Details from Playstore. | |
| .app <app_name> to fetch app details. | |
| .appr <app_name> to fetch app details with Xpl0iter request link. | |
| """ | |
| import bs4 | |
| import requests | |
| from telebot import CMD_HELP | |
| async def apk(event): | |
| app_name = event.pattern_match.group(1) | |
| event = await edit_or_reply(event, "Finding your app!") | |
| try: | |
| remove_space = app_name.split(" ") | |
| final_name = "+".join(remove_space) | |
| page = requests.get( | |
| "https://play.google.com/store/search?q=" + final_name + "&c=apps" | |
| ) | |
| str(page.status_code) | |
| soup = bs4.BeautifulSoup(page.content, "lxml", from_encoding="utf-8") | |
| results = soup.findAll("div", "ZmHEEd") | |
| app_name = ( | |
| results[0].findNext("div", "Vpfmgd").findNext("div", "WsMG1c nnK0zc").text | |
| ) | |
| app_dev = results[0].findNext("div", "Vpfmgd").findNext("div", "KoLSrc").text | |
| app_dev_link = ( | |
| "https://play.google.com" | |
| + results[0].findNext("div", "Vpfmgd").findNext("a", "mnKHRc")["href"] | |
| ) | |
| app_rating = ( | |
| results[0] | |
| .findNext("div", "Vpfmgd") | |
| .findNext("div", "pf5lIe") | |
| .find("div")["aria-label"] | |
| ) | |
| app_link = ( | |
| "https://play.google.com" | |
| + results[0] | |
| .findNext("div", "Vpfmgd") | |
| .findNext("div", "vU6FJ p63iDd") | |
| .a["href"] | |
| ) | |
| app_icon = ( | |
| results[0] | |
| .findNext("div", "Vpfmgd") | |
| .findNext("div", "uzcko") | |
| .img["data-src"] | |
| ) | |
| app_details = "<a href='" + app_icon + "'>📲​</a>" | |
| app_details += " <b>" + app_name + "</b>" | |
| app_details += ( | |
| "\n\n<code>Developer :</code> <a href='" | |
| + app_dev_link | |
| + "'>" | |
| + app_dev | |
| + "</a>" | |
| ) | |
| app_details += "\n<code>Rating :</code> " + app_rating.replace( | |
| "Rated ", "⭐ " | |
| ).replace(" out of ", "/").replace(" stars", "", 1).replace( | |
| " stars", "⭐ " | |
| ).replace( | |
| "five", "5" | |
| ) | |
| app_details += ( | |
| "\n<code>Features :</code> <a href='" | |
| + app_link | |
| + "'>View in Play Store</a>" | |
| ) | |
| app_details += f"\n\n===> TeleBot <===" | |
| await event.edit(app_details, link_preview=True, parse_mode="HTML") | |
| except IndexError: | |
| await event.edit("No result found in search. Please enter **Valid app name**") | |
| except Exception as err: | |
| await event.edit("Exception Occured:- " + str(err)) | |
| async def apkr(event): | |
| app_name = event.pattern_match.group(1) | |
| event = await edit_or_reply(event, "Finding your app!") | |
| try: | |
| remove_space = app_name.split(" ") | |
| final_name = "+".join(remove_space) | |
| page = requests.get( | |
| "https://play.google.com/store/search?q=" + final_name + "&c=apps" | |
| ) | |
| str(page.status_code) | |
| soup = bs4.BeautifulSoup(page.content, "lxml", from_encoding="utf-8") | |
| results = soup.findAll("div", "ZmHEEd") | |
| app_name = ( | |
| results[0].findNext("div", "Vpfmgd").findNext("div", "WsMG1c nnK0zc").text | |
| ) | |
| app_dev = results[0].findNext("div", "Vpfmgd").findNext("div", "KoLSrc").text | |
| app_dev_link = ( | |
| "https://play.google.com" | |
| + results[0].findNext("div", "Vpfmgd").findNext("a", "mnKHRc")["href"] | |
| ) | |
| app_rating = ( | |
| results[0] | |
| .findNext("div", "Vpfmgd") | |
| .findNext("div", "pf5lIe") | |
| .find("div")["aria-label"] | |
| ) | |
| app_link = ( | |
| "https://play.google.com" | |
| + results[0] | |
| .findNext("div", "Vpfmgd") | |
| .findNext("div", "vU6FJ p63iDd") | |
| .a["href"] | |
| ) | |
| app_icon = ( | |
| results[0] | |
| .findNext("div", "Vpfmgd") | |
| .findNext("div", "uzcko") | |
| .img["data-src"] | |
| ) | |
| app_details = "<a href='" + app_icon + "'>📲​</a>" | |
| app_details += " <b>" + app_name + "</b>" | |
| app_details += ( | |
| "\n\n<code>Developer :</code> <a href='" | |
| + app_dev_link | |
| + "'>" | |
| + app_dev | |
| + "</a>" | |
| ) | |
| app_details += "\n<code>Rating :</code> " + app_rating.replace( | |
| "Rated ", "⭐ " | |
| ).replace(" out of ", "/").replace(" stars", "", 1).replace( | |
| " stars", "⭐ " | |
| ).replace( | |
| "five", "5" | |
| ) | |
| app_details += ( | |
| "\n<code>Features :</code> <a href='" | |
| + app_link | |
| + "'>View in Play Store</a>" | |
| ) | |
| app_details += "\n\n<b>Download : </b> <a href='https://t.me/joinchat/JCu-H1NikiYDgNjpjPYd4A'>Request_Here</a>" | |
| app_details += "\n\n===> TeleBot <===" | |
| await event.edit(app_details, link_preview=True, parse_mode="HTML") | |
| except IndexError: | |
| await event.edit("No result found in search. Please enter **Valid app name**") | |
| except Exception as err: | |
| await event.edit("Exception Occured:- " + str(err)) | |
| CMD_HELP.update( | |
| { | |
| "app": ".app <name>\ | |
| \nUse - Search for that app in the play store.\ | |
| \n\n.appr <name>\ | |
| \nUse - Search app, with request more link." | |
| } | |
| ) | |