Coder Social home page Coder Social logo

m4mallu / clonebot Goto Github PK

View Code? Open in Web Editor NEW
286.0 286.0 657.0 108 KB

A Telegram robot can clone medias from any chat to your own chat.

License: GNU General Public License v3.0

Python 99.07% Procfile 0.03% Batchfile 0.28% Dockerfile 0.60% Shell 0.02%
cloning media robot telegram

clonebot's Introduction

Hi... ๐Ÿ‘‹ I am Renjith.

I am an Electronics Engineer, Product Designer, digital fabricator and developer. I mostly preferred to do HMI projects using embedded systems, AI bot development for web applications and embedded system designing. I'm also learning different programming languages, frameworks, front end & backend deveopment, Mobile Apps, AI and Ml, and Databases.

My social media

Twitter Gmail Blog Blog

clonebot's People

Contributors

hithaishidesai avatar m4mallu avatar rinrinx2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clonebot's Issues

state changed from up to crashed

2022-05-27T19:45:18.076038+00:00 app[worker.1]: is_authorized = await self.connect()

2022-05-27T19:45:18.076048+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/pyrogram/methods/auth/connect.py", line 39, in connect

2022-05-27T19:45:18.076109+00:00 app[worker.1]: await self.load_session()

2022-05-27T19:45:18.076119+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/pyrogram/client.py", line 677, in load_session

2022-05-27T19:45:18.076320+00:00 app[worker.1]: await self.storage.open()

2022-05-27T19:45:18.076330+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/site-packages/pyrogram/storage/memory_storage.py", line 38, in open

2022-05-27T19:45:18.076397+00:00 app[worker.1]: dc_id, test_mode, auth_key, user_id, is_bot = struct.unpack(

2022-05-27T19:45:18.076425+00:00 app[worker.1]: struct.error: unpack requires a buffer of 267 bytes

2022-05-27T19:45:18.304373+00:00 heroku[worker.1]: Process exited with status 1

2022-05-27T19:45:18.368186+00:00 heroku[worker.1]: State changed from up to crashed

I deployed this bot but it always shows this error.
If anybody knows then please help.

Filters

This project is really amazing. Only thing that is missing is filters. Like message filtering with specific keywords ,either whitelist keyword or blacklist keyword. So we can control copying messages ,files including those keyword.
Thank you for awesome bot.

what sessions?

I use telethon string got error - struct.error: unpack requires a buffer of 263 bytes
I use pyrogram string - cant access channel

Please add text forward options

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

String error

2022-06-08T15:18:11.976419+00:00 app[worker.1]: return self._accessor.stat(self)
2022-06-08T15:18:11.976460+00:00 app[worker.1]: OSError: [Errno 36] File name too long: '.....................................xxxxxxxxxx. session'
2022-06-08T15:18:12.226860+00:00 heroku[worker.1]: Process exited with status 1
2022-06-08T15:18:12.441007+00:00 heroku[worker.1]: State changed from up to crashed

Created string session from user, still it gives this error file name too long.
Previously (5-6 month ago) it worked fine but now it throws this error maybe due to updated version of pyrogram.
I created string session from your new link you provided.
Please suggest a solution.

/settings

Add /settings commands so that we can avoid selection of target channel, file types and caption style

Minor bug in time duration display !

Discussed in #79

Originally posted by HithaishiDesai August 8, 2022
The Process Started on โฉ

Day 01 at 09:24 AM

Ended on ๐Ÿ“ด

Day 02 at 09:30 AM

The Bot showing โŽ

Time Taken : 00h 06m

The Bot Should Show โœ…

Time Taken : 24h 06m

IMG_20220808_140114

Bot doesn't prevent duplicates (files with same content but different names)

Normally, people consider duplicates when 2 or more files have the same content. I assumed that this bot will do the same, but this is not the case. The bot will only prevent duplicates that have the same name and same content, but will let pass the files with different names and same content.

The file_unique_id is not suitable for preventing duplicates (same content), only prevents duplicates with same file names and same content. You can check for yourself. Create 2 identical text files (same name and same content, check md5 hashes to be sure).

Upload them to @RawDataBot and check file_unique_id. It will be the same because files have the same name and the same content.

Now keep the same content, only rename files differently. Upload them to @RawDataBot and check their file_unique_id. It will be different, even if the files have the same content.

So the bot can only prevent duplicates in a limited case, when files have the same name and content. It will not prevent duplicates that have same content and different names. This should be made clear, so the users understand the limits of this bot.

I'm wonder if there is another method to prevent duplicates. You know if Telegram stores the md5 hashes for files? It will be useful to use them to prevent duplicates.

Just a question

Why not upgrade python to 3.10 from 3.8 ? Is there any perticular reason?

Bug report

Describe
First of all this is very nice bot... A bot I always was looking for... Thanks for building it.
I have a group
Some files are infected
'This message couldn't be displayed on your device because it contains pornographic materials.'
However, if the third-party telegram client removes the reference and forwards it to another chat, the infected media file can be displayed normally
Then I found this robot, but it doesn't seem to work. It only forwards normal chat messages. Infected messages won't be forwarded.

Option to forword text messages as well.

First of all this is very nice bot... A bot I always was looking for... Thanks for building it and I would really appreciate if you can add option to forword text messages as well

bug

this code is violet heroku please fix it

Caption which is a great feature that will save much time

Clone bot
I am using it always for forwarding files
The caption feature is also awesome
/setcaption {filename}
โ–ฑโ–ฐโ–ฑโ–ฐโ–ฑโ–ฐโ–ฑโ–ฐโ–ฑโ–ฐโ–ฑโ–ฐ
Size: {filesize}

๐— ๐—ผ๐—ฟ๐—ฒ ๐— ๐—ผ๐˜ƒ๐—ถ๐—ฒ๐˜€
โž–@ownerchannelโž–
๐— ๐—ฎ๐—ถ๐—ป ๐—ฐ๐—ต๐—ฎ๐—ป๐—ป๐—ฒ๐—น
โž–@ownerchannel2โž–
Is there any way to add custom caption like this....
It's very useful.....
Please bro
Then i could save hours editing captions....
โ˜บ๏ธ

#bug

IMG_20220727_134022_141
When ever user session restarts

โ€ขthe bot stops forwarding and
โ€ขdetails of previous forward get shrink and

we won't know the no. Of files forwarded earlier if we want to continue from there.

String

2021-09-20T07:56:14.131070+00:00 app[worker.1]: [20-Sep-21 07:56:14 - INFO] - bot - @Oloclon_bot started!
2021-09-20T07:56:15.864823+00:00 app[worker.1]: [20-Sep-21 07:56:15 - INFO] - user - @None started!
2021-09-20T07:56:16.106626+00:00 app[worker.1]: Bot is blocked by the session user !
2021-09-20T07:56:16.378755+00:00 heroku[worker.1]: Process exited with status 0
2021-09-20T07:56:16.556946+00:00 heroku[worker.1]: State changed from up to crashed

I think this issue is due to Telegram latest update where Telegram migrated from 32 to 64 bit if no is there any solution ? ๐Ÿ˜…

AttributeError: 'ChatPreview' object has no attribute 'id'

Sleeping for 4s (required by "channels.GetMessages")

2021-09-26T08:17:41.018533+00:00 app[worker.1]: [26-Sep-21 08:17:41 - ERROR] - pyrogram.dispatcher - 'ChatPreview' object has no attribute 'id'

2021-09-26T08:17:41.018556+00:00 app[worker.1]: Traceback (most recent call last):

2021-09-26T08:17:41.018557+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/pyrogram/dispatcher.py", line 217, in handler_worker

2021-09-26T08:17:41.018558+00:00 app[worker.1]:     await handler.callback(self.client, *args)

2021-09-26T08:17:41.018558+00:00 app[worker.1]:   File "/app/plugins/chat_config.py", line 70, in force_reply_msg

2021-09-26T08:17:41.018559+00:00 app[worker.1]:     chat_id = int(chat_status.id)

2021-09-26T08:17:41.018559+00:00 app[worker.1]: AttributeError: 'ChatPreview' object has no attribute 'id'

2021-09-26T08:18:56.624222+00:00 app[worker.1]: [26-Sep-21 08:18:56 - ERROR] - pyrogram.dispatcher - 'ChatPreview' object has no attribute 'id'

2021-09-26T08:18:56.624247+00:00 app[worker.1]: Traceback (most recent call last):

2021-09-26T08:18:56.624248+00:00 app[worker.1]:   File "/app/.heroku/python/lib/python3.8/site-packages/pyrogram/dispatcher.py", line 217, in handler_worker

2021-09-26T08:18:56.624248+00:00 app[worker.1]:     await handler.callback(self.client, *args)

2021-09-26T08:18:56.624249+00:00 app[worker.1]:   File "/app/plugins/chat_config.py", line 70, in force_reply_msg

2021-09-26T08:18:56.624249+00:00 app[worker.1]:     chat_id = int(chat_status.id)

2021-09-26T08:18:56.624249+00:00 app[worker.1]: AttributeError: 'ChatPreview' object has no attribute 'id'

It is not able to clone.

Whenever I Try To Clone From A Channel Where Forward Message Is Restricted It's Givies Error There Is Anu Way To Fix This?

no response after start Indexing

Hi, Bot deployed successfully on Heroku. Source & Target set. Then it starts indexing but nothing happens afterwards. Am I doing something wrong?

How to send text messages also

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

๐™Ž๐™ค๐™ข๐™š๐™ฉ๐™๐™ž๐™ฃ๐™œ ๐™ฌ๐™š๐™ฃ๐™ฉ ๐™ฌ๐™ง๐™ค๐™ฃ๐™œ ! ๐˜Š๐˜ฐ๐˜ฑ๐˜บ๐˜ช๐˜ฏ๐˜จ ๐˜ข๐˜ฃ๐˜ฐ๐˜ณ๐˜ต๐˜ฆ๐˜ฅ ๐˜ฃ๐˜บ ๐˜ต๐˜ฉ๐˜ฆ ๐˜ด๐˜บ๐˜ด๐˜ต๐˜ฆ๐˜ฎ ๐˜Š๐˜ฉ๐˜ฆ๐˜ค๐˜ฌ ๐˜ข๐˜ญ๐˜ญ ๐˜ต๐˜ฉ๐˜ฆ ๐˜ถ๐˜ด๐˜ฆ๐˜ณ ๐˜ฑ๐˜ฆ๐˜ณ๐˜ฎ๐˜ช๐˜ด๐˜ด๐˜ช๐˜ฐ๐˜ฏ๐˜ด.

๐™Ž๐™ค๐™ข๐™š๐™ฉ๐™๐™ž๐™ฃ๐™œ ๐™ฌ๐™š๐™ฃ๐™ฉ ๐™ฌ๐™ง๐™ค๐™ฃ๐™œ !

๐˜Š๐˜ฐ๐˜ฑ๐˜บ๐˜ช๐˜ฏ๐˜จ ๐˜ข๐˜ฃ๐˜ฐ๐˜ณ๐˜ต๐˜ฆ๐˜ฅ ๐˜ฃ๐˜บ ๐˜ต๐˜ฉ๐˜ฆ ๐˜ด๐˜บ๐˜ด๐˜ต๐˜ฆ๐˜ฎ
๐˜Š๐˜ฉ๐˜ฆ๐˜ค๐˜ฌ ๐˜ข๐˜ญ๐˜ญ ๐˜ต๐˜ฉ๐˜ฆ ๐˜ถ๐˜ด๐˜ฆ๐˜ณ ๐˜ฑ๐˜ฆ๐˜ณ๐˜ฎ๐˜ช๐˜ด๐˜ด๐˜ช๐˜ฐ๐˜ฏ๐˜ด.

Just a doubt

Heroku restarts every 24hours and sometimes randomly . In repo it said it will save a csv file so after restart we can start clone process again and it will ignore the files which are already cloned right.
My doubt is does that csv file gets saved even if we dont use database in heroku or does it saved somewhere else permanently without database ๐Ÿค”? As heroku database is not permanent

Bug i guess ?

So I have generated pyrogram V2 string session from your repl link but still got this error here
But when I use old string session it's working fine :(
And yes I am using latest code . Help please

features

can you make this bot public like users can set own channel because many bot on telegram so I'm telling this feature is amazing

Sir please add support to deploy to railway because the app doesn't restart every 24 hrs

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Option for custom delay !

Discussed in #86

Originally posted by HithaishiDesai August 17, 2022
Good Afternoon Sir, please add custom seconds option in delayed forwarding...

Thanks Sir ๐Ÿ™๐Ÿปโค๏ธ

Please consider these features

Hello! Thank you for developing this bot. Is very useful and has some nice features built-in. I have some suggestions for further improvements.

  1. Please add the possibility to forward text messages. In some channels, the files have gibberish names, no captions and the only way to know what is all about is from a text message that is put before them.

  2. Most files in TG have multiple underscores in names, is possible to remove them and replace them with a space when forwarding? Maybe with regex, useful for removal or replacement of other undesired things from names or captions.

  3. For videos and audios uploaded as files in the source channel, is possible to forward them as videos and audios (streamable) to the destination?

  4. The way the caption feature is working right now is causing some problems. If I let the caption setting on, the files captioned are forwarding as such but the ones uncaptioned remain uncaptioned. If I choose filename as the caption, all files are forwarded captioned but the ones already captioned lose their original caption and instead are captioned with the filename, which is bad in the case of gibberish names.

Is possible to combine the two options? Let the files captioned pass as such and only caption with the filename the files without captions.

  1. When a user chooses the source and target chats there is a message that informs about chat names and time window to complete. Please add an option to disable that message. After a time the user has learned how to use the bot.

  2. It would be useful that the bot remembers the source-target pairs so the users choose from a list. Also an option for friendly names in the case of private chats so the user could rapidly choose from a list of already used chats for source and target.

String error

app[worker.1]: return S_ISREG(self.stat().st_mode)
2021-09-20T09:05:35.931239+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.8/pathlib.py", line 1197, in stat
2021-09-20T09:05:35.931630+00:00 app[worker.1]: return self._accessor.stat(self)
2021-09-20T09:05:35.931759+00:00 app[worker.1]: OSError: [Errno 36] File name too long : (session)

unable to add target id, please add a bit more detailed example. Thank you in advance.

unable to add source id, please add a bit more detailed example. Thank you in advance.
Here is message, but not succeed yet.

๐™Ž๐™š๐™จ๐™จ๐™ž๐™ค๐™ฃ ๐™ช๐™จ๐™š๐™ง ๐™ž๐™จ ๐™ฃ๐™ค๐™ฉ ๐™ž๐™ฃ ๐™ฉ๐™๐™š ๐™ฉ๐™–๐™ง๐™œ๐™š๐™ฉ ๐™˜๐™๐™–๐™ฉ ๐™œ๐™ž๐™ซ๐™š๐™ฃ

Repo Update?

Hello, when will it be updated to a new version? It has been 1 year.

Bot not functioning

Bot starts after deploying but it is not responding on giving source or target chat info (it is not taking any information).
IMG_20220528_120644

And after that..
Screenshot_2022-05-28-12-05-22-243_org telegram plus

And there is continuous warning in logs.
IMG_20220528_113522

Please help me on this issue.

add minimum_length add_minimum size block certain extensions

hey can you add minimum length option and minimum size and block extension

minimum length - some videos have 2 to 5 minutes duration. i need only above 20 minutes video so this feature will be useful
size - some videos have 2 to 5 minutes duration but have 1GB file size i dont want to transfer them
no extension or block certain extensions - some videos have no extension i dont want those or some videos have .mkv and .mp4 extensions i want to have an option to block which i dont want

1 and 2 are much needed features and verry useful

Bug in Chat type identification

Discussed in #75

Originally posted by HithaishiDesai August 6, 2022
IMG_20220806_104520

Is it possible to make it just CHANNEL because whenever I try to tap on chat Id sometimes i click on that

THANKS ๐Ÿ™๐Ÿป

feature

please add a feature when bot restart on heroku automatic it copy file when it left not from start

Request

Maybe need add Clone Types

copy
forward

DONT USE THIS REPOSITORY

Nothing happening after Indexing start . Wasted alot of my time , but still no fix .

Please don't use this repository as IT WILL NOT WORK

Error in duplicate file indexing.

Discussed in https://github.com/m4mallu/clonebot-ui/discussions/10

Originally posted by Wileyfox-F1 August 1, 2021
Sorry for skipping the issues section to discuss this. Actually I want to report two bugs (may not be a bug). The first one is related to the latest version and the latter one is linked to the previous version. I tried to clone a (private) channel with 2Lakh+ media files. Actually I started the process from an intermediate id (about 19****), it started indexing for duplicate files and it frozen after a while. I guess it may be due to new messages in the source channel while cloning (not sure). The second bug is actually a query kinda thing to you, I found duplicate files while cloning an another channel (with almost zero probability of duplication). Did you use any kind of checksum stuff for indexing the duplicate files? Just concerned because those backup is pretty much important to me. Btw, it's a great project (similar ones are only paid services by third party devs) and thanks to you for your priceless efforts for this bot!

Error shown after recent update

2022-07-25T11:55:49.332878+00:00 app[api]: Scaled to worker@1:Free by user [email protected]
2022-07-25T11:55:53.013978+00:00 heroku[worker.1]: Starting process with command python3 main.py
2022-07-25T11:55:53.604937+00:00 heroku[worker.1]: State changed from starting to up
2022-07-25T11:55:55.309463+00:00 app[worker.1]: Traceback (most recent call last):
2022-07-25T11:55:55.309478+00:00 app[worker.1]: File "main.py", line 1, in
2022-07-25T11:55:55.309568+00:00 app[worker.1]: from bot import Bot
2022-07-25T11:55:55.309576+00:00 app[worker.1]: File "/app/bot.py", line 4, in
2022-07-25T11:55:55.309644+00:00 app[worker.1]: from user import User
2022-07-25T11:55:55.309652+00:00 app[worker.1]: File "/app/user.py", line 4, in
2022-07-25T11:55:55.309712+00:00 app[worker.1]: from pyrogram.enums import ParseMode
2022-07-25T11:55:55.309738+00:00 app[worker.1]: ModuleNotFoundError: No module named 'pyrogram.enums'
2022-07-25T11:55:55.505290+00:00 heroku[worker.1]: Process exited with status 1
2022-07-25T11:55:55.575429+00:00 heroku[worker.1]: State changed from up to crashed
2022-07-25T11:55:55.579355+00:00 heroku[worker.1]: State changed from crashed to starting
2022-07-25T11:55:58.677351+00:00 heroku[worker.1]: Starting process with command python3 main.py
2022-07-25T11:55:59.272310+00:00 heroku[worker.1]: State changed from starting to up
2022-07-25T11:56:01.209885+00:00 heroku[worker.1]: Process exited with status 1
2022-07-25T11:56:01.003330+00:00 app[worker.1]: Traceback (most recent call last):
2022-07-25T11:56:01.003346+00:00 app[worker.1]: File "main.py", line 1, in
2022-07-25T11:56:01.003416+00:00 app[worker.1]: from bot import Bot
2022-07-25T11:56:01.003425+00:00 app[worker.1]: File "/app/bot.py", line 4, in
2022-07-25T11:56:01.003484+00:00 app[worker.1]: from user import User
2022-07-25T11:56:01.003493+00:00 app[worker.1]: File "/app/user.py", line 4, in
2022-07-25T11:56:01.003552+00:00 app[worker.1]: from pyrogram.enums import ParseMode
2022-07-25T11:56:01.003571+00:00 app[worker.1]: ModuleNotFoundError: No module named 'pyrogram.enums'
2022-07-25T11:56:01.278457+00:00 heroku[worker.1]: State changed from up to crashed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.