diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 0bd91ea..0000000 --- a/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -FROM python:3.9.2-slim-buster -RUN mkdir /app && chmod 777 /app -WORKDIR /app -ENV DEBIAN_FRONTEND=noninteractive -RUN apt -qq update && apt -qq install -y git python3 python3-pip ffmpeg -COPY . . -RUN pip3 install --no-cache-dir -r requirements.txt -CMD ["bash","bash.sh"] diff --git a/app.json b/app.json deleted file mode 100644 index d27f2e8..0000000 --- a/app.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "Save restricted content bot", - "description": "Telegram bot to save restricted content.", - "logo": "", - "keywords": [ - "telegram", - "Save restricted content", - "bot" - ], - "repository": "https://github.com/8769ANURAG/SaveRestrictedContentBot", - "website": "", - "success_url": "https://t.me/sources_cods", - "env": { - "API_HASH": { - "description": "Your API HASH from my.telegram.org", - "value": "" - }, - "API_ID": { - "description": "Your API ID from my.telegram.org", - "value": "" - }, - "BOT_TOKEN": { - "description": "Bot token, get it from @BotFather.", - "value": "" - }, - "SESSION": { - "description": "Pyrogram string session.", - "value": "" - }, - "AUTH": { - "description": "User ID of Bot owner.", - "value": "" - }, - "FORCESUB": { - "description": "Username name of public channel without using '@'.", - "value": "" - } - }, - "buildpacks": [ - { - "url": "heroku/python" - }, - { - "url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git" - } - ] -} diff --git a/bash.sh b/bash.sh deleted file mode 100644 index 4bafc42..0000000 --- a/bash.sh +++ /dev/null @@ -1,2 +0,0 @@ -echo "starting Bot ~@Am_RoBots"; -python3 -m main diff --git a/main/__init__.py b/main/__init__.py index bb46c12..6a89e25 100644 --- a/main/__init__.py +++ b/main/__init__.py @@ -17,8 +17,13 @@ BOT_TOKEN = config("BOT_TOKEN", default=None) SESSION = config("SESSION", default=None) FORCESUB = config("FORCESUB", default=None) -AUTH = config("AUTH", default=None, cast=int) +AUTH = [] +auth = config("AUTH", default=None, cast=int) +ids = auth.split(",") +for id in ids: + AUTH.append(int(id)) + bot = TelegramClient('bot', API_ID, API_HASH).start(bot_token=BOT_TOKEN) userbot = Client( diff --git a/main/plugins/batch.py b/main/plugins/batch.py index c0e0706..80278e0 100644 --- a/main/plugins/batch.py +++ b/main/plugins/batch.py @@ -5,7 +5,7 @@ Plugin for both public & private channels! """ -import time, os, asyncio +import time, os from .. import bot as Drone from .. import userbot, Bot, AUTH diff --git a/main/plugins/frontend.py b/main/plugins/main.py similarity index 80% rename from main/plugins/frontend.py rename to main/plugins/main.py index 69f4680..f8e8aa9 100644 --- a/main/plugins/frontend.py +++ b/main/plugins/main.py @@ -6,16 +6,17 @@ from .. import userbot, Bot from .. import FORCESUB as fs from main.plugins.pyroplug import get_msg -from main.plugins.helpers import get_link, join, screenshot from telethon import events +from telethon.tl.types import DocumentAttributeVideo + +from ethon.pyfunc import video_metadata +from ethon.telefunc import fast_upload, fast_download, force_sub -from ethon.telefunc import force_sub +from main.plugins.helpers import get_link, join, screenshot ft = f"To use this bot you've to join @{fs}." -message = "Send me the message link you want to start saving from, as a reply to this message." - # To-Do: # Make these codes shorter and clean # ofc will never do it. @@ -23,9 +24,7 @@ @Drone.on(events.NewMessage(incoming=True, func=lambda e: e.is_private)) async def clone(event): if event.is_reply: - reply = await event.get_reply_message() - if reply.text == message: - return + return try: link = get_link(event.text) if not link: diff --git a/main/plugins/pyroplug.py b/main/plugins/pyroplug.py index 9f6b060..98b6ca9 100644 --- a/main/plugins/pyroplug.py +++ b/main/plugins/pyroplug.py @@ -1,4 +1,4 @@ -# Github.com/8769Anurag +#Github.com/8769Anurag import asyncio, time, os @@ -67,7 +67,7 @@ async def get_msg(userbot, client, sender, edit_id, msg_link, i): time.time() ) ) - await edit.edit('Preparing to Upload!') + await edit.edit('Prearing to Upload!') caption = str(file) if msg.caption is not None: caption = msg.caption diff --git a/okteto-stack.yaml b/okteto-stack.yaml deleted file mode 100644 index 0ee6624..0000000 --- a/okteto-stack.yaml +++ /dev/null @@ -1,15 +0,0 @@ -services: - drone-srcb: - build: . - environment: - API_ID: $API_ID - API_HASH: $API_HASH - BOT_TOKEN: $BOT_TOKEN - SESSION: $SESSION - AUTH: $AUTH - FORCESUB: $FORCESUB - ports: - - 8080 - resources: - cpu: 1000m - memory: 3Gi diff --git a/requirements.txt b/requirements.txt index 2691b93..116c3de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,8 @@ -#Github.com/8769Anurag +#Github.com-Vasusen-code ethon==1.3.6 cryptg tgcrypto -pyrogram==1.4.16 +telethon +pyrogram +python-decouple