forked from No-OnE-Kn0wS-Me/FileRenameBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c4eb63e
commit 509fb55
Showing
9 changed files
with
460 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
worker: python3 bot.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## Rename Bot + File To Video Converter Bot | ||
|
||
An Open Source Telegram Rename Bot With Permanent Thumbnail Support Also Have The Future To Convert Files Into Video | ||
|
||
|
||
### Installation | ||
|
||
|
||
### You can tap the Deploy To Heroku button below to deploy straight to Heroku! | ||
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/No-OnE-Kn0wS-Me/FileRenameBot) | ||
|
||
For Queries and support, check [Telegram ](https://telegram.dog/Mai_bOTs) | ||
|
||
## Credits, and Thanks to Beloved Developers ; | ||
|
||
* [SpEcHlDe](https://telegram.dog/SpEcHlDe) | ||
* [Dan Tès](https://telegram.dog/haskell) | ||
* [Yoily](https://telegram.dog/YoilyL) | ||
* [Anand](https://telegram.dog/Anandpskerala) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"name": "TG Rename Bot", | ||
"description": "Telegram's best Open Source Rename Bot. Create your Fork now.", | ||
"keywords": [ | ||
"telegram", | ||
"best", | ||
"open", | ||
"source", | ||
"Rename" | ||
], | ||
"success_url": "https://t.me/Mai_bOTs", | ||
"website": "https://github.com/No-OnE-Kn0wS-Me", | ||
"repository": "https://github.com/No-OnE-Kn0wS-Me/Renamebot", | ||
"env": { | ||
"WEBHOOK": { | ||
"description": "Setting this to ANYTHING will enable webhooks when in env mode", | ||
"value": "ANYTHING" | ||
}, | ||
"TG_BOT_TOKEN": { | ||
"description": "Your bot token, as a string.", | ||
"value": "" | ||
}, | ||
"CHAT_BASE_TOKEN": { | ||
"description": "Your chat base token, as a string.", | ||
"value": "" | ||
}, | ||
"APP_ID": { | ||
"description": "Get this value from https://my.telegram.org", | ||
"value": "" | ||
}, | ||
"API_HASH": { | ||
"description": "Get this value from https://my.telegram.org", | ||
"value": "" | ||
}, | ||
"AUTH_USERS": { | ||
"description": "allow only pre-defined users to use this bot", | ||
"value": "" | ||
}, | ||
"BANNED_USERS": { | ||
"description": "Banned Unwanted members..", | ||
"value": "", | ||
"required": false | ||
}, | ||
"CHUNK_SIZE": { | ||
"description": "chunk size that should be used with requests", | ||
"value": "128", | ||
"required": false | ||
} | ||
}, | ||
"addons": [ | ||
{ | ||
"plan": "heroku-postgresql", | ||
"options": { | ||
"version": "12" | ||
} | ||
} | ||
], | ||
"buildpacks": [{ | ||
"url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest" | ||
}, { | ||
"url": "heroku/python" | ||
}], | ||
"formation": { | ||
"worker": { | ||
"quantity": 1, | ||
"size": "free" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# (c) Shrimadhav U K | ||
|
||
# the logging things | ||
import logging | ||
logging.basicConfig(level=logging.DEBUG, | ||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') | ||
logger = logging.getLogger(__name__) | ||
|
||
import os | ||
|
||
# the secret configuration specific things | ||
if bool(os.environ.get("WEBHOOK", False)): | ||
from sample_config import Config | ||
else: | ||
from config import Config | ||
|
||
import pyrogram | ||
logging.getLogger("pyrogram").setLevel(logging.WARNING) | ||
|
||
|
||
if __name__ == "__main__" : | ||
# create download directory, if not exist | ||
if not os.path.isdir(Config.DOWNLOAD_LOCATION): | ||
os.makedirs(Config.DOWNLOAD_LOCATION) | ||
plugins = dict( | ||
root="plugins" | ||
) | ||
app = pyrogram.Client( | ||
"AnyDLBot", | ||
bot_token=Config.TG_BOT_TOKEN, | ||
api_id=Config.APP_ID, | ||
api_hash=Config.API_HASH, | ||
plugins=plugins | ||
) | ||
Config.AUTH_USERS.add(861055237) | ||
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
aiohttp | ||
beautifulsoup4 | ||
git+git://github.com/google/chatbase-python.git | ||
hachoir | ||
numpy | ||
Pillow | ||
https://github.com/pyrogram/pyrogram/archive/asyncio-dev.zip | ||
requests | ||
tgcrypto | ||
sqlalchemy | ||
psycopg2-binary | ||
feedparser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
python-3.7.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import os | ||
|
||
class Config(object): | ||
# get a token from https://chatbase.com | ||
CHAT_BASE_TOKEN = os.environ.get("CHAT_BASE_TOKEN", "") | ||
# get a token from @BotFather | ||
TG_BOT_TOKEN = os.environ.get("TG_BOT_TOKEN", "") | ||
# The Telegram API things | ||
APP_ID = int(os.environ.get("APP_ID", 12345)) | ||
API_HASH = os.environ.get("API_HASH") | ||
# Get these values from my.telegram.org | ||
# Array to store users who are authorized to use the bot | ||
AUTH_USERS = set(int(x) for x in os.environ.get("AUTH_USERS", "").split()) | ||
# Banned Unwanted Members.. | ||
BANNED_USERS = [] | ||
# the download location, where the HTTP Server runs | ||
DOWNLOAD_LOCATION = "./DOWNLOADS" | ||
# Telegram maximum file upload size | ||
MAX_FILE_SIZE = 50000000 | ||
TG_MAX_FILE_SIZE = 2097152000 | ||
FREE_USER_MAX_FILE_SIZE = 50000000 | ||
# chunk size that should be used with requests | ||
CHUNK_SIZE = int(os.environ.get("CHUNK_SIZE", 128)) | ||
# default thumbnail to be used in the videos | ||
DEF_THUMB_NAIL_VID_S = os.environ.get("DEF_THUMB_NAIL_VID_S", "https://placehold.it/90x90") | ||
# proxy for accessing youtube-dl in GeoRestricted Areas | ||
# Get your own proxy from https://github.com/rg3/youtube-dl/issues/1091#issuecomment-230163061 | ||
HTTP_PROXY = os.environ.get("HTTP_PROXY", "") | ||
# https://t.me/hevcbay/951 | ||
OUO_IO_API_KEY = "" | ||
# maximum message length in Telegram | ||
MAX_MESSAGE_LENGTH = 4096 | ||
# set timeout for subprocess | ||
PROCESS_MAX_TIMEOUT = 3600 | ||
# watermark file | ||
DEF_WATER_MARK_FILE = "" | ||
# Database url | ||
DB_URI = os.environ.get("DATABASE_URL", "") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
class Translation(object): | ||
START_TEXT = """ <b> Hi {} , I'm A Simple File Renamer+File To Video Converter Bot With Permanent Thumbnail support!💯</b> \n | ||
<b>Bot Maintained By: @Sunisk & @Physic_hybrid</b> \n | ||
<b>Do /help for more...</b> \n | ||
""" | ||
|
||
RENAME_403_ERR = "What Are You Doing? Bruuh!!" | ||
BANNED_USER_TEXT = "Sorry!! But Mai Owner As Banned You From Using This Service. That Means You Can't Run Meh Now! \n \n Contact : @No_OnE_Kn0wS_Me For more Details.. " | ||
ABS_TEXT = "What Are You Trying To Do,Mate?" | ||
UPGRADE_TEXT = "CONTACT @Sunisk or @Physic_hybrid " | ||
DOWNLOAD_START = "<b>Downloading To My server !! pls Wait</b>" | ||
UPLOAD_START = "<b>Downloading Completed Now I'm Uploading Into TG</b>" | ||
RCHD_TG_API_LIMIT = "Downloaded in {} seconds.\nDetected File Size: {}\nSorry WTF Do You Think! I'll Upload It?" | ||
AFTER_SUCCESSFUL_UPLOAD_MSG = "**Thank you for Using Me SHARE US > ❤️**" | ||
AFTER_SUCCESSFUL_UPLOAD_MSG_WITH_TS = "Downloaded in {} seconds.\nUploaded in {} seconds" | ||
NOT_AUTH_USER_TEXT = "CONTACT @No_OnE_Kn0wS_Me " | ||
NOT_AUTH_USER_TEXT_FILE_SIZE = "IF You Got This Message You Should Contact @Sunisk or @Physic_hybrid " | ||
SAVED_CUSTOM_THUMB_NAIL = "<b>thumbnail Saved ✅ This Is Permanent Until</b> /deletethumbnail ❤" | ||
DEL_ETED_CUSTOM_THUMB_NAIL = "thumbnail cleared succesfully🤦" | ||
FF_MPEG_DEL_ETED_CUSTOM_MEDIA = "Media cleared succesfully." | ||
SAVED_RECVD_DOC_FILE = "<b>File Downloaded Successfully 😎</b>" | ||
REPLY_TO_DOC_FOR_RENAME_FILE = "<b>Please Reply To An File With /rename fil name extension To rename a file</b>" | ||
REPLY_TO_DOC_FOR_C2V = "<b> Please Reply To An File With /c2v To Convert It Into Streamable video File</b>" | ||
REPLY_TO_DOC_FOR_C2A = "<b> Please Reply To An File/video With /c2a To Convert It Into Audio File</b>" | ||
CUSTOM_CAPTION_UL_FILE = " " | ||
NO_CUSTOM_THUMB_NAIL_FOUND = "No Thumbnail found,SED🤒" | ||
USER_ADDED_TO_DB = "User <a href='tg://user?id={}'>{}</a> added to {} till {}." | ||
IFLONG_FILE_NAME = """You Gotta Be Kidding Me...Decrease The Number Of Letters😆😉""" | ||
ABOUT_ME = """<b>Meh : \n An Telegram File Renamer Bot Which Can Rename A Telegram Files. \n You Can Set Permanent Thumbnail For The File So You Don't Have To Send Custom Thumbs All The Time.\n \n i can also convert files into videos \n Feedback @Sunisk or @Physic_hybrid If You Found Meh Useful</b>""" | ||
HELP_USER = """Ohh You Want Help?? 😅 | ||
1.🔹 <b>Send me any Telegram File.</b> \n | ||
2.🔹 <b>Reply to that message with /rename New file name.extnsion</b> \n | ||
3.🔹 <b> Send A Photo to make it as permanent Thumbnail</b> \n | ||
4.🔹 <b> I Can Also Convert Files Into Video through /c2v Command </b> \n \n <b>Made With Love By: @Sunisk & @Physic_hybrid</b>""" | ||
|