-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAmbilStringSession.py
More file actions
86 lines (74 loc) · 2.95 KB
/
AmbilStringSession.py
File metadata and controls
86 lines (74 loc) · 2.95 KB
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
#!/bin/bash
# MusikVCG - Bot Music
# Copyright (C) 2021 MusikVCG
#
# This file is a part of < https://github.com/CollinFowel/MusikVcgV2/ >
#THANKYOU VERY MUCH TO @TeamUltroid
import os
from time import sleep
# https://www.tutorialspoint.com/how-to-clear-screen-in-python#:~:text=In%20Python%20sometimes%20we%20have,screen%20by%20pressing%20Control%20%2B%20l%20.
if os.name == "posix":
_ = os.system("clear")
else:
# for windows platfrom
_ = os.system("cls")
a = r"""
╔═╗╔═╗──────╔╗╔╗──╔╦═══╦═══╗
║║╚╝║║──────║║║╚╗╔╝║╔═╗║╔═╗║
║╔╗╔╗╠╗╔╦══╦╣║╠╗║║╔╣║─╚╣║─╚╝
║║║║║║║║║══╬╣╚╝╣╚╝║║║─╔╣║╔═╗
║║║║║║╚╝╠══║║╔╗╬╗╔╝║╚═╝║╚╩═║
╚╝╚╝╚╩══╩══╩╩╝╚╝╚╝─╚═══╩═══╝
"""
print(a)
try:
print("Mohon tunggu, memeriksa Telethon...")
for x in range(3):
for frame in r"-\|/-\|/":
print("\b", frame, sep="", end="", flush=True)
sleep(0.1)
import telethon
x = "\bSilahkan ambil dulu API ID & API HASH mu dari my.telegram.org\nkalo ga ngerti tanya @xxstanme di Telegram.\n\n"
except BaseException:
print("Menginstall Telethon...")
os.system("pip install telethon")
x = "\bBerhasil menginstall Telethon. "
if os.name == "posix":
_ = os.system("clear")
else:
# for windows platfrom
_ = os.system("cls")
print(a)
print(x)
# the imports
from telethon.errors.rpcerrorlist import ApiIdInvalidError, PhoneNumberInvalidError
from telethon.sessions import StringSession
from telethon.sync import TelegramClient
print(
"Nanti masukin nomor hp nya pake kode negara ya...\nContoh +6281234567890\n\n",
)
try:
API_ID = int(input("Masukan API ID : "))
except ValueError:
print("Pastikan Anda memasukan APP ID/API HASH dgn benar tanpa spasi. \nKlik RUN ► di kiri atas untuk mengulangi...")
exit(0)
API_HASH = input("Masukan API HASH : ")
# logging in
try:
with TelegramClient(StringSession(), API_ID, API_HASH) as ultroid:
print("Mohon tunggu sebentar...")
ult = ultroid.send_message(
"me",
f"**MusikVCG** `SESSION`:\n\n`{ultroid.session.save()}`\n\n**Support @ChatBotXanon @xxstanme**",
)
print("String Session mu telah dikirim ke Pesan Tersimpan silahkan cek!")
exit(0)
except ApiIdInvalidError:
print("Kamu memasukan API ID/API HASH yg salah silahkan ulangi kembali \nKlik RUN ► di kiri atas untuk mengulangi...")
exit(0)
except ValueError:
print("API HASH tidak boleh kosong!\nKlik RUN ► di kiri atas untuk mengulangi...")
exit(0)
except PhoneNumberInvalidError:
print("Nomor yg kamu masukan salah pastikan memasukan nomor diawali +62 bukan 0 dan tanpa garis - \nKlik RUN ► di kiri atas untuk mengulangi...")
exit(0)