TypechoJoeTheme

阿尔法色色之屋

【vate】把 Jellyfin 更新消息推送到QQ

本文最后更新于2025年05月12日。如果文章内容或图片资源失效,请留言反馈,我会及时处理,谢谢!
为了有更好的阅读体验,阿尔法色色之屋为长篇文章提供了目录树,若没有正常显示,则需要手动缩小页面比例。

思路

让 Jellyfin 使用 LLOneBot onebot-11 协议的API接口,把更新推送到QQ。

在部署好支持OneBot协议的的QQ机器人后,就已经具备收发QQ消息的能力了。

一. 调用 onebot-11 API

先把 LLOneBot 部署好,Linux 无 GUI 可以用 NapCatQQ项目。

设置API端口

打开HTTP服务,并设置端口

LLOneBot 设置方法:

NapCatQQ 设置方法:

{
  "httpHost": "",
  "enableHttp": false,
  "httpPort": 3000,
............略....................
}

测试API

浏览器访问下面的连接,就可以测试消息是否能正常发送:

  1. 需要保证端口,和上一步设置的端口一致
  2. send_group_msg , send_group_msg 顾名思义分别对应私聊消息和群聊消息
#群聊消息
http://127.0.0.1:3000/send_group_msg?group_id=群号&message="hello"&auto_escape=false
#私聊消息:
http://127.0.0.1:3000/send_private_msg?user_id=QQ号&message="hello"&auto_escape=false

有条件的,可以构造POST请求进行测试:

#私聊消息:
curl -X POST "http://127.0.0.1:3000/send_private_msg" \
     -H "Content-Type: application/json" \
     -d '{
           "user_id": QQ号,
           "message": "hello post json"
         }'


#群聊消息
curl -X POST "http://127.0.0.1:3000/send_group_msg" \
     -H "Content-Type: application/json" \
     -d '{
           "group_id": 群号,
           "message": "hello post json"
         }'

二. 设置 Jellyfin webhook 插件

先安装好Webhook插件,并点击进行设置

在Server Url里输入jellyfin服务的访问地址,

然后点击 Add Generic Destination

名字自己随便取,Url 需要注意一下,私聊消息接口用: send_private_msg 群聊用: send_group_msg

Item Type 默认是全选,可以根据自己需要进行勾选

在最下方 Template空白处填入指定代码,最后在点save就大功告成了

注:私聊消息用到是user_id,并填写qq号。群聊要改成group_id

 {{#if_equals NotificationType 'ItemAdded'}} 
{
   "user_id": qq号,
   "message": "{{{SeriesName}}} 更新拉!\n[CQ:image,file={{ServerUrl}}/Items/{{SeasonId}}/Images/Primary]\n{{#if_equals ItemType 'Episode'}}S{{SeasonNumber00}}E{{EpisodeNumber00}} {{{Name}}}\n{{else}}名称:{{{Name}}} ({{Year}})\n{{/if_equals}}时长:{{RunTime}}"
}
 {{/if_equals}}

三. 结果演示:

小提示:jellyfin 的推送不是实时的,最好在定时任务里把 “扫描媒体库”开了。
赞(0)
评论 (12)
  1. eriri88888 闲逛
    Windows 10 · FireFox

    请教一下,如果是emby的话要怎么设置呢?emby的插件没有填写代码的地方

    2024-08-15 回复
    1. vatebur 闲逛
      Windows 10 · Google Chrome
      @eriri88888

      emby的话用webhook的get请求就行了,在文章的测试API部分有讲。不用代码,直接用URL就行了

      #############
      #群聊消息
      http://127.0.0.1:3000/send_group_msg?group_id=群号&message="hello"&auto_escape=false
      #私聊消息:
      http://127.0.0.1:3000/send_private_msg?user_id=QQ号&message="hello"&auto_escape=false
      #############

      http://blog.csdn.net/qq_38894585/article/details/138336721
      https://github.com/botuniverse/onebot-11/blob/master/api/public.md

      2025-02-07 回复
  2. Peaynan 闲逛
    iPhone · Safari

    请问如果我要自定义文本信息,我在哪里可以找到 jellyfin 提供的变量以及图片路径呢

    2024-10-24 回复
    1. vatebur 闲逛
      Windows 10 · Google Chrome
      @Peaynan

      在jellyfin的网页端,查看网页代码,就能知道图片的URL了,
      Jellyfin变量要到官网/github仓库,翻示例

      ULR拼出来以后就是下面这样子,中间会夹个{{SeasonId}}:
      {{ServerUrl}}/Items/{{SeasonId}}/Images/Primary]

      http://ip:port/Items/0c747b9c6a4e62939f22a98888385bb8/Images/Primary

      2025-02-07 回复
  3. ropzqzqizr 闲逛
    Windows 10 · Google Chrome

    这篇文章如同一幅色彩斑斓的画卷,每一笔都充满了独特的创意。

    2025-02-28 回复
  4. furbraioxd 闲逛
    Windows 10 · Google Chrome

    研究方法科学,数据支撑充分,结论可靠。

    2025-03-01 回复
  5. hhwmhgutwg 闲逛
    Windows 10 · Google Chrome

    文章结构紧凑,层次分明,逻辑严密,让人一读即懂。

    2025-03-02 回复
  6. tyisozvqpd 闲逛
    Windows 10 · Google Chrome

    情感真挚自然,字里行间传递出强烈的感染力。

    2025-03-04 回复
  7. https://inventonslemondedapres.org 闲逛
    MacOS · Google Chrome

    Avec Inventonslemondedapres, trouvez facilement des casinos en ligne proposant des promotions régulières
    et intéressantes !

    2025-05-10 回复
  8. web site 闲逛
    Windows 10 · Google Chrome

    Just want to say your article is as astonishing. The clearness to your post is simply excellent and that
    i could suppose you're an expert in this subject. Well along with your
    permission let me to seize your feed to keep updated
    with impending post. Thanks 1,000,000 and please continue
    the rewarding work.
    web site
    Excellent way of describing, and pleasant piece of writing to obtain data on the topic of my presentation focus,
    which i am going to convey in university.
    site
    I'm amazed, I must say. Rarely do I come across a blog that's both equally educative and interesting, and let me tell you, you've hit the nail on the head.
    The problem is something which not enough men and
    women are speaking intelligently about. I am very happy that I stumbled across
    this during my search for something regarding this.

    meilleur casino en ligne
    I do not even know how I ended up here, but I thought this post was great.
    I do not know who you are but certainly you are going to a famous
    blogger if you are not already ;) Cheers!
    meilleur casino en ligne
    I do not know if it's just me or if everyone else encountering problems with
    your website. It appears like some of the text in your posts are running off the screen. Can someone
    else please comment and let me know if this is happening to them as well?
    This may be a issue with my internet browser because I've had this happen before.
    Many thanks
    homepage
    Great beat ! I would like to apprentice whilst you amend your website, how can i subscribe for a weblog site?
    The account helped me a appropriate deal. I were tiny bit acquainted of this your broadcast provided vibrant
    clear idea
    casino en ligne
    Hi there, I enjoy reading through your post. I like to write a little comment to support you.

    casino en ligne francais
    You actually make it seem so easy with your presentation but I find this matter to be actually something which I think I would never understand.
    It seems too complicated and extremely broad for me. I am looking forward for
    your next post, I'll try to get the hang of it!

    casino en ligne France
    Fastidious replies in return of this matter with firm arguments and
    explaining the whole thing on the topic of that.
    meilleur casino en ligne
    What's up to every body, it's my first pay a quick visit
    of this website; this web site carries awesome and really good stuff for readers.

    webpage

    2025-05-11 回复
  9. https://inventonslemondedapres.org 闲逛
    Windows 10 · Google Chrome

    Inventonslemondedapres vous guide vers les casinos en ligne
    les plus innovants avec des expériences de jeu uniques à
    découvrir !

    2025-05-11 回复
  10. casino en ligne 闲逛
    Windows 10 · Google Chrome

    Wow, fantastic weblog structure! How lengthy have you ever been running
    a blog for? you make running a blog glance easy. The whole glance of your website is magnificent,
    let alone the content material!
    casino en ligne
    Outstanding story there. What happened after? Good luck!
    homepage
    I don't know if it's just me or if everyone else experiencing issues with your blog.
    It seems like some of the text in your posts are running off the screen. Can someone else please provide feedback and let me know if this is happening to them as
    well? This might be a issue with my web browser because I've had this happen previously.
    Cheers
    web site
    Appreciate the recommendation. Will try it out.
    webpage
    Today, I went to the beachfront with my children. I found a sea shell and gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear." She put the shell to her ear and screamed.

    There was a hermit crab inside and it pinched her ear.
    She never wants to go back! LoL I know this is entirely off topic but I had to tell someone!

    web site
    Yes! Finally something about a.
    casino en ligne
    This is a really good tip particularly to those fresh to the blogosphere.
    Simple but very accurate information… Thank you for sharing this one.
    A must read post!
    casino en ligne fiable
    What's up every one, here every person is sharing
    such knowledge, thus it's nice to read this blog, and
    I used to pay a visit this web site all the time.

    webpage
    Hello mates, fastidious post and good arguments commented at this place, I am in fact enjoying by these.

    casino en ligne fiable
    I enjoy what you guys are usually up too. This kind of clever
    work and reporting! Keep up the good works guys I've included you
    guys to my blogroll.
    homepage

    2025-05-11 回复

人生倒计时

今日已经过去小时
这周已经过去
本月已经过去
今年已经过去个月

标签云