Skip to content
Draft

T #7

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6828c89
start.py
PredatorHackerzZ May 22, 2021
049f1d3
stream.py
PredatorHackerzZ May 22, 2021
890538b
broadcast_helper.py
PredatorHackerzZ May 22, 2021
f1cb203
database.py
PredatorHackerzZ May 22, 2021
a2ed87c
human_readable.py
PredatorHackerzZ May 22, 2021
8ee4ce6
vars.py
PredatorHackerzZ May 22, 2021
3d3c7ac
README.md
PredatorHackerzZ May 22, 2021
13854c4
app.json
PredatorHackerzZ May 22, 2021
0c657e1
stream.py
PredatorHackerzZ May 24, 2021
2379578
start.py
PredatorHackerzZ May 28, 2021
7326078
admin.py
PredatorHackerzZ May 28, 2021
ee9896a
stream.py
PredatorHackerzZ May 28, 2021
3737747
start.py
PredatorHackerzZ May 28, 2021
a6ab487
start.py
PredatorHackerzZ May 28, 2021
29758d8
start.py
PredatorHackerzZ May 28, 2021
0c3ff74
start.py
PredatorHackerzZ May 28, 2021
f13103a
start.py
PredatorHackerzZ May 28, 2021
f1bf88b
Alive.yml
PredatorHackerzZ Jun 8, 2021
ec36654
Update README.md
PredatorHackerzZ Oct 1, 2021
a32bdc4
Update start.py
PredatorHackerzZ Nov 21, 2021
581935a
Update stream.py
PredatorHackerzZ Nov 21, 2021
97df789
Update start.py
PredatorHackerzZ Nov 26, 2021
4d5febc
Update start.py
PredatorHackerzZ Dec 16, 2021
3084ebd
Update start.py
PredatorHackerzZ Dec 16, 2021
9ad0c61
Update start.py
PredatorHackerzZ Dec 16, 2021
f99ca13
Update start.py
PredatorHackerzZ Dec 16, 2021
b874dab
Update Alive.yml
PredatorHackerzZ Dec 17, 2021
41be838
Update Alive.yml
PredatorHackerzZ Feb 1, 2022
b1eb13b
Update start.py
PredatorHackerzZ Feb 28, 2022
d82827c
Update requirements.txt
PredatorHackerzZ Aug 1, 2022
91521d9
Update stream.py
PredatorHackerzZ Aug 1, 2022
8aa3083
Update start.py
PredatorHackerzZ Dec 31, 2022
d5d8d51
Update vars.py
PredatorHackerzZ Dec 31, 2022
2fa6486
Update start.py
PredatorHackerzZ Dec 31, 2022
4fd184c
Update stream.py
PredatorHackerzZ Dec 31, 2022
59245b2
Update start.py
MrAbhi2k3 Jan 18, 2023
3f0ed38
Update README.md
MrAbhi2k3 Jan 18, 2023
5b6b84a
Update vars.py
MrAbhi2k3 Jan 18, 2023
9265417
Delete WebStreamer directory
PredatorHackerzZ Mar 4, 2023
51b782d
Delete requirements.txt
PredatorHackerzZ Mar 4, 2023
fc7a071
Create requirements.txt
PredatorHackerzZ Mar 4, 2023
dac9fb6
Add files via upload
PredatorHackerzZ Mar 4, 2023
e251eb0
Add files via upload
PredatorHackerzZ Mar 4, 2023
2aece5c
Update README.md
PredatorHackerzZ Mar 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Alive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ jobs:
steps:
- uses: mikeesto/heroku-awake@1.0.0
with:
URL: "https://ahfile2link.herokuapp.com"
URL: "https://teleroidfilelinkbot.herokuapp.com"

2 changes: 2 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
language = "bash"
run = "pip3 install -r requirements.txt; python3 -m WebStreamer"
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<h1 align="center">Telegram File Stream Bot</h1>
<p align="center">
<a href="https://github.com/AbirHasan2005/Pyro-FileStreamBot">
<img src="https://socialify.git.ci/AbirHasan2005/Pyro-FileStreamBot/image?description=1&font=Source%20Code%20Pro&forks=1&issues=1&logo=https%3A%2F%2Fwww.flaticon.com%2Fpremium-icon%2Ficons%2Fsvg%2F2321%2F2321089.svg&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark" alt="Cover Image" width="650">
<a href="https://github.com/PredatorHackerzZ/TG-File2Link">
<img src="https://socialify.git.ci/PredatorHackerzZ/TG-File2Link/image?description=1&font=Source%20Code%20Pro&forks=1&issues=1&logo=https%3A%2F%2Fwww.flaticon.com%2Fpremium-icon%2Ficons%2Fsvg%2F2321%2F2321089.svg&pattern=Circuit%20Board&pulls=1&stargazers=1&theme=Dark" alt="Cover Image" width="650">
</a>
<p align="center">
A Telegram bot to stream files to web
<br />
<a href="https://telegram.dog/AH_File2Link_Bot"><strong>Demo Bot »</strong></a>
<a href="https://telegram.dog/TeleRoid_File2Link_Bot"><strong>Demo Bot »</strong></a>
<br />
<a href="https://github.com/AbirHasan2005/Pyro-FileStreamBot/issues">Report a Bug</a>
<a href="https://github.com/PredatorHackerzZ/TG-File2Link/issues">Report a Bug</a>
|
<a href="https://github.com/AbirHasan2005/Pyro-FileStreamBot/issues">Request Feature</a>
<a href="https://github.com/PredatorHackerzZ/TG-File2Link/issues">Request Feature</a>
</p>
</p>

Expand Down Expand Up @@ -47,7 +47,7 @@
## About This Bot

<p align="center">
<a href="https://github.com/AbirHasan2005/Pyro-FileStreamBot">
<a href="https://github.com/PredatorHackerzZ/TG-File2Link">
<img src="https://www.flaticon.com/premium-icon/icons/svg/2626/2626281.svg" height="100" width="100" alt="Telegram Logo">
</a>
</p>
Expand All @@ -74,7 +74,7 @@ then goto the <a href="#mandatory-vars">variables tab</a> for more info on setti
### Host it on VPS or Locally

```sh
git clone https://github.com/AbirHasan2005/Pyro-FileStreamBot
git clone https://github.com/MrAbhi2k3/Pyro-FileStreamBot
cd TG-FileStreamBot
virtualenv -p /usr/bin/python3 venv
. ./venv/bin/activate
Expand Down Expand Up @@ -114,7 +114,7 @@ DATABASE_URL=mongodb_uri

`OWNER_ID` : Your Telegram User ID

`DATABASE_URL` : MongoDB URI for saving User IDs when they first Start the Bot. We will use that for Broadcasting to them. I will try to add more features related with Database. If you need help to get the URI you can ask in [Support Group](https://t.me/linux_repo).
`DATABASE_URL` : MongoDB URI for saving User IDs when they first Start the Bot. We will use that for Broadcasting to them. I will try to add more features related with Database. If you need help to get the URI you can ask in [Support Group](https://t.me/TeleRoid14).

### Optional Vars

Expand Down Expand Up @@ -145,19 +145,18 @@ To get an instant stream link, just forward any media to the bot and boom, its f
## Demo Bot:
<a href="https://t.me/AH_File2Link_Bot"><img src="https://img.shields.io/badge/Demo-Telegram%20Bot-blue.svg?logo=telegram"></a>

[![Heroku Awake](https://github.com/AbirHasan2005/Pyro-FileStreamBot/actions/workflows/Alive.yml/badge.svg?event=status)](https://github.com/AbirHasan2005/Pyro-FileStreamBot/actions/workflows/Alive.yml)
[![Heroku Awake](https://github.com/P-Phreak/Pyro-FileStreamBot/actions/workflows/Alive.yml/badge.svg?event=status)](https://github.com/P-Phreak/Pyro-FileStreamBot/actions/workflows/Alive.yml)

## Special Features:
- Added Mongo Database Support!
- Added Broadcast Feature!
- Added Both Channel & Private Chat Support!
- Made Better Bin Channel Logging!

- Added 4GB+ Support in Repo.
### Channel Support:
Bot also Supported with Channels. Just add bot Channel as Admin. If any new file comes in Channel it will edit it with **Get Download Link** Button.

## Credits

- [@EverythingSuckz](https://github.com/EverythingSuckz) & [@AbirHasan2005](https://github.com/AbirHasan2005)
- [eyaadh](https://github.com/eyaadh) for his awesome [Megatron Bot](https://github.com/eyaadh/megadlbot_oss)
- [Dan Tès](https://telegram.dog/haskell) for his [Pyrogram Library](https://github.com/pyrogram/pyrogram)
- [@PredatorHackerzZ](https://github.com/PredatorHackerzZ)
3 changes: 1 addition & 2 deletions WebStreamer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# This file is a part of TG-FileStreamBot
# Coding : Jyothis Jayanth [@EverythingSuckz]
# This file is a part of PredatorHackerzZ/TG-File2Link
9 changes: 6 additions & 3 deletions WebStreamer/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This file is a part of TG-FileStreamBot
# Coding: @EverythingSuckz & @AbirHasan2005

import os
import sys
Expand All @@ -13,6 +11,7 @@
from .vars import Var
from aiohttp import web
from .server import web_server
from .utils.keepalive import ping_server

ppath = "WebStreamer/bot/plugins/*.py"
files = glob.glob(ppath)
Expand Down Expand Up @@ -51,11 +50,15 @@ async def start_services():
print(' server ip =>> {}:{}'.format(bind_address, Var.PORT))
if Var.ON_HEROKU:
print(' app runnng on =>> {}'.format(Var.FQDN))
if Var.ON_HEROKU:
print('------------------ Starting Keep Alive Service ------------------')
print('\n')
await asyncio.create_task(ping_server())
print('---------------------------------------------------------------')
await idle()

if __name__ == '__main__':
try:
loop.run_until_complete(start_services())
except KeyboardInterrupt:
print('----------------------- Service Stopped -----------------------')
print('----------------------- Service Stopped -----------------------')
6 changes: 2 additions & 4 deletions WebStreamer/bot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# This file is a part of TG-FileStreamBot
# Coding : Jyothis Jayanth [@EverythingSuckz]

from pyrogram import Client
from ..vars import Var

StreamBot = Client(
session_name='Web Streamer',
name='Web Streamer',
api_id=Var.API_ID,
api_hash=Var.API_HASH,
bot_token=Var.BOT_TOKEN,
sleep_threshold=Var.SLEEP_THRESHOLD,
workers=Var.WORKERS
)
)
11 changes: 6 additions & 5 deletions WebStreamer/bot/plugins/admin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# (c) @AbirHasan2005
# (c) @Avishkarpatil

import os
import time
Expand All @@ -13,17 +13,18 @@
from WebStreamer.vars import Var
from pyrogram import filters, Client
from pyrogram.types import Message
from pyrogram.enums.parse_mode import ParseMode
db = Database(Var.DATABASE_URL, Var.SESSION_NAME)
broadcast_ids = {}


@StreamBot.on_message(filters.command("status") & filters.private & filters.user(Var.OWNER_ID) & ~filters.edited)
@StreamBot.on_message(filters.command("status") & filters.private & filters.user(Var.OWNER_ID))
async def sts(c: Client, m: Message):
total_users = await db.total_users_count()
await m.reply_text(text=f"**Total Users in DB:** `{total_users}`", parse_mode="Markdown", quote=True)
await m.reply_text(text=f"**Total Users in DB:** `{total_users}`", parse_mode=ParseMode.MARKDOWN, quote=True)


@StreamBot.on_message(filters.command("broadcast") & filters.private & filters.user(Var.OWNER_ID) & filters.reply & ~filters.edited)
@StreamBot.on_message(filters.command("broadcast") & filters.private & filters.user(Var.OWNER_ID) & filters.reply)
async def broadcast_(c, m):
all_users = await db.get_all_users()
broadcast_msg = m.reply_to_message
Expand Down Expand Up @@ -86,4 +87,4 @@ async def broadcast_(c, m):
caption=f"broadcast completed in `{completed_in}`\n\nTotal users {total_users}.\nTotal done {done}, {success} success and {failed} failed.",
quote=True
)
os.remove('broadcast.txt')
os.remove('broadcast.txt')
Loading