File size: 2,257 Bytes
b3eb313
 
 
 
48b88b6
 
b3eb313
 
 
 
 
 
 
48b88b6
b3eb313
48b88b6
 
 
 
b3eb313
 
 
48b88b6
b3eb313
 
 
 
 
48b88b6
b3eb313
 
 
 
 
 
 
48b88b6
b3eb313
 
 
 
 
 
 
 
 
 
 
 
 
 
48b88b6
 
 
 
b3eb313
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import logging
from pyrogram import Client, filters
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
from pyrogram.types import *
import akenoai as ak
from config import TIKTOK_WEB API_ID, API_HASH, BOT_TOKEN
import hashlib

logging.getLogger("pyrogram").setLevel(logging.WARNING)
logging.basicConfig(level=logging.INFO)

WELCOME_TEXT = """
Halo {}
Saya adalah bot untuk mengunduh video PornoHub di telegram.

- Dilarang Keras spam
- Jangan share video ke group (mending private bot aman)

Powered by @xtdevs
"""

client = Client(
    "AkenoHub",
    api_id=API_ID,
    api_hash=API_HASH,
    bot_token=BOT_TOKEN
)

api = ak.PornoHub(key="randigithub356")

@client.on_message(filters.command("start") & filters.private)
async def welcome_start(client: Client, message: Message):
    keyboard = InlineKeyboardMarkup(
        [
            [
                InlineKeyboardButton(
                    text="📢 Channel",
                    url="https://t.me/RendyProjects"
                )
            ]
        ]
    )
    await message.reply_text(
        WELCOME_TEXT.format(message.from_user.first_name),
        reply_markup=keyboard
    )

@client.on_message(filters.text & filters.private)
async def tiktok_downloader(client: Client, message: Message):
    if message.text:
        query = message.text
        response = await api.x_search(query=query)
        link = response[0]
        file_path, _, _, = await api.x_download(url=link, is_stream=True)
        
        callback_data = generate_callback_data(message.from_user.id, query)
        keyboard = InlineKeyboardMarkup(
            [
                [
                    InlineKeyboardButton(
                        text="Audio Download",
                        callback_data=callback_data
                    )
                ]
            ]
        )
        try:
            dll = await message.reply_text("Processing....")
            await message.delete()
            response = await Tiktok.download(tt, query)
            await message.reply_video(response[0], reply_markup=keyboard)
            await dll.delete()
        except Exception as e:
            await dll.delete()
            await message.reply_text(f"Error: {str(e)}")

client.run()