mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-03 11:04:51 +00:00
Add subdl beta
This commit is contained in:
parent
294b359d75
commit
41a45dc95c
1 changed files with 11 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import logging
|
import logging, os
|
||||||
|
|
||||||
import cloudscraper
|
import cloudscraper
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
@ -185,4 +185,13 @@ async def dlsub_callback(client, callback_query):
|
||||||
await callback_query.answer("Invalid callback data, please send CMD again..")
|
await callback_query.answer("Invalid callback data, please send CMD again..")
|
||||||
await asyncio.sleep(3)
|
await asyncio.sleep(3)
|
||||||
return await callback_query.message.delete()
|
return await callback_query.message.delete()
|
||||||
await editPesan(callback_query.message, link, disable_web_page_preview=True)
|
scraper = cloudscraper.create_scraper()
|
||||||
|
req = scraper.get("https://subscene.com/subtitles/the-big-bang-theory-first-season/english/136037").text
|
||||||
|
soup = BeautifulSoup(req,"lxml")
|
||||||
|
judul = soup.find("div", {"class": "bread"}).find("a").get("href").split("/")[4]
|
||||||
|
downloadlink = soup.find("div", {"class": "download"}).find('a')
|
||||||
|
download = 'https://subscene.com'+downloadlink['href']
|
||||||
|
dl = scraper.get(download)
|
||||||
|
open(f"{judul}.zip", "wb").write(dl.content)
|
||||||
|
await callback_query.message.reply_document(f"{judul}.zip")
|
||||||
|
os.remove(f"{judul}.zip")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue