forked from Mufaz-TG/URL-Uploader
-
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
133fba0
commit eed609d
Showing
8 changed files
with
248 additions
and
2 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 |
---|---|---|
@@ -1,2 +1,35 @@ | ||
# UPLOADER-BOT | ||
Powerful Url uploader bot With Mongodb support 🔥 | ||
## Uploader X Bot | ||
--- | ||
|
||
Telegram RoBot to Upload Links. | ||
|
||
**Features**: | ||
|
||
👉 Upload [YouTube-dl Supported Links](https://ytdl-org.github.io/youtube-dl/supportedsites.html) to Telegram. | ||
|
||
👉 Upload HTTP/HTTPS as File/Video to Telegram. | ||
|
||
👉 Upload zee5, sony.live, voot and much more 😋 | ||
|
||
👉 Broadcast message, check total users | ||
|
||
👉 Permanent thumbnail Support | ||
|
||
**Heroku Buildpacks** | ||
``` | ||
https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest | ||
``` | ||
``` | ||
heroku/python | ||
``` | ||
|
||
|
||
## Credits, and Thanks to | ||
|
||
* [@SpEcHlDe](https://t.me/ThankTelegram) for his [AnyDLBot](https://telegram.dog/AnyDLBot) | ||
* [Dan Tès](https://t.me/haskell) for his [Pyrogram Library](https://github.com/pyrogram/pyrogram) | ||
* [Yoily](https://t.me/YoilyL) for his [UploaditBot](https://telegram.dog/UploaditBot) | ||
* [@AbirHasan2005](https://t.me/AbirHasan2005) for his [database.py](https://github.com/AbirHasan2005/VideoCompress/blob/main/bot/database/database.py) | ||
* [@DC4_WARRIOR](https://t.me/Space_X_bots) | ||
#### LICENSE | ||
- GPLv3 |
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,87 @@ | ||
{ | ||
"name": "X-URL-Uploader", | ||
"description": "Telegram Bot to Upload URLs to Telegram as File and Video.", | ||
"keywords": [ | ||
"telegram", | ||
"best", | ||
"youtube", | ||
"downloader", | ||
"open", | ||
"source", | ||
"multi", | ||
"purpose", | ||
"ffmpeg", | ||
"remote", | ||
"uploader" | ||
], | ||
"success_url": "https://t.me/xurluploaderbot", | ||
"website": "https://github.com/X-Gorn", | ||
"repository": "https://github.com/X-Gorn/X-URL-Uploader", | ||
"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": "" | ||
}, | ||
"APP_ID": { | ||
"description": "Get this value from https://my.telegram.org", | ||
"value": "" | ||
}, | ||
"API_HASH": { | ||
"description": "Get this value from https://my.telegram.org", | ||
"value": "" | ||
}, | ||
"OWNER_ID": { | ||
"description": "Your Telegram ID", | ||
"value": "" | ||
}, | ||
"DATABASE_URL": { | ||
"description": "Your MongoDB URI", | ||
"value": "" | ||
}, | ||
"SESSION_NAME": { | ||
"description": "Your Session Name", | ||
"value": "URL-UPLOADER" | ||
}, | ||
"BANNED_USERS": { | ||
"description": "Banned Unwanted members..", | ||
"value": "", | ||
"required": false | ||
}, | ||
"UPDATE_CHANNEL": { | ||
"description": "For Force Subscribe. Paste your Update channel USERNAME (without @)..", | ||
"value": "", | ||
"required": false | ||
}, | ||
"DEF_THUMB_NAIL_VID_S": { | ||
"description": "default thumbnail to be used in the videos. Incase, youtube-dl is unable to find a thumbnail.", | ||
"value": "", | ||
"required": false | ||
}, | ||
"CHUNK_SIZE": { | ||
"description": "chunk size that should be used with requests", | ||
"value": "128" | ||
}, | ||
"HTTP_PROXY": { | ||
"description": "proxy for accessing youtube-dl in GeoRestricted Areas. Get your own proxy from https://github.com/rg3/youtube-dl/issues/1091#issuecomment-230163061", | ||
"value": "", | ||
"required": false | ||
} | ||
}, | ||
"addons": [ | ||
], | ||
"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,35 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# (c) Shrimadhav U K | Modifieded By : @DC4_WARRIOR | ||
|
||
# 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 | ||
|
||
from pyrogram import Client as Clinton | ||
from pyrogram import filters | ||
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") | ||
Warrior = Clinton( | ||
"@UPLOADER_X_BOT", | ||
bot_token=Config.TG_BOT_TOKEN, | ||
api_id=Config.APP_ID, | ||
api_hash=Config.API_HASH, | ||
plugins=plugins) | ||
Warrior.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,15 @@ | ||
aiohttp | ||
beautifulsoup4 | ||
hachoir | ||
numpy | ||
Pillow | ||
pyrogram | ||
requests | ||
tgcrypto | ||
yt-dlp | ||
olefile | ||
filetype | ||
tldextract | ||
motor | ||
https://github.com/Tinche/aiofiles/archive/master.zip | ||
dnspython |
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.9.7 |
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 @@ | ||
import os | ||
|
||
class Config(object): | ||
# 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 | ||
# Banned Unwanted Members.. | ||
BANNED_USERS = set(int(x) for x in os.environ.get("BANNED_USERS", "").split()) | ||
# the download location, where the HTTP Server runs | ||
DOWNLOAD_LOCATION = "./DOWNLOADS" | ||
# Update channel for Force Subscribe | ||
UPDATE_CHANNEL = os.environ.get("UPDATE_CHANNEL", "") | ||
# 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", "") | ||
# 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", "") | ||
# maximum message length in Telegram | ||
MAX_MESSAGE_LENGTH = 4096 | ||
# set timeout for subprocess | ||
PROCESS_MAX_TIMEOUT = 3600 | ||
# watermark file | ||
DEF_WATER_MARK_FILE = "" | ||
# your telegram id | ||
OWNER_ID = int(os.environ.get("OWNER_ID", "")) | ||
# database session name, example: xurluploader | ||
SESSION_NAME = os.environ.get("SESSION_NAME", "") | ||
# database uri (mongodb) | ||
DATABASE_URL = 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,36 @@ | ||
class Translation(object): | ||
START_TEXT = """Hi {}, | ||
I'm URL X Uploader! | ||
You can upload HTTP/HTTPS direct link, Using this bot! | ||
/help for more details!""" | ||
FORMAT_SELECTION = "Select the desired format: <a href='{}'>file size might be approximate</a> \nIf you want to set custom thumbnail, send photo before or quickly after tapping on any of the below buttons.\nYou can use /deletethumbnail to delete the auto-generated thumbnail." | ||
SET_CUSTOM_USERNAME_PASSWORD = """If you want to download premium videos, provide in the following format: | ||
URL | filename | username | password""" | ||
DOWNLOAD_START = "📥Downloading..." | ||
UPLOAD_START = "📤Uploading..." | ||
RCHD_TG_API_LIMIT = "Downloaded in {} seconds.\nDetected File Size: {}\nSorry. But, I cannot upload files greater than 2GB due to Telegram API limitations." | ||
AFTER_SUCCESSFUL_UPLOAD_MSG = "Thanks for using @Uploader_X_bot\n\n<b>Join : @Space_X_Bots</b>" | ||
AFTER_SUCCESSFUL_UPLOAD_MSG_WITH_TS = "Downloaded in {} seconds.\nUploaded in {} seconds.\n\n@xurluploaderbot" | ||
SAVED_CUSTOM_THUMB_NAIL = "Custom video / file thumbnail saved. This image will be used in the video / file." | ||
DEL_ETED_CUSTOM_THUMB_NAIL = "✅ Custom thumbnail cleared succesfully." | ||
CUSTOM_CAPTION_UL_FILE = "{}" | ||
NO_VOID_FORMAT_FOUND = "ERROR...\n<b>YouTubeDL</b> said: {}" | ||
HELP_USER = """How to Use Me? Follow These steps! | ||
1. Send url (example.domain/File.mp4 | New Filename.mp4). | ||
2. Send Image As Custom Thumbnail (Optional). | ||
3. Select the button. | ||
SVideo - Give File as video with Screenshots | ||
DFile - Give File (video) as file with Screenshots | ||
Video - Give File as video without Screenshots | ||
File - Give File without Screenshots | ||
If bot didn't respond, contact @Sources_Codes""" | ||
REPLY_TO_MEDIA_ALBUM_TO_GEN_THUMB = "Reply /generatecustomthumbnail to a media album, to generate custom thumbail" | ||
ERR_ONLY_TWO_MEDIA_IN_ALBUM = """Media Album should contain only two photos. Please re-send the media album, and then try again, or send only two photos in an album." | ||
You can use /rename command after receiving file to rename it with custom thumbnail support. | ||
""" | ||
CANCEL_STR = "Process Cancelled" | ||
ZIP_UPLOADED_STR = "Uploaded {} files in {} seconds" | ||
SLOW_URL_DECED = "Gosh that seems to be a very slow URL. Since you were screwing my home, I am in no mood to download this file. Meanwhile, why don't you try this:==> https://shrtz.me/PtsVnf6 and get me a fast URL so that I can upload to Telegram, without me slowing down for other users." |