Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'media' object has no attribute 'file_name' #47

Closed
EverythingSuckz opened this issue Apr 7, 2022 · 1 comment · Fixed by #62
Closed

AttributeError: 'media' object has no attribute 'file_name' #47

EverythingSuckz opened this issue Apr 7, 2022 · 1 comment · Fixed by #62
Labels
bug Something isn't working

Comments

@EverythingSuckz
Copy link
Owner

EverythingSuckz commented Apr 7, 2022

(venv) root@instance-20210817-1303:/home/ubuntu/TG-FileStreamBot# python3 -m WebStreamer

-------------------- Initializing Telegram Bot --------------------
------------------------------ DONE ------------------------------

---------------------- Initializing Clients ----------------------
Starting - Client 1
This will take some time, please wait...
Multi-Client Mode Enabled
------------------------------ DONE ------------------------------
--------------------- Initalizing Web Server ---------------------
------------------------------ DONE ------------------------------

------------------------- Service Started -------------------------
                        bot =>> ***bot
                        server ip =>> 0.0.0.0
------------------------------------------------------------------

When I vist the web, code are shown as bellow:
{"server_status": "running", "uptime": "30s", "telegram_bot": "@ru***_bot", "connected_bots": 2, "loads": {"bot1": 0, "bot2": 0}, "version": 2.2}

Does it mean all the bots working?

When I sent some photos to the main bot, the script crashed, logs as bellow:

[07/04/2022 20:18:44][ERROR] => 'Photo' object has no attribute 'file_name' Traceback (most recent call last): File "/home/ubuntu/TG-FileStreamBot/venv/lib/python3.9/site-packages/pyrogram/dispatcher.py", line 222, in handler_worker await handler.callback(self.client, *args) File "/home/ubuntu/TG-FileStreamBot/WebStreamer/bot/plugins/stream.py", line 31, in media_receive_handler stream_link = f"{Var.URL}{log_msg.message_id}/{quote_plus(get_name(m))}?hash={get_hash(log_msg)}" File "/home/ubuntu/TG-FileStreamBot/WebStreamer/utils/file_properties.py", line 55, in get_name return media.file_name or "" AttributeError: 'Photo' object has no attribute 'file_name'

But when I send some videos, it works.

Originally posted by @lukemin in #46 (comment)

@EverythingSuckz EverythingSuckz added the bug Something isn't working label Apr 28, 2022
@wiz64
Copy link
Contributor

wiz64 commented Aug 1, 2022

##62 I have fixed it here, just merge it

EverythingSuckz added a commit that referenced this issue Aug 2, 2022
Fixed Bug #47 and Update `README.md` (typo fix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants