Skip to content

Commit

Permalink
V3.5
Browse files Browse the repository at this point in the history
Updated to V3.5

Co-Authored-By: Rachel Saini <110074646+RachelSaini@users.noreply.github.com>
  • Loading branch information
oVo-HxBots and Rachel Saini committed Nov 6, 2022
1 parent c440d79 commit f79f2c0
Show file tree
Hide file tree
Showing 30 changed files with 1,802 additions and 1,350 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

244 changes: 0 additions & 244 deletions COPYING

This file was deleted.

8 changes: 8 additions & 0 deletions Dockerfile
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"]
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

63 changes: 39 additions & 24 deletions README.md
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)
60 changes: 30 additions & 30 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "HX-URL-Uploader",
"description": "Telegram Bot to Upload URLs to Telegram as File and Video.",
"name": "URL-UploadBot V3 🚀",
"description": "Telegram Uploader Bot V3 🚀 File/Video",
"logo": "https://te.legra.ph/file/82c925ccc38606d837831.jpg",
"keywords": [
"telegram",
"best",
Expand All @@ -14,56 +15,55 @@
"remote",
"uploader"
],
"success_url": "https://t.me/Hx_URLuploadBot",
"website": "https://github.com/Ovo-HxBots",
"success_url": "http://t.me/Hx_URLuploadBot",
"website": "https://github.com/oVo-HxBots",
"repository": "https://github.com/oVo-HxBots/URL-UploadBot",

"env": {
"WEBHOOK": {
"description": "Setting this to ANYTHING will enable webhooks when in env mode",
"value": "ANYTHING"
},
"TG_BOT_TOKEN": {

"BOT_TOKEN": {
"description": "Your bot token, as a string.",
"value": ""
},
"APP_ID": {

"API_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 (your id).",
"value": "87371682 754495556 72736723"
},
"DEF_THUMB_NAIL_VID_S": {
"description": "default thumbnail to be used in the videos. Incase, youtube-dl is unable to find a thumbnail.",
"value": "https://telegra.ph/file/e047000b74b7857d0777f.jpg",
"required": false
},
"CHUNK_SIZE": {
"description": "chunk size that should be used with requests",
"value": "128"

"OWNER_ID": {
"description": "Your Telegram ID",
"value": ""
},
"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

"DATABASE_URL": {
"description": "Your MongoDB URI",
"value": ""
}

},
"addons": [
],
"buildpacks": [{

"addons": [ ],
"buildpacks": [
{
"url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest"
}, {
},
{
"url": "heroku/python"
}],
"formation": {
"worker": {
"quantity": 1,
"size": "free"
}
"worker": {
"quantity": 1,
"size": "free"
}
}
}
40 changes: 10 additions & 30 deletions bot.py
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()
33 changes: 33 additions & 0 deletions config.py
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"
5 changes: 5 additions & 0 deletions database/access.py
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)
8 changes: 8 additions & 0 deletions database/adduser.py
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)
40 changes: 40 additions & 0 deletions database/database.py
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)
64 changes: 0 additions & 64 deletions helper_funcs/database.py

This file was deleted.

Loading

0 comments on commit f79f2c0

Please sign in to comment.