apenasrr / clonechat

Clone all posts from the history of a Telegram Channel/Group to another Channel/Group.
MIT License
335 stars 85 forks source link

KeyError: 'file_name' #47

Closed byvictorale closed 1 month ago

byvictorale commented 1 month ago

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?

byvictorale commented 1 month ago

Solution: https://github.com/apenasrr/clonechat/pull/24/commits/5445201131644202234ae449c7a31c57c16409b5