Skip to content

[Bug]: after update #81 the program freezes half way #87

Closed
@40OIL

Description

@40OIL

telegram_media_downloader version or commit

2.1.9 from 2023-06-18

What OS are you seeing the problem on?

Windows

Python Version

3.8.10

What happened?

A bug happened!

maybe today's update of WebView2 Runtime Edge influenced?
rolling back to 2.1.9 from 2023-05-16 did not help.
or is it that I run "pip3 install -r requirements.txt" after each download of py files?

2023-06-18 20:47:28.466 | INFO | utils.meta:print_meta:22 - Device: CPython 3.8.10 - Telegram Media Downloader 2.1.9
2023-06-18 20:47:28.467 | INFO | utils.meta:print_meta:23 - System: Windows 10 (EN)
2023-06-18 20:47:29.781 | SUCCESS | main:main:591 - Successfully started (Press Ctrl+C to stop)
2023-06-18 20:47:29.782 | INFO | main:download_chat_task:505 - Downloading files failed during last run...
2023-06-18 20:47:29.855 | ERROR | main:worker:489 - 'NoneType' object has no attribute 'id'
Traceback (most recent call last):

File "media_downloader.py", line 628, in
main()
└ <function main at 0x000002445F995AF0>

File "media_downloader.py", line 602, in main
_exec_loop()
└ <function _exec_loop at 0x000002445F995A60>

File "media_downloader.py", line 569, in _exec_loop
app.loop.run_until_complete(run_until_all_task_finish())
│ │ │ └ <function run_until_all_task_finish at 0x000002445F9959D0>
│ │ └ <function BaseEventLoop.run_until_complete at 0x000002445BDBAC10>
│ └
└ <module.app.Application object at 0x000002445F97B520>

File "C:\Users\user1\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 603, in run_until_complete
self.run_forever()
│ └ <function ProactorEventLoop.run_forever at 0x000002445BE8A430>

File "C:\Users\user1\AppData\Local\Programs\Python\Python38\lib\asyncio\windows_events.py", line 316, in run_forever
super().run_forever()

File "C:\Users\user1\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 570, in run_forever
self._run_once()
│ └ <function BaseEventLoop._run_once at 0x000002445BDBF700>

File "C:\Users\user1\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 1859, in _run_once
handle._run()
│ └ <function Handle._run at 0x000002445BD2B310>
└ <Handle <TaskWakeupMethWrapper object at 0x000002445FC3DD60>()>

File "C:\Users\user1\AppData\Local\Programs\Python\Python38\lib\asyncio\events.py", line 81, in _run
self._context.run(self._callback, *self._args)
│ │ │ │ │ └ <member '_args' of 'Handle' objects>
│ │ │ │ └ <Handle <TaskWakeupMethWrapper object at 0x000002445FC3DD60>()>
│ │ │ └ <member '_callback' of 'Handle' objects>
│ │ └ <Handle <TaskWakeupMethWrapper object at 0x000002445FC3DD60>()>
│ └ <member '_context' of 'Handle' objects>
└ <Handle <TaskWakeupMethWrapper object at 0x000002445FC3DD60>()>

File "media_downloader.py", line 487, in worker
await download_task(client, message, node)
│ │ │ └ <module.app.TaskNode object at 0x000002445FC197F0>
│ │ └ pyrogram.types.Message(id=16999, empty=True)
│ └ <pyrogram.client.Client object at 0x000002445F9B3A60>
└ <function download_task at 0x000002445F995550>

File "media_downloader.py", line 271, in download_task
download_status, file_name = await download_media(
└ <function download_media at 0x000002445F995670>

File "K:\Exec\tangyoha-tmd\module\pyrogram_extension.py", line 329, in inner
status, file_name = await func(
└ <function download_media at 0x000002445F9955E0>

File "media_downloader.py", line 357, in download_media
message = await fetch_message(client, message)
│ │ └ pyrogram.types.Message(id=16999, empty=True)
│ └ <pyrogram.client.Client object at 0x000002445F9B3A60>
└ <function fetch_message at 0x000002445E395820>

File "K:\Exec\tangyoha-tmd\module\pyrogram_extension.py", line 492, in fetch_message
chat_id=message.chat.id,
│ └ None
└ pyrogram.types.Message(id=16999, empty=True)

AttributeError: 'NoneType' object has no attribute 'id'
2023-06-18 20:47:31.481 | SUCCESS | main:_check_download_finish:77 - Successfully downloaded - K:\Exec\tangyoha-tmd\document\83932 - Золушка для инквизитора.fb2
2023-06-18 20:47:31.485 | SUCCESS | main:_check_download_finish:77 - Successfully downloaded - K:\Exec\tangyoha-tmd\document\83933 - 03_Олигарх_из_будущего_Книга_3_Миллионы_рождают_власть.fb2

here the program hangs and waits until you interrupt it manually <<<<<<<<<<

2023-06-18 20:47:50.291 | INFO | main:main:604 - KeyboardInterrupt
2023-06-18 20:47:50.381 | INFO | main:main:612 - Stopped!
2023-06-18 20:47:50.768 | INFO | main:main:614 - update config......
2023-06-18 20:47:50.772 | SUCCESS | main:main:618 - Updated last read message_id to config file,total download 2, total upload file 0

Expected Behavior

how to return the normal operation of the program?

Current Behavior

download stops, it is not clear how many messages have been processed and how many are left

Possible Solution

No response

Steps to Reproduce

No response

Relevant log output

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions