bipinkrish / save-restricted-bot Goto Github PK
View Code? Open in Web Editor NEWA Telegram Bot, Which can send you restricted content by it's post link
A Telegram Bot, Which can send you restricted content by it's post link
The codes you wrote for batch processing are throwing an error of floodwait, and there might be a chance of an account ban. Add 3-5 second time gap before proceeding to the next link.
Thank you for fix, but I found new bug with latest code
When I send private group for join, bot return the error below:
Error : Telegram says: [400 BOT_METHOD_INVALID] - The method can't be used by bots (caused by "messages.ImportChatInvite")
So I manually entered the group and sent the link.
Then I got the following error: Error : Telegram says: [400 CHANNEL_INVALID] - The channel parameter is invalid (caused by "channels.GetChannels")
Is this just for me?
can you detailed in description how to run this bot
or where i should put Variables
e "/root/Save-Restricted-Bot/main.py", line 22, in
acc.start()
File "/usr/local/lib/python3.10/site-packages/pyrogram/sync.py", line 66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete
return future.result()
File "/usr/local/lib/python3.10/site-packages/pyrogram/methods/utilities/start.py", line 58, in start
is_authorized = await self.connect()
File "/usr/local/lib/python3.10/site-packages/pyrogram/methods/auth/connect.py", line 40, in connect
await self.load_session()
File "/usr/local/lib/python3.10/site-packages/pyrogram/client.py", line 616, in load_session
await self.storage.open()
File "/usr/local/lib/python3.10/site-packages/pyrogram/storage/memory_storage.py", line 59, in open
dc_id, api_id, test_mode, auth_key, user_id, is_bot = struct.unpack(
struct.error: unpack requires a buffer of 271 bytes
root@59520408f719:~/Save-Restricted-Bot#
Save-Restricted-Bot-main>.\main.py
Traceback (most recent call last):
File "C:\Users\ddr7\Desktop\Save-Restricted-Bot-main\main.py", line 176, in
bot.run()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\run.py", line 84, in run
self.start()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\start.py", line 58, in start
is_authorized = await self.connect()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect
await self.load_session()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\client.py", line 627, in load_session
raise AttributeError("The API key is required for new authorizations. "
AttributeError: The API key is required for new authorizations. More info: https://docs.pyrogram.org/start/auth
C:\Users\ddr7\Desktop\Save-Restricted-Bot-main>.\main.py
Traceback (most recent call last):
File "C:\Users\ddr7\Desktop\Save-Restricted-Bot-main\main.py", line 176, in
bot.run()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\run.py", line 84, in run
self.start()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\start.py", line 58, in start
is_authorized = await self.connect()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect
await self.load_session()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\client.py", line 627, in load_session
raise AttributeError("The API key is required for new authorizations. "
AttributeError: The API key is required for new authorizations. More info: https://docs.pyrogram.org/start/auth
C:\Users\ddr7\Desktop\Save-Restricted-Bot-main>.\main.py
Traceback (most recent call last):
File "C:\Users\ddr7\Desktop\Save-Restricted-Bot-main\main.py", line 176, in
bot.run()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\run.py", line 84, in run
self.start()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\utilities\start.py", line 58, in start
is_authorized = await self.connect()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\methods\auth\connect.py", line 40, in connect
await self.load_session()
File "C:\Users\ddr7\AppData\Roaming\Python\Python311\site-packages\pyrogram\client.py", line 627, in load_session
raise AttributeError("The API key is required for new authorizations. "
AttributeError: The API key is required for new authorizations. More info: https://docs.pyrogram.org/start/auth
Hi
First thanks for your great work. the bot work perfect on channel content.
I try to use this bot to save restricted post on Private Group in Telegram.
bot I got below Error. Is it any solution?
Thanks a lot
https://t.me/c/0000000000/1137
Telegram says: [400 CHANNEL_INVALID] - The channel parameter is invalid (caused
by "channels.GetChannels")
Traceback (most recent call last):
File "C:\python\lib\site-packages\pyrogram\methods\advanced\resolve_peer.py",
line 62, in resolve_peer
return await self.storage.get_peer_by_id(peer_id)
File "C:\python\lib\site-packages\pyrogram\storage\sqlite_storage.py", line 14
2, in get_peer_by_id
raise KeyError(f"ID not found: {peer_id}")
KeyError: 'ID not found: -0000000000'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\python\lib\site-packages\pyrogram\dispatcher.py", line 242, in handle
r_worker
await self.loop.run_in_executor(
File "C:\python\lib\concurrent\futures\thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "main.py", line 113, in save
handle_private(message,chatid,msgid)
File "main.py", line 150, in handle_private
msg: pyrogram.types.messages_and_media.message.Message = acc.get_messages(ch
atid,msgid)
File "C:\python\lib\site-packages\pyrogram\sync.py", line 78, in async_to_sync
_wrap
return asyncio.run_coroutine_threadsafe(coroutine, main_loop).result()
File "C:\python\lib\concurrent\futures_base.py", line 439, in result
return self.__get_result()
File "C:\python\lib\concurrent\futures_base.py", line 388, in __get_result
raise self._exception
File "C:\python\lib\site-packages\pyrogram\methods\messages\get_messages.py",
line 101, in get_messages
peer = await self.resolve_peer(chat_id)
File "C:\python\lib\site-packages\pyrogram\methods\advanced\resolve_peer.py",
line 111, in resolve_peer
await self.invoke(
File "C:\python\lib\site-packages\pyrogram\methods\advanced\invoke.py", line 7
9, in invoke
r = await self.session.invoke(
File "C:\python\lib\site-packages\pyrogram\session\session.py", line 389, in i
nvoke
return await self.send(query, timeout=timeout)
File "C:\python\lib\site-packages\pyrogram\session\session.py", line 357, in s
end
RPCError.raise_it(result, type(data))
File "C:\python\lib\site-packages\pyrogram\errors\rpc_error.py", line 91, in r
aise_it
raise getattr(
pyrogram.errors.exceptions.bad_request_400.ChannelInvalid: Telegram says: [400 C
HANNEL_INVALID] - The channel parameter is invalid (caused by "channels.GetChannels")
support download from topics and story ies
I have done everything, I have configured my session, token, hash id, api id, etc. But when I send the post link to my bot I get the following in the console:
pyrogram.errors.exceptions.bad_request_400.MessageEmpty: Telegram says: [400 MESSAGE_EMPTY] - The message sent is empty or contains invalid characters (caused by "messages.SendMessage")
It should be noted that the link I am sending is from a private group, but the session is from my account that is in the group, so I don't know if I am doing something wrong, if you could suggest something it would be great.
Hi, I would like to know which client or tool I should use to get the ID of a message sent by a Telegram bot. I've heard that third party tools need to be used to conduct this procedure, but I don't know where to get them. Could someone please give me some pointers? Thank you in advance.
How setup this bot
Error : Telegram says: [400 CHANNEL_INVALID] - The channel parameter is invalid (caused by "channels.GetChannels")
Sorry for creating an issue. But I wanted to know the logic
Like I'm hosting it on my own computer but how does it uploads videos of 300+mb downloading them from the channel and reuploading in just few seconds?
And even I can't find the video downloaded to my local storage. So how does it do it??
What's the logic? Can you please explain. As I'm working on something very similar where I need this fast download speed to upload videos but I can't achieve this.
Title
Bot is not saving contents of public group please add support for public group also.
2024-02-13T15:06:16.406711+00:00 heroku[worker.1]: Error R12 (Exit timeout) -> At least one process failed to exit within 30 seconds of SIGTERM
2024-02-13T15:06:16.408693+00:00 heroku[worker.1]: Stopping remaining processes with SIGKILL
2024-02-13T15:06:16.471386+00:00 heroku[worker.1]: Process exited with status 137
Sir everything works fine but the only problem happens when we try to download a file whose caption contain mention link of someone's id
If we try to download it stucks on upload
Problem only happen when there is other person's mention id
If the msg have our mention id then it works fine
As you can see in picture same msg when i mention someone else it can't download
But if i mention myself it downloaded.
I was trying to run the bot, and it gave me this error:
Traceback (most recent call last):
File "C:\Users\umile\Desktop\Tools\Save-Restricted-Bot-main\main.py", line 22, in <module>
acc.start()
File "C:\Users\umile\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyrogram\sync.py", line 66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\umile\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\umile\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyrogram\methods\utilities\start.py", line 58, in start
is_authorized = await self.connect()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\umile\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyrogram\methods\auth\connect.py", line 47, in connect
await self.session.start()
File "C:\Users\umile\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyrogram\session\session.py", line 142, in start
raise e
File "C:\Users\umile\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyrogram\session\session.py", line 109, in start
await self.send(raw.functions.Ping(ping_id=0), timeout=self.START_TIMEOUT)
File "C:\Users\umile\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyrogram\session\session.py", line 333, in send
raise BadMsgNotification(result.error_code)
pyrogram.errors.BadMsgNotification: [16] The msg_id is too low, the client time has to be synchronized.
How can I fix it?
Can you please add stop command
Sometimes we need to stop process in batch process but we can't
So please add it.
Currently the normal telegram users can't get the files with a size greater than 2 gb,
It would be great to return a direct download link if the file size is greater than 2GB instead of receiving an error message.
It would be helpful to include the file caption as an extra text message as well.
I was having trouble getting the bot string, so I decided to use Pyrogram to get it. I used this code in python:
from pyrogram import Client
def get_session_string(api_id, api_hash, bot_token):
session_name = "my_bot.session" # Nome del file del database della sessione
app = Client(session_name, api_id=api_id, api_hash=api_hash, bot_token=bot_token)
with app:
return app.export_session_string()
if __name__ == "__main__":
# Sostituisci con i tuoi dati
API_ID = ""
API_HASH = ""
BOT_TOKEN = ""
session_string = get_session_string(API_ID, API_HASH, BOT_TOKEN)
print(f"Pyrogram session string: {session_string}")
Everything went like clockwork: I managed to get the string and entered this into the 'config.json' file. I start the bot via the command 'python main.py', and everything runs smoothly. However, as soon as I send the bot a link to a private channel post, it returns this message: "Error : Telegram says: [400 CHANNEL_INVALID] - The channel parameter is invalid (caused by "channels.GetChannels")". How do I solve this problem?
If we start batch process for private/public channel.. for example :- https://t.me/private or public_channel/1 - 10
and it Massage ID - 3,5,7 does not contain any media or content. Bot sending "Error : Telegram says: [400 MESSAGE_EMPTY] - The message sent is empty or contains invalid characters (caused by "messages.SendMessage")"
How to solve this problem.. i just want to skip those messages ID that doesn't contain any content by bot itself instead of sending error message [400 MESSAGE_EMPTY]
From Both public and private channel getting error like this.
Developer Please solve the problem. ๐๐๐ป
current version of the Project just supporting:
channels
bots
groups
not supporting:
Topics
user chats
user story
and question:
can i use https://t.me/b/botusername/1 - 100 ?
Hi
I cant run the code becuase of below error ,
Whats the problem ?
Thanks
(savebot) C:\Save-Restricted-Bot>python main.py
Traceback (most recent call last):
File "main.py", line 22, in
acc.start()
File "C:\Save-Restricted-Bot\savebot\lib\site-packages\pyrogram\sync.py", line
66, in async_to_sync_wrap
return loop.run_until_complete(coroutine)
File "C:\python\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "C:\Save-Restricted-Bot\savebot\lib\site-packages\pyrogram\methods\utilit
ies\start.py", line 58, in start
is_authorized = await self.connect()
File "C:\Save-Restricted-Bot\savebot\lib\site-packages\pyrogram\methods\auth\c
onnect.py", line 40, in connect
await self.load_session()
File "C:\Save-Restricted-Bot\savebot\lib\site-packages\pyrogram\client.py", li
ne 616, in load_session
await self.storage.open()
File "C:\Save-Restricted-Bot\savebot\lib\site-packages\pyrogram\storage\memory
_storage.py", line 59, in open
dc_id, api_id, test_mode, auth_key, user_id, is_bot = struct.unpack(
struct.error: unpack requires a buffer of 271 bytes
hi
the bot cant copy poll or multiple choice post .
how to slove it?
thanks
How to deploy it on heroku
Please Add Custom Filters To Save Restricted Content
List Of Filters
Texts
Documents
Videos
Audios
Sticker
Gif or Animation
Thank You Sir.
if you try to fetch a message that is not there (been deleted or "0" for example) it gives error..
"
Telegram says: [400 ME
SSAGE_EMPTY] - The message sent is empty or contains invalid characters (caused
by "messages.SendMessage")
"
i couldnt find a way around it or a way to filter those messages :(
i tried looking but i failed :((((
https://docs.pyrogram.org/api/methods/send_message#send-message
https://docs.pyrogram.org/telegram/types/message-empty
https://docs.pyrogram.org/api/errors/bad-request#
thanks in advance for the help! :)
Bro Some Private Video link not detect in bot..post only detected
#### โ ๏ธ GitGuardian has uncovered 1 secret following the scan of your pull request.
Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.
Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
- | - | Telegram Bot Token | aababe4 | main.py | View secret |
To avoid such incidents in the future consider
๐ฆ GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
Originally posted by @GitGuardian[bot] in #59 (comment)
Whenever I try to download from private channel/group, I got the below error
Error : Telegram says: [400 MESSAGE_EMPTY]
The message sent is empty or contains invalid characters (caused by "messages.SendMessages")
Please add Option to Cancel Current running Process!
Add a Logging of files in the Log Group and Collect What people are Using bot for(like forwarding Content in Private Dump)
TCP health check failed on port 8000. Retrying... how to fix it?
If possible add /batch command with no of file you want. I think this feature will be added soon. ๐ค
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.