mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-09 05:04:50 +00:00
Compare commits
No commits in common. "47fbee67d25e1aff985026847b4703afa0277a20" and "cc33e7c95025bb6f0b6f25a9206245e23e5eda95" have entirely different histories.
47fbee67d2
...
cc33e7c950
1 changed files with 0 additions and 575 deletions
|
|
@ -36,9 +36,6 @@ __HELP__ = """
|
||||||
/klikxxi [query <optional>] - Scrape website data from Klikxxi aka GoMov.
|
/klikxxi [query <optional>] - Scrape website data from Klikxxi aka GoMov.
|
||||||
/samehadaku [query <optional>] - Scrape website data from Samehadaku.
|
/samehadaku [query <optional>] - Scrape website data from Samehadaku.
|
||||||
/nodrakor [query <optional>] - Scrape website data from NoDrakor
|
/nodrakor [query <optional>] - Scrape website data from NoDrakor
|
||||||
/nunadrama [query <optional>] - Scrape website data from NunaDrama
|
|
||||||
/dutamovie [query <optional>] - Scrape website data from DutaMovie
|
|
||||||
/pusatfilm [query <optional>] - Scrape website data from Pusatfilm21
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
LOGGER = logging.getLogger("MissKaty")
|
LOGGER = logging.getLogger("MissKaty")
|
||||||
|
|
@ -62,9 +59,6 @@ web = {
|
||||||
"samehadaku": "https://samehadaku.help",
|
"samehadaku": "https://samehadaku.help",
|
||||||
"oplovers": "https://oploverz.red",
|
"oplovers": "https://oploverz.red",
|
||||||
"nodrakor": "https://no-drakor.xyz",
|
"nodrakor": "https://no-drakor.xyz",
|
||||||
"nunadrama": "https://tv.nunadrama.store",
|
|
||||||
"dutamovie": "https://yborfilmfestival.com",
|
|
||||||
"pusatfilm": "http://85.203.26.50"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -391,171 +385,6 @@ async def getDataSavefilm21(msg, kueri, CurrentPage, user, strings):
|
||||||
return sfResult, PageLen, extractbtn
|
return sfResult, PageLen, extractbtn
|
||||||
|
|
||||||
|
|
||||||
# NunaDrama GetData
|
|
||||||
async def getDataNunaDrama(msg, kueri, CurrentPage, user, strings):
|
|
||||||
if not SCRAP_DICT.get(msg.id):
|
|
||||||
with contextlib.redirect_stdout(sys.stderr):
|
|
||||||
try:
|
|
||||||
nunafetch = await fetch.get(
|
|
||||||
f"{web['nunadrama']}/?s={kueri}", follow_redirects=True
|
|
||||||
)
|
|
||||||
nunafetch.raise_for_status()
|
|
||||||
except httpx.HTTPError as exc:
|
|
||||||
await msg.edit_msg(
|
|
||||||
f"ERROR: Failed to fetch data from {exc.request.url} - <code>{exc}</code>",
|
|
||||||
disable_web_page_preview=True,
|
|
||||||
)
|
|
||||||
return None, 0, None
|
|
||||||
text = BeautifulSoup(nunafetch, "lxml")
|
|
||||||
entry = text.find_all(class_="entry-header")
|
|
||||||
if entry[0].text.strip() == "Nothing Found":
|
|
||||||
if not kueri:
|
|
||||||
await msg.edit_msg(strings("no_result"), del_in=5)
|
|
||||||
else:
|
|
||||||
await msg.edit_msg(
|
|
||||||
strings("no_result_w_query").format(kueri=kueri), del_in=5
|
|
||||||
)
|
|
||||||
return None, 0, None
|
|
||||||
else:
|
|
||||||
data = []
|
|
||||||
for i in entry:
|
|
||||||
genre = i.find(class_="gmr-movie-on")
|
|
||||||
genre = f"{genre.text}" if genre else "N/A"
|
|
||||||
judul = i.find(class_="entry-title").find("a").text
|
|
||||||
link = i.find(class_="entry-title").find("a").get("href")
|
|
||||||
data.append({"judul": judul, "link": link, "genre": genre})
|
|
||||||
SCRAP_DICT.add(msg.id, [split_arr(data, 6), kueri], timeout=1800)
|
|
||||||
index = int(CurrentPage - 1)
|
|
||||||
PageLen = len(SCRAP_DICT[msg.id][0])
|
|
||||||
extractbtn = []
|
|
||||||
|
|
||||||
nunaResult = (
|
|
||||||
strings("header_with_query").format(web="NunaDrama", kueri=kueri)
|
|
||||||
if kueri
|
|
||||||
else strings("header_no_query").format(web="NunaDrama", cmd="nunadrama")
|
|
||||||
)
|
|
||||||
for c, i in enumerate(SCRAP_DICT[msg.id][0][index], start=1):
|
|
||||||
nunaResult += f"<b>{index*6+c}. <a href='{i['link']}'>{i['judul']}</a></b>\n<b>Genre:</b> <code>{i['genre']}</code>\n\n"
|
|
||||||
if not re.search(r"Series", i["genre"]):
|
|
||||||
extractbtn.append(
|
|
||||||
InlineButton(
|
|
||||||
index * 6 + c, f"nunaextract#{CurrentPage}#{c}#{user}#{msg.id}"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
nunaResult += strings("unsupport_dl_btn")
|
|
||||||
return nunaResult, PageLen, extractbtn
|
|
||||||
|
|
||||||
|
|
||||||
# PusatFilm21 GetData
|
|
||||||
async def getDataPusatFilm(msg, kueri, CurrentPage, user, strings):
|
|
||||||
if not SCRAP_DICT.get(msg.id):
|
|
||||||
with contextlib.redirect_stdout(sys.stderr):
|
|
||||||
try:
|
|
||||||
nunafetch = await fetch.get(
|
|
||||||
f"{web['pusatfilm']}/?s={kueri}", follow_redirects=True
|
|
||||||
)
|
|
||||||
nunafetch.raise_for_status()
|
|
||||||
except httpx.HTTPError as exc:
|
|
||||||
await msg.edit_msg(
|
|
||||||
f"ERROR: Failed to fetch data from {exc.request.url} - <code>{exc}</code>",
|
|
||||||
disable_web_page_preview=True,
|
|
||||||
)
|
|
||||||
return None, 0, None
|
|
||||||
text = BeautifulSoup(nunafetch, "lxml")
|
|
||||||
entry = text.find_all(class_="entry-header")
|
|
||||||
if entry[0].text.strip() == "Nothing Found":
|
|
||||||
if not kueri:
|
|
||||||
await msg.edit_msg(strings("no_result"), del_in=5)
|
|
||||||
else:
|
|
||||||
await msg.edit_msg(
|
|
||||||
strings("no_result_w_query").format(kueri=kueri), del_in=5
|
|
||||||
)
|
|
||||||
return None, 0, None
|
|
||||||
else:
|
|
||||||
data = []
|
|
||||||
for i in entry:
|
|
||||||
genre = i.find(class_="gmr-movie-on")
|
|
||||||
genre = f"{genre.text}" if genre else "N/A"
|
|
||||||
judul = i.find(class_="entry-title").find("a").text
|
|
||||||
link = i.find(class_="entry-title").find("a").get("href")
|
|
||||||
data.append({"judul": judul, "link": link, "genre": genre})
|
|
||||||
SCRAP_DICT.add(msg.id, [split_arr(data, 6), kueri], timeout=1800)
|
|
||||||
index = int(CurrentPage - 1)
|
|
||||||
PageLen = len(SCRAP_DICT[msg.id][0])
|
|
||||||
extractbtn = []
|
|
||||||
|
|
||||||
pfResult = (
|
|
||||||
strings("header_with_query").format(web="PusatFilm21", kueri=kueri)
|
|
||||||
if kueri
|
|
||||||
else strings("header_no_query").format(web="PusatFilm21", cmd="pusatfilm")
|
|
||||||
)
|
|
||||||
for c, i in enumerate(SCRAP_DICT[msg.id][0][index], start=1):
|
|
||||||
pfResult += f"<b>{index*6+c}. <a href='{i['link']}'>{i['judul']}</a></b>\n<b>Genre:</b> <code>{i['genre']}</code>\n\n"
|
|
||||||
if not re.search(r"Series", i["genre"]):
|
|
||||||
extractbtn.append(
|
|
||||||
InlineButton(
|
|
||||||
index * 6 + c, f"pfextract#{CurrentPage}#{c}#{user}#{msg.id}"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
pfResult += strings("unsupport_dl_btn")
|
|
||||||
return pfResult, PageLen, extractbtn
|
|
||||||
|
|
||||||
|
|
||||||
# DutaMovie GetData
|
|
||||||
async def getDataDutaMovie(msg, kueri, CurrentPage, user, strings):
|
|
||||||
if not SCRAP_DICT.get(msg.id):
|
|
||||||
with contextlib.redirect_stdout(sys.stderr):
|
|
||||||
try:
|
|
||||||
nunafetch = await fetch.get(
|
|
||||||
f"{web['dutamovie']}/?s={kueri}", follow_redirects=True
|
|
||||||
)
|
|
||||||
nunafetch.raise_for_status()
|
|
||||||
except httpx.HTTPError as exc:
|
|
||||||
await msg.edit_msg(
|
|
||||||
f"ERROR: Failed to fetch data from {exc.request.url} - <code>{exc}</code>",
|
|
||||||
disable_web_page_preview=True,
|
|
||||||
)
|
|
||||||
return None, 0, None
|
|
||||||
text = BeautifulSoup(nunafetch, "lxml")
|
|
||||||
entry = text.find_all(class_="entry-header")
|
|
||||||
if entry[0].text.strip() == "Nothing Found":
|
|
||||||
if not kueri:
|
|
||||||
await msg.edit_msg(strings("no_result"), del_in=5)
|
|
||||||
else:
|
|
||||||
await msg.edit_msg(
|
|
||||||
strings("no_result_w_query").format(kueri=kueri), del_in=5
|
|
||||||
)
|
|
||||||
return None, 0, None
|
|
||||||
else:
|
|
||||||
data = []
|
|
||||||
for i in entry:
|
|
||||||
genre = i.find(class_="gmr-movie-on")
|
|
||||||
genre = f"{genre.text}" if genre else "N/A"
|
|
||||||
judul = i.find(class_="entry-title").find("a").text
|
|
||||||
link = i.find(class_="entry-title").find("a").get("href")
|
|
||||||
data.append({"judul": judul, "link": link, "genre": genre})
|
|
||||||
SCRAP_DICT.add(msg.id, [split_arr(data, 6), kueri], timeout=1800)
|
|
||||||
index = int(CurrentPage - 1)
|
|
||||||
PageLen = len(SCRAP_DICT[msg.id][0])
|
|
||||||
extractbtn = []
|
|
||||||
|
|
||||||
dutaResult = (
|
|
||||||
strings("header_with_query").format(web="DutaMovie", kueri=kueri)
|
|
||||||
if kueri
|
|
||||||
else strings("header_no_query").format(web="DutaMovie", cmd="dutamovie")
|
|
||||||
)
|
|
||||||
for c, i in enumerate(SCRAP_DICT[msg.id][0][index], start=1):
|
|
||||||
dutaResult += f"<b>{index*6+c}. <a href='{i['link']}'>{i['judul']}</a></b>\n<b>Genre:</b> <code>{i['genre']}</code>\n\n"
|
|
||||||
if not re.search(r"Series", i["genre"]):
|
|
||||||
extractbtn.append(
|
|
||||||
InlineButton(
|
|
||||||
index * 6 + c, f"dutaextract#{CurrentPage}#{c}#{user}#{msg.id}"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
dutaResult += strings("unsupport_dl_btn")
|
|
||||||
return dutaResult, PageLen, extractbtn
|
|
||||||
|
|
||||||
|
|
||||||
# Lendrive GetData
|
# Lendrive GetData
|
||||||
async def getDataLendrive(msg, kueri, CurrentPage, user, strings):
|
async def getDataLendrive(msg, kueri, CurrentPage, user, strings):
|
||||||
if not SCRAP_DICT.get(msg.id):
|
if not SCRAP_DICT.get(msg.id):
|
||||||
|
|
@ -904,90 +733,6 @@ async def melong_s(self, message, strings):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# NunaDrama CMD
|
|
||||||
@app.on_cmd("nunadrama", no_channel=True)
|
|
||||||
@use_chat_lang()
|
|
||||||
async def nunadrama_s(self, message, strings):
|
|
||||||
kueri = " ".join(message.command[1:])
|
|
||||||
if not kueri:
|
|
||||||
kueri = ""
|
|
||||||
pesan = await message.reply_msg(strings("get_data"), quote=True)
|
|
||||||
CurrentPage = 1
|
|
||||||
nunares, PageLen, btn = await getDataNunaDrama(
|
|
||||||
pesan, kueri, CurrentPage, message.from_user.id, strings
|
|
||||||
)
|
|
||||||
if not nunares:
|
|
||||||
return
|
|
||||||
keyboard = InlineKeyboard()
|
|
||||||
keyboard.paginate(
|
|
||||||
PageLen,
|
|
||||||
CurrentPage,
|
|
||||||
"page_nuna#{number}" + f"#{pesan.id}#{message.from_user.id}",
|
|
||||||
)
|
|
||||||
keyboard.row(InlineButton(strings("ex_data"), user_id=self.me.id))
|
|
||||||
keyboard.row(*btn)
|
|
||||||
keyboard.row(InlineButton(strings("cl_btn"), f"close#{message.from_user.id}"))
|
|
||||||
await pesan.edit_msg(
|
|
||||||
nunares, disable_web_page_preview=True, reply_markup=keyboard
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# PusatFilm21 CMD
|
|
||||||
@app.on_cmd("pusatfilm", no_channel=True)
|
|
||||||
@use_chat_lang()
|
|
||||||
async def pusatfilm_s(self, message, strings):
|
|
||||||
kueri = " ".join(message.command[1:])
|
|
||||||
if not kueri:
|
|
||||||
kueri = ""
|
|
||||||
pesan = await message.reply_msg(strings("get_data"), quote=True)
|
|
||||||
CurrentPage = 1
|
|
||||||
pfres, PageLen, btn = await getDataPusatFilm(
|
|
||||||
pesan, kueri, CurrentPage, message.from_user.id, strings
|
|
||||||
)
|
|
||||||
if not pfres:
|
|
||||||
return
|
|
||||||
keyboard = InlineKeyboard()
|
|
||||||
keyboard.paginate(
|
|
||||||
PageLen,
|
|
||||||
CurrentPage,
|
|
||||||
"page_pf#{number}" + f"#{pesan.id}#{message.from_user.id}",
|
|
||||||
)
|
|
||||||
keyboard.row(InlineButton(strings("ex_data"), user_id=self.me.id))
|
|
||||||
keyboard.row(*btn)
|
|
||||||
keyboard.row(InlineButton(strings("cl_btn"), f"close#{message.from_user.id}"))
|
|
||||||
await pesan.edit_msg(
|
|
||||||
pfres, disable_web_page_preview=True, reply_markup=keyboard
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# DutaMovie CMD
|
|
||||||
@app.on_cmd("dutamovie", no_channel=True)
|
|
||||||
@use_chat_lang()
|
|
||||||
async def dutamovie_s(self, message, strings):
|
|
||||||
kueri = " ".join(message.command[1:])
|
|
||||||
if not kueri:
|
|
||||||
kueri = ""
|
|
||||||
pesan = await message.reply_msg(strings("get_data"), quote=True)
|
|
||||||
CurrentPage = 1
|
|
||||||
dutares, PageLen, btn = await getDataDutaMovie(
|
|
||||||
pesan, kueri, CurrentPage, message.from_user.id, strings
|
|
||||||
)
|
|
||||||
if not dutares:
|
|
||||||
return
|
|
||||||
keyboard = InlineKeyboard()
|
|
||||||
keyboard.paginate(
|
|
||||||
PageLen,
|
|
||||||
CurrentPage,
|
|
||||||
"page_nuna#{number}" + f"#{pesan.id}#{message.from_user.id}",
|
|
||||||
)
|
|
||||||
keyboard.row(InlineButton(strings("ex_data"), user_id=self.me.id))
|
|
||||||
keyboard.row(*btn)
|
|
||||||
keyboard.row(InlineButton(strings("cl_btn"), f"close#{message.from_user.id}"))
|
|
||||||
await pesan.edit_msg(
|
|
||||||
dutares, disable_web_page_preview=True, reply_markup=keyboard
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# Savefilm21 CMD
|
# Savefilm21 CMD
|
||||||
@app.on_cmd("savefilm21", no_channel=True)
|
@app.on_cmd("savefilm21", no_channel=True)
|
||||||
@use_chat_lang()
|
@use_chat_lang()
|
||||||
|
|
@ -1168,181 +913,6 @@ async def sf21page_callback(self, callback_query, strings):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# NunaDrama Page Callback
|
|
||||||
@app.on_cb("page_nuna#")
|
|
||||||
@use_chat_lang()
|
|
||||||
async def sf21page_callback(self, callback_query, strings):
|
|
||||||
try:
|
|
||||||
if callback_query.from_user.id != int(callback_query.data.split("#")[3]):
|
|
||||||
return await callback_query.answer(strings("unauth"), True)
|
|
||||||
message_id = int(callback_query.data.split("#")[2])
|
|
||||||
CurrentPage = int(callback_query.data.split("#")[1])
|
|
||||||
kueri = SCRAP_DICT[message_id][1]
|
|
||||||
except (IndexError, ValueError): # Gatau napa err ini
|
|
||||||
return
|
|
||||||
except KeyError:
|
|
||||||
return await callback_query.message.edit_msg(strings("invalid_cb"))
|
|
||||||
except QueryIdInvalid:
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
|
||||||
nunares, PageLen, btn = await getDataNunaDrama(
|
|
||||||
callback_query.message,
|
|
||||||
kueri,
|
|
||||||
CurrentPage,
|
|
||||||
callback_query.from_user.id,
|
|
||||||
strings,
|
|
||||||
)
|
|
||||||
except TypeError:
|
|
||||||
return
|
|
||||||
|
|
||||||
keyboard = InlineKeyboard()
|
|
||||||
keyboard.paginate(
|
|
||||||
PageLen,
|
|
||||||
CurrentPage,
|
|
||||||
"page_nuna#{number}" + f"#{message_id}#{callback_query.from_user.id}",
|
|
||||||
)
|
|
||||||
keyboard.row(InlineButton(strings("ex_data"), user_id=self.me.id))
|
|
||||||
keyboard.row(*btn)
|
|
||||||
keyboard.row(
|
|
||||||
InlineButton(strings("cl_btn"), f"close#{callback_query.from_user.id}")
|
|
||||||
)
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
nunares, disable_web_page_preview=True, reply_markup=keyboard
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# DutaMovie Page Callback
|
|
||||||
@app.on_cb("page_duta#")
|
|
||||||
@use_chat_lang()
|
|
||||||
async def sf21page_callback(self, callback_query, strings):
|
|
||||||
try:
|
|
||||||
if callback_query.from_user.id != int(callback_query.data.split("#")[3]):
|
|
||||||
return await callback_query.answer(strings("unauth"), True)
|
|
||||||
message_id = int(callback_query.data.split("#")[2])
|
|
||||||
CurrentPage = int(callback_query.data.split("#")[1])
|
|
||||||
kueri = SCRAP_DICT[message_id][1]
|
|
||||||
except (IndexError, ValueError):
|
|
||||||
return
|
|
||||||
except KeyError:
|
|
||||||
return await callback_query.message.edit_msg(strings("invalid_cb"))
|
|
||||||
except QueryIdInvalid:
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
|
||||||
dutares, PageLen, btn = await getDataDutaMovie(
|
|
||||||
callback_query.message,
|
|
||||||
kueri,
|
|
||||||
CurrentPage,
|
|
||||||
callback_query.from_user.id,
|
|
||||||
strings,
|
|
||||||
)
|
|
||||||
except TypeError:
|
|
||||||
return
|
|
||||||
|
|
||||||
keyboard = InlineKeyboard()
|
|
||||||
keyboard.paginate(
|
|
||||||
PageLen,
|
|
||||||
CurrentPage,
|
|
||||||
"page_duta#{number}" + f"#{message_id}#{callback_query.from_user.id}",
|
|
||||||
)
|
|
||||||
keyboard.row(InlineButton(strings("ex_data"), user_id=self.me.id))
|
|
||||||
keyboard.row(*btn)
|
|
||||||
keyboard.row(
|
|
||||||
InlineButton(strings("cl_btn"), f"close#{callback_query.from_user.id}")
|
|
||||||
)
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
dutares, disable_web_page_preview=True, reply_markup=keyboard
|
|
||||||
)
|
|
||||||
|
|
||||||
# NunaDrama Page Callback
|
|
||||||
@app.on_cb("page_nuna#")
|
|
||||||
@use_chat_lang()
|
|
||||||
async def sf21page_callback(self, callback_query, strings):
|
|
||||||
try:
|
|
||||||
if callback_query.from_user.id != int(callback_query.data.split("#")[3]):
|
|
||||||
return await callback_query.answer(strings("unauth"), True)
|
|
||||||
message_id = int(callback_query.data.split("#")[2])
|
|
||||||
CurrentPage = int(callback_query.data.split("#")[1])
|
|
||||||
kueri = SCRAP_DICT[message_id][1]
|
|
||||||
except (IndexError, ValueError): # Gatau napa err ini
|
|
||||||
return
|
|
||||||
except KeyError:
|
|
||||||
return await callback_query.message.edit_msg(strings("invalid_cb"))
|
|
||||||
except QueryIdInvalid:
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
|
||||||
nunares, PageLen, btn = await getDataNunaDrama(
|
|
||||||
callback_query.message,
|
|
||||||
kueri,
|
|
||||||
CurrentPage,
|
|
||||||
callback_query.from_user.id,
|
|
||||||
strings,
|
|
||||||
)
|
|
||||||
except TypeError:
|
|
||||||
return
|
|
||||||
|
|
||||||
keyboard = InlineKeyboard()
|
|
||||||
keyboard.paginate(
|
|
||||||
PageLen,
|
|
||||||
CurrentPage,
|
|
||||||
"page_nuna#{number}" + f"#{message_id}#{callback_query.from_user.id}",
|
|
||||||
)
|
|
||||||
keyboard.row(InlineButton(strings("ex_data"), user_id=self.me.id))
|
|
||||||
keyboard.row(*btn)
|
|
||||||
keyboard.row(
|
|
||||||
InlineButton(strings("cl_btn"), f"close#{callback_query.from_user.id}")
|
|
||||||
)
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
nunares, disable_web_page_preview=True, reply_markup=keyboard
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# PusatFilm Page Callback
|
|
||||||
@app.on_cb("page_pf#")
|
|
||||||
@use_chat_lang()
|
|
||||||
async def pfpage_callback(self, callback_query, strings):
|
|
||||||
try:
|
|
||||||
if callback_query.from_user.id != int(callback_query.data.split("#")[3]):
|
|
||||||
return await callback_query.answer(strings("unauth"), True)
|
|
||||||
message_id = int(callback_query.data.split("#")[2])
|
|
||||||
CurrentPage = int(callback_query.data.split("#")[1])
|
|
||||||
kueri = SCRAP_DICT[message_id][1]
|
|
||||||
except (IndexError, ValueError):
|
|
||||||
return
|
|
||||||
except KeyError:
|
|
||||||
return await callback_query.message.edit_msg(strings("invalid_cb"))
|
|
||||||
except QueryIdInvalid:
|
|
||||||
return
|
|
||||||
|
|
||||||
try:
|
|
||||||
pfres, PageLen, btn = await getDataDutaMovie(
|
|
||||||
callback_query.message,
|
|
||||||
kueri,
|
|
||||||
CurrentPage,
|
|
||||||
callback_query.from_user.id,
|
|
||||||
strings,
|
|
||||||
)
|
|
||||||
except TypeError:
|
|
||||||
return
|
|
||||||
|
|
||||||
keyboard = InlineKeyboard()
|
|
||||||
keyboard.paginate(
|
|
||||||
PageLen,
|
|
||||||
CurrentPage,
|
|
||||||
"page_pf#{number}" + f"#{message_id}#{callback_query.from_user.id}",
|
|
||||||
)
|
|
||||||
keyboard.row(InlineButton(strings("ex_data"), user_id=self.me.id))
|
|
||||||
keyboard.row(*btn)
|
|
||||||
keyboard.row(
|
|
||||||
InlineButton(strings("cl_btn"), f"close#{callback_query.from_user.id}")
|
|
||||||
)
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
pfres, disable_web_page_preview=True, reply_markup=keyboard
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# NoDrakor Page Callback
|
# NoDrakor Page Callback
|
||||||
@app.on_cb("page_nodrakor#")
|
@app.on_cb("page_nodrakor#")
|
||||||
@use_chat_lang()
|
@use_chat_lang()
|
||||||
|
|
@ -1819,151 +1389,6 @@ async def savefilm21_scrap(_, callback_query, strings):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# NunaDrama DDL
|
|
||||||
@app.on_cb("nunaextract#")
|
|
||||||
@use_chat_lang()
|
|
||||||
async def nunadrama_ddl(_, callback_query, strings):
|
|
||||||
try:
|
|
||||||
if callback_query.from_user.id != int(callback_query.data.split("#")[3]):
|
|
||||||
return await callback_query.answer(strings("unauth"), True)
|
|
||||||
idlink = int(callback_query.data.split("#")[2])
|
|
||||||
message_id = int(callback_query.data.split("#")[4])
|
|
||||||
CurrentPage = int(callback_query.data.split("#")[1])
|
|
||||||
link = SCRAP_DICT[message_id][0][CurrentPage - 1][idlink - 1].get("link")
|
|
||||||
except QueryIdInvalid:
|
|
||||||
return
|
|
||||||
except KeyError:
|
|
||||||
return await callback_query.message.edit_msg(strings("invalid_cb"))
|
|
||||||
|
|
||||||
keyboard = InlineKeyboard()
|
|
||||||
keyboard.row(
|
|
||||||
InlineButton(
|
|
||||||
strings("back_btn"),
|
|
||||||
f"page_sf21#{CurrentPage}#{message_id}#{callback_query.from_user.id}",
|
|
||||||
),
|
|
||||||
InlineButton(strings("cl_btn"), f"close#{callback_query.from_user.id}"),
|
|
||||||
)
|
|
||||||
with contextlib.redirect_stdout(sys.stderr):
|
|
||||||
try:
|
|
||||||
html = await fetch.get(link)
|
|
||||||
html.raise_for_status()
|
|
||||||
soup = BeautifulSoup(html.text, "lxml")
|
|
||||||
download_section = soup.find("div", class_="dzdesu")
|
|
||||||
title = download_section.find("h2").text.strip()
|
|
||||||
links = download_section.find_all("a", href=True)
|
|
||||||
download_links = {link.text.strip(): link['href'] for link in links}
|
|
||||||
res = f"<b>Judul</b>: {title}\n\n<b>Link Download:</b>\n"
|
|
||||||
for label, link in download_links.items():
|
|
||||||
res += f"{label}: <a href='{link}'>{link}</a>\n"
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
strings("res_scrape").format(link=link, kl=res), reply_markup=keyboard
|
|
||||||
)
|
|
||||||
except httpx.HTTPError as exc:
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
f"HTTP Exception for {exc.request.url} - <code>{exc}</code>",
|
|
||||||
reply_markup=keyboard,
|
|
||||||
)
|
|
||||||
except Exception as err:
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
f"ERROR: {err}", reply_markup=keyboard
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# PusatFilm21 DDL
|
|
||||||
@app.on_cb("pfextract#")
|
|
||||||
@use_chat_lang()
|
|
||||||
async def pusatfilm_ddl(_, callback_query, strings):
|
|
||||||
try:
|
|
||||||
if callback_query.from_user.id != int(callback_query.data.split("#")[3]):
|
|
||||||
return await callback_query.answer(strings("unauth"), True)
|
|
||||||
idlink = int(callback_query.data.split("#")[2])
|
|
||||||
message_id = int(callback_query.data.split("#")[4])
|
|
||||||
CurrentPage = int(callback_query.data.split("#")[1])
|
|
||||||
link = SCRAP_DICT[message_id][0][CurrentPage - 1][idlink - 1].get("link")
|
|
||||||
except QueryIdInvalid:
|
|
||||||
return
|
|
||||||
except KeyError:
|
|
||||||
return await callback_query.message.edit_msg(strings("invalid_cb"))
|
|
||||||
|
|
||||||
keyboard = InlineKeyboard()
|
|
||||||
keyboard.row(
|
|
||||||
InlineButton(
|
|
||||||
strings("back_btn"),
|
|
||||||
f"page_pf#{CurrentPage}#{message_id}#{callback_query.from_user.id}",
|
|
||||||
),
|
|
||||||
InlineButton(strings("cl_btn"), f"close#{callback_query.from_user.id}"),
|
|
||||||
)
|
|
||||||
with contextlib.redirect_stdout(sys.stderr):
|
|
||||||
try:
|
|
||||||
html = await fetch.get(link)
|
|
||||||
html.raise_for_status()
|
|
||||||
soup = BeautifulSoup(html.text, "lxml")
|
|
||||||
ddl = soup.find("li", {"pull-right"}).find("a").get("href")
|
|
||||||
res = f"<b>Link Download:</b> {ddl}"
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
strings("res_scrape").format(link=link, kl=res), reply_markup=keyboard
|
|
||||||
)
|
|
||||||
except httpx.HTTPError as exc:
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
f"HTTP Exception for {exc.request.url} - <code>{exc}</code>",
|
|
||||||
reply_markup=keyboard,
|
|
||||||
)
|
|
||||||
except Exception as err:
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
f"ERROR: {err}", reply_markup=keyboard
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# DutaMovie DDL
|
|
||||||
@app.on_cb("dutaextract#")
|
|
||||||
@use_chat_lang()
|
|
||||||
async def dutamovie_ddl(_, callback_query, strings):
|
|
||||||
try:
|
|
||||||
if callback_query.from_user.id != int(callback_query.data.split("#")[3]):
|
|
||||||
return await callback_query.answer(strings("unauth"), True)
|
|
||||||
idlink = int(callback_query.data.split("#")[2])
|
|
||||||
message_id = int(callback_query.data.split("#")[4])
|
|
||||||
CurrentPage = int(callback_query.data.split("#")[1])
|
|
||||||
link = SCRAP_DICT[message_id][0][CurrentPage - 1][idlink - 1].get("link")
|
|
||||||
except QueryIdInvalid:
|
|
||||||
return
|
|
||||||
except KeyError:
|
|
||||||
return await callback_query.message.edit_msg(strings("invalid_cb"))
|
|
||||||
|
|
||||||
keyboard = InlineKeyboard()
|
|
||||||
keyboard.row(
|
|
||||||
InlineButton(
|
|
||||||
strings("back_btn"),
|
|
||||||
f"page_duta#{CurrentPage}#{message_id}#{callback_query.from_user.id}",
|
|
||||||
),
|
|
||||||
InlineButton(strings("cl_btn"), f"close#{callback_query.from_user.id}"),
|
|
||||||
)
|
|
||||||
with contextlib.redirect_stdout(sys.stderr):
|
|
||||||
try:
|
|
||||||
html = await fetch.get(link)
|
|
||||||
html.raise_for_status()
|
|
||||||
soup = BeautifulSoup(html.text, "lxml")
|
|
||||||
download_section = soup.find("div", id="gmr-id-download")
|
|
||||||
title = download_section.find("h3", class_="title-download").text.strip()
|
|
||||||
links = download_section.find_all("a", href=True)
|
|
||||||
download_links = {link['title']: link['href'] for link in links}
|
|
||||||
res = f"<b>Judul</b>: {title}\n\n<b>Link Download:</b>\n"
|
|
||||||
for label, link in download_links.items():
|
|
||||||
res += f"{label}: {link}\n\n"
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
strings("res_scrape").format(link=link, kl=res), reply_markup=keyboard
|
|
||||||
)
|
|
||||||
except httpx.HTTPError as exc:
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
f"HTTP Exception for {exc.request.url} - <code>{exc}</code>",
|
|
||||||
reply_markup=keyboard,
|
|
||||||
)
|
|
||||||
except Exception as err:
|
|
||||||
await callback_query.message.edit_msg(
|
|
||||||
f"ERROR: {err}", reply_markup=keyboard
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# NoDrakor DDL
|
# NoDrakor DDL
|
||||||
@app.on_cb("nodrakorextract#")
|
@app.on_cb("nodrakorextract#")
|
||||||
@use_chat_lang()
|
@use_chat_lang()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue