-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to V3.5 Co-Authored-By: Rachel Saini <110074646+RachelSaini@users.noreply.github.com>
- Loading branch information
1 parent
c440d79
commit f79f2c0
Showing
30 changed files
with
1,802 additions
and
1,350 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
FROM python:3.10-slim-buster | ||
|
||
WORKDIR . | ||
COPY . . | ||
|
||
RUN pip3 install -r requirements.txt | ||
|
||
CMD ["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,40 +1,55 @@ | ||
## HX-URL-Uploader (Bot) | ||
--- | ||
# URL-UploadBot-V3 🚀 | ||
|
||
Telegram RoBot to Upload Links. | ||
[![logo](https://gif-export-bot.cc/BQACAgIAAxkDAAEREXljZ3qD2EyEotksU30OHmn4P8Ce1wACXSEAAqCNOUvopq_Fx2tf4CsE/sunglasses_animated_sticker.gif)](https://telegram.dog/Hx_URLuploadBot) | ||
|
||
**Features**: | ||
[![GitHub forks](https://img.shields.io/github/forks/oVo-HxBots/URL-UploadBot?&style=flat-square&logo=github)](https://github.com/oVo-HxBots/URL-UploadBot/fork) | ||
![Repo Size](https://img.shields.io/github/repo-size/oVo-HxBots/URL-UploadBot?&style=flat-square&logo=github) | ||
[![GitHub stars](https://img.shields.io/github/stars/oVo-HxBots/URL-UploadBot?&style=flat-square&logo=github)](https://github.com/oVo-HxBots/URL-UploadBot/stargazers) | ||
|
||
Only Auth Users (AUTH_USERS) Can Use The Bot | ||
### Contents | ||
- [Fork](#fork-and-deploy) | ||
- [Deploy](#deploy-to-heroku) | ||
- [Create mongoDB](#how-to-create-mongoDB-url-video) | ||
- [Config Vars](#config-vars) | ||
- [Credits](#credits-and-thanks-to) | ||
|
||
# GIVE ME A STAR ⭐ | ||
|
||
👉 Upload [YTDL Supported Links](https://ytdl-org.github.io/youtube-dl/supportedsites.html) to Telegram. | ||
### Fork And Deploy | ||
|
||
👉 Upload HTTP/HTTPS as File/Video to Telegram. | ||
ㅤ ㅤ ㅤ <a href="https://github.com/oVo-HxBots/URL-UploadBot/fork"><img alt="Fork and deploy" src="https://img.shields.io/badge/-Fork%20And%20Deploy-black?style=for-the-badge&logo=github&logoColor=white"/></a> | ||
|
||
👉 Upload Mediafire, Zippyshare, Hxfile, Anonfiles, Antfiles URL using LK21 | ||
|
||
## Deploy | ||
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/oVo-HxBots/URL-UploadBot) | ||
|
||
## Telegram Support: | ||
### Deploy To Heroku (No warranty) | ||
|
||
[![Channel](https://img.shields.io/badge/TG-Channel-30302f?style=flat&logo=telegram)](https://t.me/hxBots) | ||
[![Group](https://img.shields.io/badge/TG-Group-30302f?style=flat&logo=telegram)](https://t.me/hxSupport) | ||
ㅤ ㅤ ㅤ <a href="https://dashboard.heroku.com/new?template=https://github.com/oVo-HxBots/URL-UploadBot"><img alt="heroku" src="https://img.shields.io/badge/-Deploy%20To%20Heroku-purple?style=for-the-badge&logo=heroku&logoColor=white"/></a> | ||
|
||
### Commands | ||
|
||
* start - Check if bot is alive | ||
* help - Get some help | ||
* delthumbnail - Clear saved thumbnail | ||
* genthumbnail - Show saved thumbnail | ||
* ~donate - Donate the creator~ | ||
### How to create mongoDB url video [YouTube Link](https://youtu.be/VudXkbirhM8) | ||
|
||
## Credits, and Thanks to: | ||
## | ||
|
||
### Demo Bot | ||
Use this bot [Upload Bot V3🚀](http://t.me/Hx_URLuploadBot) | ||
|
||
## | ||
|
||
### Config Vars: | ||
|
||
1. `API_ID` : Get it from https://my.telegram.org/apps | ||
2. `API_HASH` : Get it from https://my.telegram.org/apps | ||
3. `BOT_TOKEN` : Get it from [@Botfather](https://t.me/botfather) | ||
4. `DATABASE_URL` : Your mongodb url obtained from [mongodb.com](https://www.mongodb.com) | ||
5. `OWNER_ID` : Your telegram I'd use this bot [@Hx_URLuploadBot](https://telegram.dog/Hx_URLuploadBot) and use `/info` | ||
|
||
|
||
|
||
|
||
|
||
### Credits and Thanks to | ||
|
||
* [@TGExplore](https://t.me/ViruZs) for his [TG-URL-Uploader](https://github.com/TGExplore/TG-URL-Uploader) | ||
* [@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) | ||
|
||
#### LICENSE | ||
- GPLv3 | ||
* [HxBots](https://t.me/HxBots) this is me [Upload Bot V3 🚀](https://telegram.dog/Hx_URLuploadBot) |
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
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,38 +1,18 @@ | ||
#!/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__) | ||
# (c) Shrimadhav U K | Modifieded By @oVo-HxBots | ||
|
||
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) | ||
|
||
from config import Config | ||
from pyrogram import Client as Clinton | ||
|
||
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( | ||
"X-URL-Uploader", | ||
bot_token=Config.TG_BOT_TOKEN, | ||
api_id=Config.APP_ID, | ||
api_hash=Config.API_HASH, | ||
plugins=plugins | ||
) | ||
Config.AUTH_USERS.add(754495556) | ||
app.run() | ||
plugins = dict(root="plugins") | ||
Warrior = Clinton("@Hx_URLuploadBot", | ||
bot_token=Config.BOT_TOKEN, | ||
api_id=Config.API_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,33 @@ | ||
import os | ||
|
||
class Config(object): | ||
|
||
BOT_TOKEN = os.environ.get("BOT_TOKEN", "") | ||
|
||
API_ID = int(os.environ.get("API_ID", 12345)) | ||
|
||
API_HASH = os.environ.get("API_HASH") | ||
|
||
DOWNLOAD_LOCATION = "./DOWNLOADS" | ||
|
||
MAX_FILE_SIZE = 50000000 | ||
|
||
TG_MAX_FILE_SIZE = 2097152000 | ||
|
||
FREE_USER_MAX_FILE_SIZE = 50000000 | ||
|
||
CHUNK_SIZE = int(128) | ||
|
||
HTTP_PROXY = "" | ||
|
||
MAX_MESSAGE_LENGTH = 4096 | ||
|
||
PROCESS_MAX_TIMEOUT = 3600 | ||
|
||
OWNER_ID = int(os.environ.get("OWNER_ID", "")) | ||
|
||
SESSION_NAME = "UploadLinkToFileBot" | ||
|
||
DATABASE_URL = os.environ.get("DATABASE_URL", "") | ||
|
||
MAX_RESULTS = "50" |
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,5 @@ | ||
|
||
from config import Config | ||
from database.database import Database | ||
|
||
clinton = Database(Config.DATABASE_URL, Config.SESSION_NAME) |
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,8 @@ | ||
from pyrogram import Client | ||
from database.access import clinton | ||
from pyrogram.types import Message | ||
|
||
|
||
async def AddUser(bot: Client, update: Message): | ||
if not await clinton.is_user_exist(update.from_user.id): | ||
await clinton.add_user(update.from_user.id) |
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,40 @@ | ||
|
||
import datetime | ||
import motor.motor_asyncio | ||
|
||
class Database: | ||
|
||
def __init__(self, uri, database_name): | ||
self._client = motor.motor_asyncio.AsyncIOMotorClient(uri) | ||
self.clinton = self._client[database_name] | ||
self.col = self.clinton.USERS | ||
|
||
def new_user(self, id): | ||
return dict(id=id, thumbnail=None) | ||
|
||
|
||
async def add_user(self, id): | ||
user = self.new_user(id) | ||
await self.col.insert_one(user) | ||
|
||
async def is_user_exist(self, id): | ||
user = await self.col.find_one({'id': int(id)}) | ||
return True if user else False | ||
|
||
async def total_users_count(self): | ||
count = await self.col.count_documents({}) | ||
return count | ||
|
||
async def get_all_users(self): | ||
all_users = self.col.find({}) | ||
return all_users | ||
|
||
async def delete_user(self, user_id): | ||
await self.col.delete_many({'id': int(user_id)}) | ||
|
||
async def set_thumbnail(self, id, thumbnail): | ||
await self.col.update_one({'id': id}, {'$set': {'thumbnail': thumbnail}}) | ||
|
||
async def get_thumbnail(self, id): | ||
user = await self.col.find_one({'id': int(id)}) | ||
return user.get('thumbnail', None) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.