Jump to content

Recommended Posts

Posted (edited)

Hi and thanks for the effort. Installed without problems.

Unfortunately, I get no images when media is added to Emby on my test run. Just plain text.

image.png.a4115a09ae12bdb0a0c5fa41f14c4494.png

Installing requirements 
Collecting requests
  Downloading requests-2.31.0-py3-none-any.whl (62 kB)
Collecting urllib3<3,>=1.21.1
  Downloading urllib3-2.2.1-py3-none-any.whl (121 kB)
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2024.2.2-py3-none-any.whl (163 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.7-py3-none-any.whl (66 kB)
Installing collected packages: urllib3, charset-normalizer, certifi, idna, requests
Successfully installed certifi-2024.2.2 charset-normalizer-3.3.2 idna-3.7 requests-2.31.0 urllib3-2.2.1
starting flask app.
 * Serving Flask app '/App/app.py'
 * Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:5000
 * Running on http://172.19.0.2:5000
Press CTRL+C to quit
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: xxx-xxx-xxx
192.168.2.50 - - [29/Apr/2024 20:50:06] "POST /webhook HTTP/1.1" 200 -
192.168.2.50 - - [29/Apr/2024 20:52:21] "POST /webhook HTTP/1.1" 200 -
192.168.2.50 - - [29/Apr/2024 20:52:45] "POST /webhook HTTP/1.1" 200 -
192.168.2.50 - - [29/Apr/2024 21:02:54] "POST /webhook HTTP/1.1" 200 -
192.168.2.50 - - [29/Apr/2024 21:05:06] "POST /webhook HTTP/1.1" 200 -
192.168.2.50 - - [29/Apr/2024 21:05:11] "POST /webhook HTTP/1.1" 200 -
192.168.2.50 - - [29/Apr/2024 21:07:53] "POST /webhook HTTP/1.1" 200 -

 

 

Edited by shorty1483
Posted

Working now as expected thanks to the updated code and great help of @Yoas1

  • Like 1
  • 9 months later...
richenginner
Posted

how to run in emby windows server?

Posted
14 minutes ago, richenginner said:

how to run in emby windows server?

The github link in the first post seems to have some detailed instructions.

richenginner
Posted
1 minute ago, Luke said:

The github link in the first post seems to have some detailed instructions.

only for docker :(

Posted
5 minutes ago, richenginner said:

only for docker :(

 

richenginner
Posted
1 hour ago, Luke said:

 

i tried, but not save and reset to empty values 😕

Posted
12 minutes ago, richenginner said:

i tried, but not save and reset to empty values 😕

Best thing to do is report your issue in the topic for the plugin. Thanks.

richenginner
Posted

thank you very much!

  • Thanks 1
sh0rty
Posted
On 2/3/2025 at 6:35 AM, richenginner said:

thank you very much!

You could spin up Docker Desktop on Windows to use this notifier container. Works flawlessly for me since months now.

  • Thanks 1
  • 2 weeks later...
Posted

Hi,

I built a container to run this notifier (without cloning and running another container).

I also changed the way the application works:

   1 - config file to get telegram bot token,

   2 - added admin users to receive all notifications from the server

   3 - added users to receive only new/deleted notification items from the server.

 

https://github.com/Yoas1/emby-telegram-notifier-

(if you like it give it a star in GitHub and docker hub 😀)

  • Like 1
Posted (edited)

@richenginner

If you don't want to use Docker, you can clone the repo and run the script with Python.

Edited by Yoas1
sh0rty
Posted (edited)
On 2/16/2025 at 8:10 PM, Yoas1 said:

Hi,

I built a container to run this notifier (without cloning and running another container).

I also changed the way the application works:

   1 - config file to get telegram bot token,

   2 - added admin users to receive all notifications from the server

   3 - added users to receive only new/deleted notification items from the server.

 

https://github.com/Yoas1/emby-telegram-notifier-

(if you like it give it a star in GitHub and docker hub 😀)

When I spin up the new image with yaml, I got an error at beginning.

172.31.0.1 - - [18/Feb/2025 22:15:55] "POST /webhook HTTP/1.1" 500 -
[2025-02-18 22:12:42,860] ERROR in app: Exception on /webhook [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/app/app.py", line 167, in webhook
    admin_id = get_admins()
  File "/app/app.py", line 37, in get_admins
    admins = info_data["admins"]
KeyError: 'admins'

This seems to be an error in your example yaml. It needs to be admins and not admin in line 5 it seems.

Edited by sh0rty
Posted

Yes i missed a letter there...

Thanks I'll fix it 😃

Posted

token:
  - <telegram-bot-token>
emby-server:
  - http://<emby-server-url>:<port>
admin:
  - <chatid>
users:
  - <chatid>
  - <chatid>

 

 

If you create a new bot you must send him /start in your telegram.

  • Like 1
sh0rty
Posted
12 minutes ago, Yoas1 said:

token:
  - <telegram-bot-token>
emby-server:
  - http://<emby-server-url>:<port>
admin:
  - <chatid>
users:
  - <chatid>
  - <chatid>

 

 

If you create a new bot you must send him /start in your telegram.

Yea just recognized that too 🤣 I thought you meant Emby user ID.

Posted

I change it to <telegram-chatid> 🤣😂

does it work well?? 

Let me know if you run into the problem 😃

sh0rty
Posted
6 minutes ago, Yoas1 said:

I change it to <telegram-chatid> 🤣😂

does it work well?? 

Let me know if you run into the problem 😃

Test message worked well + a small test run. Will check the next days. Keep up the great work!

sh0rty
Posted (edited)

One question though. I just need an admin and no user. When I specify the config.yaml like that, Telegram messages are sent to the recipient, but Emby throws an internal server error when sending test message + I get an error in container log.

token:
  - 7025719356:AAHRCnMngxRIpk5zixuixjjjc-2Pe21pjCg
emby-server:
  - http://192.168.2.51:80
admins:
  - chatid
users:
[2025-02-19 07:50:02,875] ERROR in app: Exception on /webhook [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.8/dist-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
  File "/app/app.py", line 191, in webhook
    for i in range(len(user_id)):
TypeError: object of type 'NoneType' has no len()
172.31.0.1 - - [19/Feb/2025 07:50:02] "POST /webhook HTTP/1.1" 500 -

When I delete the users section completely from the yaml, I get another internal server error because the script cannot find users section in yaml.

 

Is it correct htat I do need to specify the same chat as Admin and User in yaml? This is the only variant thats working without errors.

Edited by sh0rty
sh0rty
Posted
3 hours ago, sh0rty said:

Thee users section completely from the yaml, I get another internal server error because the script cannot find users section in yaml.

Is it correct htat I do need to specify the same chat as Admin and User in yaml? This is the only variant thats working without errors.

With the working combo, I get the telegram messages twice.

Posted

Yes I see the problem, I will try to fix it tonight 🙏🙏

  • Thanks 1
sh0rty
Posted
6 hours ago, Yoas1 said:

Yes I see the problem, I will try to fix it tonight 🙏🙏

Nevertheless, best Emby Telegram plugin around! 💫

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...