Update main.py
Browse files
main.py
CHANGED
@@ -1,16 +1,17 @@
|
|
1 |
import logging
|
|
|
|
|
2 |
from pyrogram import Client, filters
|
3 |
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
|
4 |
from pyrogram.types import *
|
5 |
import akenoai as ak
|
6 |
-
from config import
|
7 |
-
import hashlib
|
8 |
|
9 |
logging.getLogger("pyrogram").setLevel(logging.WARNING)
|
10 |
logging.basicConfig(level=logging.INFO)
|
11 |
|
12 |
WELCOME_TEXT = """
|
13 |
-
Halo {}
|
14 |
Saya adalah bot untuk mengunduh video PornoHub di telegram.
|
15 |
|
16 |
- Dilarang Keras spam
|
@@ -19,6 +20,14 @@ Saya adalah bot untuk mengunduh video PornoHub di telegram.
|
|
19 |
Powered by @xtdevs
|
20 |
"""
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
client = Client(
|
23 |
"AkenoHub",
|
24 |
api_id=API_ID,
|
@@ -26,7 +35,7 @@ client = Client(
|
|
26 |
bot_token=BOT_TOKEN
|
27 |
)
|
28 |
|
29 |
-
api = ak.PornoHub(key=
|
30 |
|
31 |
@client.on_message(filters.command("start") & filters.private)
|
32 |
async def welcome_start(client: Client, message: Message):
|
@@ -40,38 +49,86 @@ async def welcome_start(client: Client, message: Message):
|
|
40 |
]
|
41 |
]
|
42 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
await message.reply_text(
|
44 |
-
WELCOME_TEXT.format(
|
|
|
|
|
45 |
reply_markup=keyboard
|
46 |
)
|
47 |
|
48 |
-
@client.on_message(
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
file_path, _, _, = await api.x_download(url=link, is_stream=True)
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
)
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
await dll.delete()
|
73 |
-
except Exception as e:
|
74 |
-
await dll.delete()
|
75 |
-
await message.reply_text(f"Error: {str(e)}")
|
76 |
|
77 |
client.run()
|
|
|
1 |
import logging
|
2 |
+
import time
|
3 |
+
import os
|
4 |
from pyrogram import Client, filters
|
5 |
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
|
6 |
from pyrogram.types import *
|
7 |
import akenoai as ak
|
8 |
+
from config import API_KEY, API_ID, API_HASH, BOT_TOKEN
|
|
|
9 |
|
10 |
logging.getLogger("pyrogram").setLevel(logging.WARNING)
|
11 |
logging.basicConfig(level=logging.INFO)
|
12 |
|
13 |
WELCOME_TEXT = """
|
14 |
+
Halo {name}
|
15 |
Saya adalah bot untuk mengunduh video PornoHub di telegram.
|
16 |
|
17 |
- Dilarang Keras spam
|
|
|
20 |
Powered by @xtdevs
|
21 |
"""
|
22 |
|
23 |
+
USER_TRACK = """
|
24 |
+
β’ AkenoHUB
|
25 |
+
|
26 |
+
UserID: {id}
|
27 |
+
First Name: {first_name}
|
28 |
+
Username: @{username}
|
29 |
+
"""
|
30 |
+
|
31 |
client = Client(
|
32 |
"AkenoHub",
|
33 |
api_id=API_ID,
|
|
|
35 |
bot_token=BOT_TOKEN
|
36 |
)
|
37 |
|
38 |
+
api = ak.PornoHub(key=API_KEY)
|
39 |
|
40 |
@client.on_message(filters.command("start") & filters.private)
|
41 |
async def welcome_start(client: Client, message: Message):
|
|
|
49 |
]
|
50 |
]
|
51 |
)
|
52 |
+
await client.send_message(
|
53 |
+
PRIVATE_LOGS,
|
54 |
+
USER_TRACK.format(
|
55 |
+
id=message.from_user.id if message.from_user else 0,
|
56 |
+
first_name=message.from_user.first_name,
|
57 |
+
username=message.from_user.username if message.from_user else None
|
58 |
+
)
|
59 |
+
)
|
60 |
await message.reply_text(
|
61 |
+
WELCOME_TEXT.format(
|
62 |
+
name=message.from_user.first_name
|
63 |
+
),
|
64 |
reply_markup=keyboard
|
65 |
)
|
66 |
|
67 |
+
@client.on_message(
|
68 |
+
filters.command(["hubsearch"])
|
69 |
+
& filters.private
|
70 |
+
& ~filters.forwarded
|
71 |
+
)
|
72 |
+
async def searchhub(client: Client, message: Message):
|
73 |
+
query = message.text.split(" ", 1)[1] if len(message.command) > 1 else None
|
74 |
+
if not query:
|
75 |
+
return await message.reply_text("please search for pornohub.")
|
76 |
+
response = await api.x_search(query=query)
|
77 |
+
link = response[0]
|
78 |
+
try:
|
79 |
file_path, _, _, = await api.x_download(url=link, is_stream=True)
|
80 |
+
upload_text = f"**β¬οΈ π΄ππ
ππΊπ½πππ video ...**"
|
81 |
+
await pro.edit_text(upload_text)
|
82 |
+
await message.reply_video(
|
83 |
+
file_path,
|
84 |
+
caption=f"β’ Powered by {client.me.mention}",
|
85 |
+
thumb=thumb,
|
86 |
+
has_spoiler=True,
|
87 |
+
progress=progress,
|
88 |
+
progress_args=(
|
89 |
+
pro,
|
90 |
+
time.time(),
|
91 |
+
upload_text
|
92 |
+
)
|
93 |
+
)
|
94 |
+
await pro.delete()
|
95 |
+
os.remove(thumb)
|
96 |
+
os.remove(file_path)
|
97 |
+
except Exception as e:
|
98 |
+
await pro.edit_text(str(e))
|
99 |
+
|
100 |
+
@client.on_message(
|
101 |
+
filters.command(["hubdl"])
|
102 |
+
& filters.private
|
103 |
+
& ~filters.forwarded
|
104 |
+
)
|
105 |
+
async def porno_download(client: Client, message: Message):
|
106 |
+
link = message.text.split(" ", 1)[1] if len(message.command) > 1 else None
|
107 |
+
if not link:
|
108 |
+
return await message.reply_text("please link for pornohub.")
|
109 |
+
if not link.startswith("https://www.xnxx.com/"):
|
110 |
+
return await message.reply_text("invalid link.")
|
111 |
+
try:
|
112 |
+
pro = await message.reply_text("Processing.....")
|
113 |
+
file_path, thumb, _ = await api.x_download(url=link, is_stream=True)
|
114 |
+
upload_text = f"**β¬οΈ π΄ππ
ππΊπ½πππ video ...**"
|
115 |
+
await pro.edit_text(upload_text)
|
116 |
+
await message.reply_video(
|
117 |
+
file_path,
|
118 |
+
caption=f"β’ Powered by {client.me.mention}",
|
119 |
+
thumb=thumb,
|
120 |
+
has_spoiler=True,
|
121 |
+
progress=progress,
|
122 |
+
progress_args=(
|
123 |
+
pro,
|
124 |
+
time.time(),
|
125 |
+
upload_text
|
126 |
+
)
|
127 |
)
|
128 |
+
await pro.delete()
|
129 |
+
os.remove(thumb)
|
130 |
+
os.remove(file_path)
|
131 |
+
except Exception as e:
|
132 |
+
await pro.edit_text(str(e))
|
|
|
|
|
|
|
|
|
133 |
|
134 |
client.run()
|