apenasrr / clonechat Goto Github PK
View Code? Open in Web Editor NEWClone all posts from the history of a Telegram Channel/Group to another Channel/Group.
License: MIT License
Clone all posts from the history of a Telegram Channel/Group to another Channel/Group.
License: MIT License
ao tentar clonar o conteudo de varios grupos ocorre essa mensagem
trying again... Due to: Telegram says: [400 MEDIA_CAPTION_TOO_LONG] - The media caption is too long (caused by "messages.SendMedia")
grupo: Courses - Online
Todos os dias executo a sincronização de varios grupos e hoje me deparei com o seguinte retorno:
chunk = await asyncio.wait_for(
File "/usr/lib/python3.10/asyncio/tasks.py", line 426, in wait_for
fut = ensure_future(fut, loop=loop)
File "/usr/lib/python3.10/asyncio/tasks.py", line 615, in ensure_future
return _ensure_future(coro_or_future, loop=loop)
File "/usr/lib/python3.10/asyncio/tasks.py", line 636, in _ensure_future
return loop.create_task(coro_or_future)
File "/usr/lib/python3.10/asyncio/base_events.py", line 438, in create_task
task = tasks.Task(coro, loop=self, name=name)
File "/usr/lib/python3.10/asyncio/base_events.py", line 754, in call_soon
handle = self._call_soon(callback, args, context)
File "/usr/lib/python3.10/asyncio/base_events.py", line 770, in _call_soon
handle = events.Handle(callback, args, self, context)
File "/usr/lib/python3.10/asyncio/events.py", line 40, in init
if self._loop.get_debug():
RecursionError: maximum recursion depth exceeded
Task exception was never retrieved
future: <Task finished name='Task-26219' coro=<Session.ping_worker() done, defined at /usr/local/lib/python3.10/dist-packages/pyrogram/session/session.py:271> exception=RecursionError('maximum recursion depth exceeded while calling a Python object')>
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/pyrogram/session/session.py", line 283, in ping_worker
await self.send(
File "/usr/local/lib/python3.10/dist-packages/pyrogram/session/session.py", line 318, in send
message = self.msg_factory(data)
File "/usr/local/lib/python3.10/dist-packages/pyrogram/session/internals/msg_factory.py", line 37, in call
len(body)
File "/usr/local/lib/python3.10/dist-packages/pyrogram/raw/core/tl_object.py", line 79, in len
return len(self.write())
File "/usr/local/lib/python3.10/dist-packages/pyrogram/raw/functions/ping_delay_disconnect.py", line 72, in write
b.write(Int(self.ID, False))
File "/usr/local/lib/python3.10/dist-packages/pyrogram/raw/core/primitives/int.py", line 33, in new
return value.to_bytes(cls.SIZE, "little", signed=signed)
RecursionError: maximum recursion depth exceeded while calling a Python object
Task was destroyed but it is pending!
task: <Task pending name='Task-36516' coro=<StreamReader.read() done, defined at /usr/lib/python3.10/asyncio/streams.py:628>>
Task was destroyed but it is pending!
task: <Task pending name='Task-35556' coro=<Event.wait() running at /usr/lib/python3.10/asyncio/locks.py:214> wait_for=>
MODE='user'
Hello . How can I edit the message before it is forwarded? I want to read it and forward it if there are conditions. Im familiar with Python, I just need you to tell me the file name and line number that variable store messages
Where is the config.py
Telegram groups can host huge communities with hundreds of thousands of users. To maintain readability in these chats, groups with more than 200 members can now activate topics and create separate spaces for any topic.
Topics function as individual chats within the group, with their own shared media and notification settings.
Example of topic id in a group: t.me/c/XXXXXXXXXX/YYY/messages
How can download only messages of topic YYY ?
useraccount = pyrogram.Client(
TypeError: init() got an unexpected keyword argument 'name'
{
"": "Message",
"id": 2,
"sender_chat": {
"": "Chat",
"id": -1002124032997,
"type": "ChatType.CHANNEL",
"is_verified": false,
"is_restricted": false,
"is_creator": false,
"is_scam": false,
"is_fake": false,
"title": "iQuímica 2023",
"photo": {
"": "ChatPhoto",
"small_file_id": "AQADAQADW60xG8s0EEUAEAIAAxvEwKwW____a6ktj2jpvcYABB4E",
"small_photo_unique_id": "AgADW60xG8s0EEU",
"big_file_id": "AQADAQADW60xG8s0EEUAEAMAAxvEwKwW____a6ktj2jpvcYABB4E",
"big_photo_unique_id": "AgADW60xG8s0EEU"
},
"dc_id": 1,
"has_protected_content": false
},
"date": "2024-01-12 21:38:19",
"chat": {
"": "Chat",
"id": -1002124032997,
"type": "ChatType.CHANNEL",
"is_verified": false,
"is_restricted": false,
"is_creator": false,
"is_scam": false,
"is_fake": false,
"title": "iQuímica 2023",
"photo": {
"_": "ChatPhoto",
"small_file_id": "AQADAQADW60xG8s0EEUAEAIAAxvEwKwW____a6ktj2jpvcYABB4E",
"small_photo_unique_id": "AgADW60xG8s0EEU",
"big_file_id": "AQADAQADW60xG8s0EEUAEAMAAxvEwKwW____a6ktj2jpvcYABB4E",
"big_photo_unique_id": "AgADW60xG8s0EEU"
},
"dc_id": 1,
"has_protected_content": false
},
"mentioned": false,
"scheduled": false,
"from_scheduled": false,
"has_protected_content": false,
"views": 3582,
"forwards": 16,
"outgoing": false
}
Traceback (most recent call last):
File "C:\Users\huney\OneDrive\Área de Trabalho\clonechat-main\clonechat.py", line 674, in
main()
File "C:\Users\huney\OneDrive\Área de Trabalho\clonechat-main\clonechat.py", line 560, in main
func_sender = get_sender(message)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\huney\OneDrive\Área de Trabalho\clonechat-main\clonechat.py", line 277, in get_sender
raise Exception
Exception
Is it possible to clone messages in bot ?
Pasted the script error Im getting when running the coded?
Enter the number(s) of the file type to clone, separating by comma.
For example, to copy photos and documents type: 1,3
Your answer: 0
New cloning or continuation?
1 = new
2 = resume
Your answer: 1
2/9275 (blank id)
3/9275 (blank id)
Not recognized message type:
{
"": "Message",
"id": 4,
"from_user": {
"": "User",
"id": 1104838547,
"is_self": true,
"is_contact": true,
"is_mutual_contact": false,
"is_deleted": false,
"is_bot": false,
"is_verified": false,
"is_restricted": false,
"is_scam": false,
"is_fake": false,
"is_support": false,
"is_premium": false,
"first_name": "A",
"status": "UserStatus.OFFLINE",
"last_online_date": "2024-02-10 13:32:49",
"username": "TheSearchEngine",
"phone_number": "*********"
},
"date": "2024-01-04 19:21:05",
"chat": {
"": "Chat",
"id": -1002072353912,
"type": "ChatType.SUPERGROUP",
"is_verified": false,
"is_restricted": false,
"is_creator": true,
"is_scam": false,
"is_fake": false,
"title": "TheXxXEngine",
"username": "TheXxXEngine",
"photo": {
"": "ChatPhoto",
"small_file_id": "AQADBAADJMAxG-AWuVAAEAIAA4hT1a8W____iRRiN4_CXaIABB4E",
"small_photo_unique_id": "AgADJMAxG-AWuVA",
"big_file_id": "AQADBAADJMAxG-AWuVAAEAMAA4hT1a8W____iRRiN4_CXaIABB4E",
"big_photo_unique_id": "AgADJMAxG-AWuVA"
},
"dc_id": 4,
"has_protected_content": false,
"permissions": {
"_": "ChatPermissions",
"can_send_messages": true,
"can_send_media_messages": true,
"can_send_other_messages": true,
"can_send_polls": false,
"can_add_web_page_previews": true,
"can_change_info": false,
"can_invite_users": true,
"can_pin_messages": false
}
}
}
Traceback (most recent call last):
File "C:\Users\andy-\Desktop\clonechat-main\clonechat.py", line 674, in
main()
File "C:\Users\andy-\Desktop\clonechat-main\clonechat.py", line 560, in main
func_sender = get_sender(message)
File "C:\Users\andy-\Desktop\clonechat-main\clonechat.py", line 277, in get_sender
raise Exception
Exception
Hello, I want to run the program every time so that when it arrives a message to the source group it clones it to the destination group, is there any option to do this?
Hope to add agent mode
Necessita de melhorias no código e um adicional seria a criação de uma design interface. Estou disposto a criar.
hello somebody know how to bypass this error while cloning or downloading, bot cant run with this Restriction:
"dc_id": 1,
"has_protected_content": true,
"restrictions": [
{
"_": "Restriction",
"platform": "ios",
"reason": "porn",
"text": "This channel can\u2019t be displayed because it was used to spread pornographic content."
}
I'm trying to download a protected channel I'm subscribed.
It's not working:
The chat history was saved. 223 posts.
Traceback (most recent call last):
File "C:\clonechat-main\downloadall_run.py", line 8, in <module>
main()
File "C:\clonechat-main\downloadall_run.py", line 5, in main
asyncio.run(downloadall.main())
File "C:\Python312\Lib\asyncio\runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\clonechat-main\protect_content\downloadall.py", line 52, in main
cloneplan.save_cloneplan(history_path, cloneplan_path)
File "C:\clonechat-main\protect_content\cloneplan\cloneplan.py", line 106, in save_cloneplan
cloneplan_list_dict = create_cloneplan(history_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\clonechat-main\protect_content\cloneplan\cloneplan.py", line 91, in create_cloneplan
cloneplan_dict = enrich_fields(cloneplan_dict, msg, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\clonechat-main\protect_content\cloneplan\cloneplan.py", line 47, in enrich_fields
cloneplan_dict["file_name"] = msg["video"]["file_name"]
~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'file_name'
What do I have to do?
Funcionar.. Funciona, mas nao tem como fazer com que ele sempre copie as mensagens e envie para o meu canal?
Porque so da para fazer 1 de vez..
Traceback (most recent call last):
File "clonechat.py", line 647, in
main()
File "clonechat.py", line 530, in main
update_cache(CACHE_FILE, list_posted)
File "clonechat.py", line 395, in update_cache
with open(CACHE_FILE, mode="w") as file:
UnicodeEncodeError: 'latin-1' codec can't encode characters in position 11-12: ordinal not in range(256)
This happen:
C:\Users\Samsung\Downloads\clonechat-main (1)\clonechat-main>python clonechat_protect_run.py
Could not find platform independent libraries
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = (not set)
program name = 'python'
isolated = 0
environment = 1
user site = 1
safe_path = 0
import site = 1
is in build tree = 0
stdlib dir = 'C:\Users\Samsung\Downloads\clonechat-main (1)\clonechat-main\Lib'
sys._base_executable = 'C:\Users\Samsung\AppData\Local\Programs\Python\Python312\python.exe'
sys.base_prefix = 'C:\Users\Samsung\Downloads\clonechat-main (1)\clonechat-main'
sys.base_exec_prefix = 'C:\Users\Samsung\Downloads\clonechat-main (1)\clonechat-main'
sys.platlibdir = 'DLLs'
sys.executable = 'C:\Users\Samsung\AppData\Local\Programs\Python\Python312\python.exe'
sys.prefix = 'C:\Users\Samsung\Downloads\clonechat-main (1)\clonechat-main'
sys.exec_prefix = 'C:\Users\Samsung\Downloads\clonechat-main (1)\clonechat-main'
sys.path = [
'C:\Users\Samsung\AppData\Local\Programs\Python\Python312\python312.zip',
'C:\Users\Samsung\Downloads\clonechat-main (1)\clonechat-main',
'C:\Users\Samsung\Downloads\clonechat-main (1)\clonechat-main\Lib',
'C:\Users\Samsung\AppData\Local\Programs\Python\Python312',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x0000467c (most recent call first):
C:\Users\Samsung\Downloads\clonechat-main (1)\clonechat-main>cmd /k
C:\Users\Samsung\Downloads\clonechat-main (1)\clonechat-main>
Can anyone help me with this error, I already searched the internet but I didn't find anything to solve it.
Enter the number(s) of the file type to clone, separating by comma.
For example, to copy photos and documents type: 1,3
Your answer: 0
New cloning or continuation?
1 = new
2 = resume
Your answer: 1
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Peer id invalid: -1002166654067
trying again... Due to: Telegram says: [400 CHAT_ADMIN_REQUIRED] - The method requires chat admin privileges (caused by "messages.SendMessage")
Sorry for the inconvenience, i don't know if here is the right place for that.
But is it possible to implement a Clone queue, set chats in a row to Clone.
Congratulations for your development.
Can we move the wait_a_moment
function before func_sender(message, destination_chat)
? If so It'll improve clone speed with my menu to select filetypes.
Something like that:
if func_sender in files_type_excluded:
list_posted += [message.id]
update_cache(CACHE_FILE, list_posted)
continue
wait_a_moment(message_id)
func_sender(message, destination_chat)
I'm asking that because I'm wondering if Telegram will give FloodWait if I make a lot of get_message
requests in a short period.
Example: python clonechat.py --orig=-100222222,-100222654,-100265465 --dest=-10011111111
I am a premium user on telegram and I would like to know if I can increase the download speed in the code?
Ao tentar usar o clonechat protect exibe o seguinte erro:
```
if not found:
UnboundLocalError: local variable 'found' referenced before assignment
Hello, friend! Your script is fantastic.
Can you solve a little problem that happened? The script does not recognize certain characters and ends up interrupting the process. A lot of channels I want to copy have emojis and the like in the name. Is there anything that can be done? Some way to replace those characters with any letter, I don't know.
Like this:
Yesterday I started a cloning but today when I try to resume it, it does not want to continue. The program receives the command but does not process it
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.