-
Notifications
You must be signed in to change notification settings - Fork 252
/
main.py
93 lines (65 loc) · 3.1 KB
/
main.py
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# copyright 2023 © Xron Trix | https://github.com/Xrontrix10
# @title 🖥️ Main Colab Leech Code
# @title Main Code
# @markdown <div><center><img src="https://user-images.githubusercontent.com/125879861/255391401-371f3a64-732d-4954-ac0f-4f093a6605e1.png" height=80></center></div>
# @markdown <center><h4><a href="https://github.com/XronTrix10/Telegram-Leecher/wiki/INSTRUCTIONS">READ</a> How to use</h4></center>
# @markdown <br>
API_ID = 0 # @param {type: "integer"}
API_HASH = "" # @param {type: "string"}
BOT_TOKEN = "" # @param {type: "string"}
USER_ID = 0 # @param {type: "integer"}
DUMP_ID = 0 # @param {type: "integer"}
import subprocess, time, json, shutil, os
from IPython.display import clear_output
from threading import Thread
Working = True
banner = '''
____ ____.______ ._______ .______ _____._.______ .___ ____ ____
\\ \\_/ /: __ \\ : .___ \\ : \\ \\__ _:|: __ \\ : __| \\ \\_/ /
\\___ ___/ | \\____|| : | || | | :|| \\____|| : | \\___ ___/
/ _ \\ | : \\ | : || | | | || : \\ | | / _ \\
/___/ \\___\\| |___\\ \\_. ___/ |___| | | || |___\\| | /___/ \\___\\
|___| :/ |___| |___||___| |___|
:
_____ __ __ __ __
/ ___/__ / /__ _/ / / / ___ ___ ____/ / ___ ____
/ /__/ _ \\/ / _ `/ _ \\ / /_/ -_) -_) __/ _ \\/ -_) __/
\\___/\\___/_/\\_,_/_.__/ /____|__/\\__/\\__/_//_/\\__/_/
'''
print(banner)
def Loading():
white = 37
black = 0
while Working:
print("\r" + "░"*white + "▒▒"+ "▓"*black + "▒▒" + "░"*white, end="")
black = (black + 2) % 75
white = (white -1) if white != 0 else 37
time.sleep(2)
clear_output()
_Thread = Thread(target=Loading, name="Prepare", args=())
_Thread.start()
if len(str(DUMP_ID)) == 10 and "-100" not in str(DUMP_ID):
n_dump = "-100" + str(DUMP_ID)
DUMP_ID = int(n_dump)
if os.path.exists("/content/sample_data"):
shutil.rmtree("/content/sample_data")
cmd = "git clone https://github.com/XronTrix10/Telegram-Leecher"
proc = subprocess.run(cmd, shell=True)
cmd = "apt update && apt install ffmpeg aria2"
proc = subprocess.run(cmd, shell=True)
cmd = "pip3 install -r /content/Telegram-Leecher/requirements.txt"
proc = subprocess.run(cmd, shell=True)
credentials = {
"API_ID": API_ID,
"API_HASH": API_HASH,
"BOT_TOKEN": BOT_TOKEN,
"USER_ID": USER_ID,
"DUMP_ID": DUMP_ID,
}
with open('/content/Telegram-Leecher/credentials.json', 'w') as file:
file.write(json.dumps(credentials))
Working = False
if os.path.exists("/content/Telegram-Leecher/my_bot.session"):
os.remove("/content/Telegram-Leecher/my_bot.session") # Remove previous bot session
print("\rStarting Bot....")
!cd /content/Telegram-Leecher/ && python3 -m colab_leecher #type:ignore