azamaulanaaa / botkaca

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

Error on uploading files to telegram #44

Closed mr-wh1tehat closed 3 years ago

mr-wh1tehat commented 3 years ago

Bot is crashing while uploading downloaded files to telegram: Heroku log: 2021-08-10T05:25:51.318612+00:00 app[worker.1]: await upload_files(client, reply, abs_files(download_dir, download.files), os_path_join(download_dir, download.name + '.zip')) 2021-08-10T05:25:51.318612+00:00 app[worker.1]: File "/app/bot/handlers/leech_handler.py", line 89, in upload_files 2021-08-10T05:25:51.318613+00:00 app[worker.1]: await upload_to_tg_handler.func( 2021-08-10T05:25:51.318613+00:00 app[worker.1]: File "/app/bot/handlers/upload_to_tg_handler.py", line 107, in func 2021-08-10T05:25:51.318614+00:00 app[worker.1]: await upload_fn( 2021-08-10T05:25:51.318615+00:00 app[worker.1]: File "/app/venv/lib/python3.9/site-packages/pyrogram/client/methods/messages/send_document.py", line 141, in send_document 2021-08-10T05:25:51.318615+00:00 app[worker.1]: if os.path.exists(document): 2021-08-10T05:25:51.318615+00:00 app[worker.1]: File "/usr/lib/python3.9/genericpath.py", line 19, in exists 2021-08-10T05:25:51.318615+00:00 app[worker.1]: os.stat(path) 2021-08-10T05:25:51.318616+00:00 app[worker.1]: TypeError: stat: path should be string, bytes, os.PathLike or integer, not FileIO

mr-wh1tehat commented 3 years ago

Bot is crashing while uploading downloaded files to telegram: Heroku log: 2021-08-10T05:25:51.318612+00:00 app[worker.1]: await upload_files(client, reply, abs_files(download_dir, download.files), os_path_join(download_dir, download.name + '.zip')) 2021-08-10T05:25:51.318612+00:00 app[worker.1]: File "/app/bot/handlers/leech_handler.py", line 89, in upload_files 2021-08-10T05:25:51.318613+00:00 app[worker.1]: await upload_to_tg_handler.func( 2021-08-10T05:25:51.318613+00:00 app[worker.1]: File "/app/bot/handlers/upload_to_tg_handler.py", line 107, in func 2021-08-10T05:25:51.318614+00:00 app[worker.1]: await upload_fn( 2021-08-10T05:25:51.318615+00:00 app[worker.1]: File "/app/venv/lib/python3.9/site-packages/pyrogram/client/methods/messages/send_document.py", line 141, in send_document 2021-08-10T05:25:51.318615+00:00 app[worker.1]: if os.path.exists(document): 2021-08-10T05:25:51.318615+00:00 app[worker.1]: File "/usr/lib/python3.9/genericpath.py", line 19, in exists 2021-08-10T05:25:51.318615+00:00 app[worker.1]: os.stat(path) 2021-08-10T05:25:51.318616+00:00 app[worker.1]: TypeError: stat: path should be string, bytes, os.PathLike or integer, not FileIO

EDIT : This issue can be fixed by adding "appdirs" in "requirements.txt. So that I'm closing this issue, Thank you Azamaulana for this awesome code!