Ultroid 0.0.5 - 06/04/21
Co-authored-by: AndrewLaneX <AndrewLaneX@users.noreply.github.com> Co-authored-by: Aditya <me@xditya.me> Co-authored-by: Danish <danish@ultroid.tech> Co-authored-by: buddhhu <buddhuu0@users.noreply.github.com> Co-authored-by: sppidy <sppidy@users.noreply.github.com> Co-authored-by: Arnab Paryali <Arnabxd@users.noreply.github.com> Co-authored-by: divkix <divkix@users.noreply.github.com> Co-authored-by: hellboi_atul <hellboi-atul@users.noreply.github.com> Co-authored-by: Programming Error <error@notavailable.live> Co-authored-by: New-dev0 <New-dev0@notavailable.live>
This commit is contained in:
committed by
ProgrammingError
parent
97146a9402
commit
4e8b0543ce
35
resources/extras/local-requirements.txt
Normal file
35
resources/extras/local-requirements.txt
Normal file
@@ -0,0 +1,35 @@
|
||||
# Local Requirements.
|
||||
|
||||
asyncurban
|
||||
cairosvg
|
||||
carbonnow
|
||||
emoji
|
||||
git+https://github.com/buddhhu/search-engine-parser.git
|
||||
git+https://github.com/ProgrammingError/rextester_py.git
|
||||
GitPython
|
||||
google-api-python-client==1.7.11
|
||||
googletrans==3.1.0a0
|
||||
heroku3
|
||||
httplib2==0.13.1
|
||||
imutils
|
||||
lottie
|
||||
lxml
|
||||
moviepy
|
||||
numpy
|
||||
oauth2client==4.1.3
|
||||
opencv-python-headless
|
||||
Pillow>=7.0.0
|
||||
play-scraper
|
||||
psutil
|
||||
py-Ultroid
|
||||
pyaml
|
||||
PyDictionary
|
||||
PyPDF2
|
||||
pytz
|
||||
requests>=2.18.4
|
||||
scikit-image
|
||||
speedtest-cli==2.1.2
|
||||
telegraph
|
||||
validators
|
||||
youtube-search-python
|
||||
youtube_dl
|
||||
BIN
resources/extras/logo_readme.jpg
Normal file
BIN
resources/extras/logo_readme.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 MiB |
@@ -1,8 +1,8 @@
|
||||
# Tutorial To Get Redis DB Url and Password
|
||||
|
||||
Process For Creating DB :-
|
||||
# Tutorial To Get Redis DB Url and Password
|
||||
|
||||
Process For Creating DB :-
|
||||
i.) Go To redislabs.com and click "Try Free" in Top Right Corner.
|
||||
ii.) Fill All The Required Details Like email, first and last name, password, etc.
|
||||
ii.) Fill All The Required Details Like email, first and last name, password, etc.
|
||||
iii.) Tick Below "I agree the corresponding...Privacy Policy." and Click "Get Started".
|
||||
iv) Now Check Your Email, and click the "Activate Now" sent by redislabs via email.
|
||||
v) Now Login and Chose Free Plan in "Fixed Size" Area and Write any name in "Subscription Area".
|
||||
@@ -13,4 +13,4 @@ vi) On the Next Page Write Database Name and click Activate.
|
||||
Process For Getting DB Credentials:-
|
||||
i.) Wait 5 mins after DB creation.
|
||||
ii.) Then There Would Be 2 Things Named "Endpoint" and "Access Control & Security".
|
||||
iii.) Copy Both Of Them and Paste Endpoint url in `REDIS_URI` and "Access ...Secrutity" in `REDIS_PASSWORD`.
|
||||
iii.) Copy Both Of Them and Paste Endpoint url in `REDIS_URI` and "Access ...Secrutity" in `REDIS_PASSWORD`.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# !/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# Ultroid - UserBot
|
||||
# Copyright (C) 2020 TeamUltroid
|
||||
#
|
||||
|
||||
@@ -6,18 +6,81 @@
|
||||
# PLease read the GNU Affero General Public License in
|
||||
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
|
||||
|
||||
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("Checking if Telethon is installed...")
|
||||
|
||||
for x in range(3):
|
||||
for frame in r"-\|/-\|/":
|
||||
print("\b", frame, sep="", end="", flush=True)
|
||||
sleep(0.1)
|
||||
|
||||
x = "\bFound an existing installation of Telethon...\nSuccessfully Imported.\n\n"
|
||||
except:
|
||||
print("Installing Telethon...")
|
||||
os.system("pip install telethon")
|
||||
|
||||
x = "\bDone. Installed and imported Telethon."
|
||||
if os.name == "posix":
|
||||
_ = os.system("clear")
|
||||
else:
|
||||
# for windows platfrom
|
||||
_ = os.system("cls")
|
||||
print(a)
|
||||
print(x)
|
||||
|
||||
from telethon.errors.rpcerrorlist import (ApiIdInvalidError,
|
||||
PhoneNumberInvalidError)
|
||||
# the imports
|
||||
from telethon.sessions import StringSession
|
||||
from telethon.sync import TelegramClient
|
||||
|
||||
print("Please ensure that you have your API ID and API HASH.")
|
||||
print("")
|
||||
print(
|
||||
"Get your API ID and API HASH from my.telegram.org or @ScrapperRoBot to proceed.\n\n",
|
||||
)
|
||||
|
||||
API_ID = int(input("Enter API ID: "))
|
||||
API_HASH = input("Enter API HASH: ")
|
||||
try:
|
||||
API_ID = int(input("Please enter your API ID: "))
|
||||
except ValueError:
|
||||
print("APP ID must be an integer.\nQuitting...")
|
||||
exit(0)
|
||||
API_HASH = input("Please enter your API HASH: ")
|
||||
|
||||
with TelegramClient(StringSession(), API_ID, API_HASH) as client:
|
||||
ult = client.send_message("me",f"`{client.session.save()}`")
|
||||
ult.reply("The above is the `SESSION` for your current session.\nVisit @TheUltroid")
|
||||
print("")
|
||||
print("String Session for the current login has been generated.")
|
||||
print("Check your Telegram Saved messages for your SESSION.")
|
||||
# logging in
|
||||
try:
|
||||
with TelegramClient(StringSession(), API_ID, API_HASH) as ultroid:
|
||||
print("Generating a user session for Ultroid...")
|
||||
ult = ultroid.send_message(
|
||||
"me",
|
||||
f"**ULTROID** `SESSION`:\n\n`{ultroid.session.save()}`\n\n**Do not share this anywhere!**",
|
||||
)
|
||||
print("Your SESSION has been generated. Check your telegram saved messages!")
|
||||
exit(0)
|
||||
except ApiIdInvalidError:
|
||||
print("Your API ID/API HASH combination is invalid. Kindly recheck.\nQuitting...")
|
||||
exit(0)
|
||||
except ValueError:
|
||||
print("API HASH must not be empty!\nQuitting...")
|
||||
exit(0)
|
||||
except PhoneNumberInvalidError:
|
||||
print("The phone number is invalid!\nQuitting...")
|
||||
exit(0)
|
||||
|
||||
140
resources/startup/locals.py
Normal file
140
resources/startup/locals.py
Normal file
@@ -0,0 +1,140 @@
|
||||
# /usr/bin/python3
|
||||
# Ultroid - UserBot
|
||||
# Copyright (C) 2020 TeamUltroid
|
||||
#
|
||||
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
|
||||
# Please read the GNU Affero General Public License in <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
|
||||
|
||||
# Standalone file for facilitating local deploys.
|
||||
|
||||
import os
|
||||
|
||||
a = r"""
|
||||
_ _ _ _ _ _
|
||||
| | | | | | (_) | |
|
||||
| | | | | |_ _ __ ___ _ __| |
|
||||
| | | | | __| '__/ _ \| |/ _ |
|
||||
| |__| | | |_| | | (_) | | (_| |
|
||||
\____/|_|\__|_| \___/|_|\__,_|
|
||||
"""
|
||||
|
||||
|
||||
def start():
|
||||
|
||||
clear_screen()
|
||||
check_for_py()
|
||||
|
||||
print(f"{a}\n\n")
|
||||
print("Welcome to Ultroid, lets start setting up!\n\n")
|
||||
print("Cloning the repository...\n\n")
|
||||
try:
|
||||
os.system("git clone https://github.com/TeamUltroid/Ultroid && cd Ultroid")
|
||||
except Exception as e:
|
||||
print(f"ERROR\n{str(e)}")
|
||||
print("\n\nDone")
|
||||
os.system("cd Ultroid")
|
||||
clear_screen()
|
||||
print(a)
|
||||
print("\n\nLet's start!\n")
|
||||
|
||||
# generate session if needed.
|
||||
sessionisneeded = input(
|
||||
"Do you want to generate a new session, or have an old session string? [generate/skip]",
|
||||
)
|
||||
if sessionisneeded == "generate":
|
||||
gen_session()
|
||||
elif sessionisneeded == "skip":
|
||||
pass
|
||||
else:
|
||||
print(
|
||||
'Please choose "generate" to generate a session string, or "skip" to pass on.\n\nPlease run the script again!',
|
||||
)
|
||||
exit(0)
|
||||
|
||||
# start bleck megik
|
||||
print("\n\nLets start entering the variables.\n\n")
|
||||
varrs = [
|
||||
"API_ID",
|
||||
"API_HASH",
|
||||
"SESSION",
|
||||
"BOT_USERNAME",
|
||||
"BOT_TOKEN",
|
||||
"REDIS_URI",
|
||||
"REDIS_PASSWORD",
|
||||
"LOG_CHANNEL",
|
||||
]
|
||||
all_done = "# Ultroid Environment Variables.\n# Do not delete this file.\n\n"
|
||||
for i in varrs:
|
||||
all_done += do_input(i)
|
||||
clear_screen()
|
||||
print(a)
|
||||
print("\n\nHere are the things you've entered.\nKindly check.")
|
||||
print(all_done)
|
||||
isitdone = input("\n\nIs it all correct? [y/n]")
|
||||
if isitdone == "y":
|
||||
f = open("Ultroid/.env", "w")
|
||||
f.write(all_done)
|
||||
f.close
|
||||
elif isitdone == "n":
|
||||
print("Oh, let's redo these then -_-")
|
||||
start()
|
||||
else:
|
||||
f = open("Ultroid/.env", "w")
|
||||
f.write(all_done)
|
||||
f.close
|
||||
clear_screen()
|
||||
print("\nCongrats. All done!\nTime to start the bot!")
|
||||
print("\nInstalling requirements... This might take a while...")
|
||||
os.system("cd Ultroid")
|
||||
os.system("pip3 install -r ./resources/extras/local-requirements.txt")
|
||||
clear_screen()
|
||||
print(a)
|
||||
print("\nStarting Ultroid...")
|
||||
os.system("python3 -m pyUltroid")
|
||||
|
||||
|
||||
def do_input(var):
|
||||
val = input(f"Enter your {var}: ")
|
||||
to_write = f"{var}={val}\n"
|
||||
return to_write
|
||||
|
||||
|
||||
def clear_screen():
|
||||
# clear screen
|
||||
if os.name == "posix":
|
||||
_ = os.system("clear")
|
||||
else:
|
||||
# for windows platfrom
|
||||
_ = os.system("cls")
|
||||
|
||||
|
||||
def check_for_py():
|
||||
print(
|
||||
"Please make sure you have python installed. \nGet it from http://python.org/\n\n",
|
||||
)
|
||||
try:
|
||||
ch = int(
|
||||
input(
|
||||
"Enter Choice:\n1. Continue, python is installed.\n2. Exit and install python.\n",
|
||||
),
|
||||
)
|
||||
except:
|
||||
print("Please run the script again, and enter the choice as a number!!")
|
||||
exit(0)
|
||||
if ch == 1:
|
||||
pass
|
||||
elif ch == 2:
|
||||
print("Please install python and continue!")
|
||||
exit(0)
|
||||
else:
|
||||
print("Weren't you taught how to read? Enter a choice!!")
|
||||
return
|
||||
|
||||
|
||||
def gen_session():
|
||||
print("\nProcessing...")
|
||||
os.system("cd Ultroid && python3 resources/session/ssgen.py")
|
||||
return
|
||||
|
||||
|
||||
start()
|
||||
@@ -1,10 +1,11 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# Ultroid - UserBot
|
||||
# Copyright (C) 2020 TeamUltroid
|
||||
#
|
||||
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
|
||||
# PLease read the GNU Affero General Public License in <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
|
||||
|
||||
|
||||
|
||||
echo "
|
||||
┏┳┓╋┏┓╋╋╋╋┏┓┏┓
|
||||
┃┃┣┓┃┗┳┳┳━╋╋┛┃
|
||||
@@ -14,5 +15,5 @@ echo "
|
||||
Visit @TheUltroid for updates!!
|
||||
|
||||
"
|
||||
|
||||
|
||||
python3 -m pyUltroid
|
||||
|
||||
Reference in New Issue
Block a user