azamaulanaaa / botkaca

Bot that leech (re-upload) internet contents including torrent to telegram
GNU General Public License v3.0
133 stars 610 forks source link

unable to detect video duration #1

Closed Nirmalraj10567 closed 4 years ago

Nirmalraj10567 commented 4 years ago

I upload some torrent file it cannot respond IMG_20200926_143347_477

Nirmalraj10567 commented 4 years ago

When files completed 100 percentage it not send to telegram

azamaulanaaa commented 4 years ago

can you send me the logs? which service that you used? heroku? google cloud? or what?

Nirmalraj10567 commented 4 years ago

Heroku I used logs 2020-09-27T03:26:39.324526+00:00 app[worker.1]: 27-Sep-20 03:26:39 - root - INFO - NetWorkerTask started 2020-09-27T03:26:39.581187+00:00 app[worker.1]: 27-Sep-20 03:26:39 - root - INFO - Started 4 UpdatesWorkerTasks 2020-09-27T03:26:39.581586+00:00 app[worker.1]: 27-Sep-20 03:26:39 - root - INFO - Started 4 DownloadWorkerTasks 2020-09-27T03:26:39.590320+00:00 app[worker.1]: 27-Sep-20 03:26:39 - root - INFO - Started 343 UpdateWorkerTasks 2020-09-27T04:27:02.400975+00:00 app[worker.1]: 27-Sep-20 04:27:02 - bot.plugins.aria2 - INFO - ['aria2c', '--enable-rpc', '--dir=/app/downloads', '--daemon=true', '--max-connection-per-server=10', '--rpc-listen-all=false', '--rpc-listen-port=6800', '--seed-ratio=0', '--seed-time=0'] 2020-09-27T04:27:02.413854+00:00 app[worker.1]: 27-Sep-20 04:27:02 - bot.plugins.aria2 - INFO - b'' 2020-09-27T08:24:19.152965+00:00 app[worker.1]: 27-Sep-20 08:24:19 - root - INFO - NetWorkerTask started 2020-09-27T09:01:51.408937+00:00 app[worker.1]: 27-Sep-20 09:01:51 - pyrogram.client.ext.dispatcher - ERROR - 'duration' 2020-09-27T09:01:51.408946+00:00 app[worker.1]: Traceback (most recent call last): 2020-09-27T09:01:51.408948+00:00 app[worker.1]: File "/usr/local/lib/python3.8/site-packages/pyrogram/client/ext/dispatcher.py", line 204, in update_worker 2020-09-27T09:01:51.408948+00:00 app[worker.1]: await handler.callback(self.client, *args) 2020-09-27T09:01:51.408949+00:00 app[worker.1]: File "/app/bot/main.py", line 96, in default_message_handler 2020-09-27T09:01:51.408949+00:00 app[worker.1]: return await leech_handler.func(client, message) 2020-09-27T09:01:51.408950+00:00 app[worker.1]: File "/app/bot/handlers/leech_handler.py", line 79, in func 2020-09-27T09:01:51.408950+00:00 app[worker.1]: upload_status = await upload_to_tg_handler.func( 2020-09-27T09:01:51.408951+00:00 app[worker.1]: File "/app/bot/handlers/upload_to_tg_handler.py", line 99, in func 2020-09-27T09:01:51.408952+00:00 app[worker.1]: await upload_fn( 2020-09-27T09:01:51.408952+00:00 app[worker.1]: File "/app/bot/handlers/upload_to_tg_handler.py", line 54, in upload_fn 2020-09-27T09:01:51.408953+00:00 app[worker.1]: duration = int(float(video_stream["duration"])) or 0 2020-09-27T09:01:51.408953+00:00 app[worker.1]: KeyError: 'duration'

azamaulanaaa commented 4 years ago

if you still face the bug, please kindly share the magnet link, I might need to replicate the bug exactly same

Nirmalraj10567 commented 4 years ago

/leech magnet:?xt=urn:btih:64460341027673E0FF0AD9CEAC0174E6E4357AB3&dn=www.TamilRockers.ws%20-%20Drona%20%282020%29%5bKannada%20720p%20HDRip%20-%20DD5.1%20-%20x264%20-%201.4GB%20-%20ESubs%5d.mkv&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a1337%2fannounce&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce

azamaulanaaa commented 4 years ago

/leech magnet:?xt=urn:btih:64460341027673E0FF0AD9CEAC0174E6E4357AB3&dn=www.TamilRockers.ws%20-%20Drona%20%282020%29%5bKannada%20720p%20HDRip%20-%20DD5.1%20-%20x264%20-%201.4GB%20-%20ESubs%5d.mkv&tr=udp%3a%2f%2ftracker.openbittorrent.com%3a1337%2fannounce&tr=udp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce

with those magnet, looks like the problems comes from the torrent itself since me unable to download the metadata. image

Nirmalraj10567 commented 4 years ago

Some torrent files and some files uploaded to website and send not back to telegram

azamaulanaaa commented 4 years ago

there are many possible reasons so that the files not upload properly to telegram. Me as the original developer understand that very vividly. To solve the problem you face, I need to know the service, the log, and torrent uri (could be magnet) that you used so that I can replicate the bug and then work for it.

Heroku I used logs 2020-09-27T03:26:39.324526+00:00 app[worker.1]: 27-Sep-20 03:26:39 - root - INFO - NetWorkerTask started 2020-09-27T03:26:39.581187+00:00 app[worker.1]: 27-Sep-20 03:26:39 - root - INFO - Started 4 UpdatesWorkerTasks 2020-09-27T03:26:39.581586+00:00 app[worker.1]: 27-Sep-20 03:26:39 - root - INFO - Started 4 DownloadWorkerTasks 2020-09-27T03:26:39.590320+00:00 app[worker.1]: 27-Sep-20 03:26:39 - root - INFO - Started 343 UpdateWorkerTasks 2020-09-27T04:27:02.400975+00:00 app[worker.1]: 27-Sep-20 04:27:02 - bot.plugins.aria2 - INFO - ['aria2c', '--enable-rpc', '--dir=/app/downloads', '--daemon=true', '--max-connection-per-server=10', '--rpc-listen-all=false', '--rpc-listen-port=6800', '--seed-ratio=0', '--seed-time=0'] 2020-09-27T04:27:02.413854+00:00 app[worker.1]: 27-Sep-20 04:27:02 - bot.plugins.aria2 - INFO - b'' 2020-09-27T08:24:19.152965+00:00 app[worker.1]: 27-Sep-20 08:24:19 - root - INFO - NetWorkerTask started 2020-09-27T09:01:51.408937+00:00 app[worker.1]: 27-Sep-20 09:01:51 - pyrogram.client.ext.dispatcher - ERROR - 'duration' 2020-09-27T09:01:51.408946+00:00 app[worker.1]: Traceback (most recent call last): 2020-09-27T09:01:51.408948+00:00 app[worker.1]: File "/usr/local/lib/python3.8/site-packages/pyrogram/client/ext/dispatcher.py", line 204, in update_worker 2020-09-27T09:01:51.408948+00:00 app[worker.1]: await handler.callback(self.client, *args) 2020-09-27T09:01:51.408949+00:00 app[worker.1]: File "/app/bot/main.py", line 96, in default_message_handler 2020-09-27T09:01:51.408949+00:00 app[worker.1]: return await leech_handler.func(client, message) 2020-09-27T09:01:51.408950+00:00 app[worker.1]: File "/app/bot/handlers/leech_handler.py", line 79, in func 2020-09-27T09:01:51.408950+00:00 app[worker.1]: upload_status = await upload_to_tg_handler.func( 2020-09-27T09:01:51.408951+00:00 app[worker.1]: File "/app/bot/handlers/upload_to_tg_handler.py", line 99, in func 2020-09-27T09:01:51.408952+00:00 app[worker.1]: await upload_fn( 2020-09-27T09:01:51.408952+00:00 app[worker.1]: File "/app/bot/handlers/upload_to_tg_handler.py", line 54, in upload_fn 2020-09-27T09:01:51.408953+00:00 app[worker.1]: duration = int(float(video_stream["duration"])) or 0 2020-09-27T09:01:51.408953+00:00 app[worker.1]: KeyError: 'duration'

on this part, refer from the log that you gave me, the problem is due to ffprobe unable to detect video duration from video that ffmpeg produced. This is very uncommon and might be third party issue, in this case ffmpeg or ffprobe. On my test, it works just fine. that why I closed this issue on the first place. If you face similar issue, you can post it here. if you face different issue, please create new issue on github. Thanks.