Coder Social home page Coder Social logo

plugin_music's Introduction

音乐插件

这个项目是chatgpt-on-wechat 的音乐插件, 实现以下功能:

  • 使用chatgpt 推荐音乐并发送播放链
  • 点歌

使用方式

插件集成

  1. 把项目解压到chatgpt-on-wechat/plugins/plugin_music/ 目录下
  2. 配置 chatgpt-on-wechat/plugins/plugins.json
{
 "Music": {
   "enabled": true,
   "priority": 0
 }
}
  1. 安装插件的依赖
cd /chatgpt-on-wechat/plugins/plugin_music/
pip3 install -r requirements.txt
  1. 配置网易云邮箱和md5后的密码 /chatgpt-on-wechat/plugins/plugin_music/config.json
cp config.json.example config.json

{
  "username": "",
  "passwd_md5":""
}
  1. 重新启动chatgpt-on-wechat

触发

<关键字><空格><指令>:<内容>

  • 点歌: music 点歌:可惜我是水瓶座-杨千嬅
  • 推荐: music 推荐一手粤语歌曲

效果

img.png

plugin_music's People

Stargazers

 avatar  avatar NewLife avatar EgilWu avatar  avatar Qindaier avatar  avatar  avatar  avatar  avatar  avatar Luke avatar  avatar wenguangxu avatar swumagic avatar andrew lee avatar  avatar  avatar  avatar  avatar HenryHe avatar  avatar  avatar  avatar Paul Zhu avatar

Watchers

 avatar

plugin_music's Issues

报错TypeError: string indices must be integers

[ERROR][2023-07-06 19:39:18][chat_channel.py:273] - Worker return exception: string indices must be integers
Traceback (most recent call last):
File "/root/.conda/envs/we/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/root/chatgpt-on-wechat/channel/chat_channel.py", line 149, in _handle
reply = self._generate_reply(context)
File "/root/chatgpt-on-wechat/channel/chat_channel.py", line 159, in _generate_reply
e_context = PluginManager().emit_event(
File "/root/chatgpt-on-wechat/plugins/plugin_manager.py", line 165, in emit_event
instance.handlers[e_context.event](e_context, *args, **kwargs)
File "/root/chatgpt-on-wechat/plugins/plugin_music/netease_music.py", line 52, in on_handle_context
url, name, ar = self.search_song(msg)
File "/root/chatgpt-on-wechat/plugins/plugin_music/netease_music.py", line 102, in search_song
songs = result["songs"]
TypeError: string indices must be integers

docker部署

2024-04-17 11:48:09 [INFO][2024-04-17 03:48:09][netease_music.py:42] - content => music 点歌: 可惜我是水瓶座-杨千嬅
2024-04-17 11:48:09 ERROR:root:search song buss code:50000005, resp:{'code': 50000005}
2024-04-17 11:48:09 可惜我是水瓶座
2024-04-17 11:48:09 杨千嬅
2024-04-17 11:48:09 200
2024-04-17 11:48:09 [ERROR][2024-04-17 03:48:09][chat_channel.py:301] - Worker return exception: 'NoneType' object is not subscriptable
2024-04-17 11:48:09 Traceback (most recent call last):
2024-04-17 11:48:09 File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
2024-04-17 11:48:09 result = self.fn(*self.args, **self.kwargs)
2024-04-17 11:48:09 File "/app/channel/chat_channel.py", line 170, in _handle
2024-04-17 11:48:09 reply = self._generate_reply(context)
2024-04-17 11:48:09 File "/app/channel/chat_channel.py", line 180, in _generate_reply
2024-04-17 11:48:09 e_context = PluginManager().emit_event(
2024-04-17 11:48:09 File "/app/plugins/plugin_manager.py", line 189, in emit_event
2024-04-17 11:48:09 instance.handlers[e_context.event](e_context, *args, **kwargs)
2024-04-17 11:48:09 File "/app/plugins/plugin_music/netease_music.py", line 52, in on_handle_context
2024-04-17 11:48:09 url, name, ar = self.search_song(msg)
2024-04-17 11:48:09 File "/app/plugins/plugin_music/netease_music.py", line 99, in search_song
2024-04-17 11:48:09 if resp["code"] == 200:
2024-04-17 11:48:09 TypeError: 'NoneType' object is not subscriptable

我的项目报错了,能否指导解决

[INFO][2023-09-23 00:35:04][netease_music.py:42] - content => music 点歌:可惜我是水瓶座-杨千嬅
可惜我是水瓶座
杨千嬅
200
[ERROR][2023-09-23 00:35:04][chat_channel.py:282] - Worker return exception: string indices must be integers
Traceback (most recent call last):
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/ubuntu/chatgpt-on-wechat/channel/chat_channel.py", line 155, in _handle
reply = self._generate_reply(context)
File "/home/ubuntu/chatgpt-on-wechat/channel/chat_channel.py", line 165, in _generate_reply
e_context = PluginManager().emit_event(
File "/home/ubuntu/chatgpt-on-wechat/plugins/plugin_manager.py", line 189, in emit_event
instance.handlers[e_context.event](e_context, *args, **kwargs)
File "/home/ubuntu/chatgpt-on-wechat/plugins/plugin_music/netease_music.py", line 52, in on_handle_context
url, name, ar = self.search_song(msg)
File "/home/ubuntu/chatgpt-on-wechat/plugins/plugin_music/netease_music.py", line 102, in search_song
songs = result["songs"]
TypeError: string indices must be integers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.