lich0821 / WeChatFerry

微信机器人底层框架,可接入Gemini、ChatGPT、ChatGLM、讯飞星火、Tigerbot等大模型。WeChat Robot Hook.
MIT License
4.39k stars 776 forks source link

怎么发音乐xml #271

Open 5d4D opened 2 weeks ago

5d4D commented 2 weeks ago

微信图片_20241113202028 怎么发送音乐xml,更新说实现了,有没有大哥会

yitiaoaishuijiaodexianyu commented 2 weeks ago

<appmsg appid="wx79f2c4418704b4f8" sdkver="0"><title>威风堂堂</title><des>威风堂堂</des><action>view</action><type>3</type><showtype>0</showtype><content /><url>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</url><dataurl>https://frz.fan/mp3/威风堂堂.mp3</dataurl><lowurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</lowurl><lowdataurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</lowdataurl><recorditem /><thumburl>https://frz.fan/mp3/威风堂堂.mp3</thumburl><messageaction /><laninfo /><extinfo /><sourceusername /><sourcedisplayname /><songlyric></songlyric><commenturl /><appattach><totallen>0</totallen><attachid /><emoticonmd5></emoticonmd5><fileext /><aeskey></aeskey></appattach><webviewshared><publisherId /><publisherReqId>0</publisherReqId></webviewshared><weappinfo><pagepath /><username /><appid /><appservicetype>0</appservicetype></weappinfo><websearch /><songalbumurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</songalbumurl></appmsg><fromusername></fromusername><scene>0</scene><appinfo><version>57</version><appname>酷狗音乐</appname></appinfo><commenturl />
5d4D commented 2 weeks ago
<appmsg appid="wx79f2c4418704b4f8" sdkver="0"><title>威风堂堂</title><des>威风堂堂</des><action>view</action><type>3</type><showtype>0</showtype><content /><url>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</url><dataurl>https://frz.fan/mp3/威风堂堂.mp3</dataurl><lowurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</lowurl><lowdataurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</lowdataurl><recorditem /><thumburl>https://frz.fan/mp3/威风堂堂.mp3</thumburl><messageaction /><laninfo /><extinfo /><sourceusername /><sourcedisplayname /><songlyric></songlyric><commenturl /><appattach><totallen>0</totallen><attachid /><emoticonmd5></emoticonmd5><fileext /><aeskey></aeskey></appattach><webviewshared><publisherId /><publisherReqId>0</publisherReqId></webviewshared><weappinfo><pagepath /><username /><appid /><appservicetype>0</appservicetype></weappinfo><websearch /><songalbumurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</songalbumurl></appmsg><fromusername></fromusername><scene>0</scene><appinfo><version>57</version><appname>酷狗音乐</appname></appinfo><commenturl />

输出发送成功但没收到,XML类型填什么我填的3

yitiaoaishuijiaodexianyu commented 1 week ago

填49试试

5d4D commented 1 week ago
from wcferry import Wcf

wcf = Wcf()

print(wcf.get_user_info())

print(wcf.get_msg_types())

receiver_id = "50498461990@chatroom"

xml_content = """<?xml version="1.0"?>
<msg>
<appmsg appid="wxid_4l801f8zo32m22" sdkver="0"><title>威风堂堂</title><des>威风堂堂</des><action>view</action><type>3</type><showtype>0</showtype><content /><url>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</url><dataurl>https://frz.fan/mp3/威风堂堂.mp3</dataurl><lowurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</lowurl><lowdataurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</lowdataurl><recorditem /><thumburl>https://frz.fan/mp3/威风堂堂.mp3</thumburl><messageaction /><laninfo /><extinfo /><sourceusername /><sourcedisplayname /><songlyric></songlyric><commenturl /><appattach><totallen>0</totallen><attachid /><emoticonmd5></emoticonmd5><fileext /><aeskey></aeskey></appattach><webviewshared><publisherId /><publisherReqId>0</publisherReqId></webviewshared><weappinfo><pagepath /><username /><appid /><appservicetype>0</appservicetype></weappinfo><websearch /><songalbumurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</songalbumurl></appmsg><fromusername>wxid_4l801f8zo32m22</fromusername><scene>0</scene><appinfo><version>57</version><appname>酷狗音乐</appname></appinfo><commenturl />
</msg>"""

xml_type = 49

path = "https://y.qq.com/music/photo_new/T002R800x800M000002eFUFm2XYZ7z_3.jpg"

result = wcf.send_xml(receiver_id, xml_content, xml_type, path)

if result == 0:
    print("XML发送成功!")
else:
    print(f"XML发送失败,错误码:{result}")

还是不行,大哥帮我看看有没有错

5d4D commented 1 week ago
<appmsg appid="wxid_4l801f8zo32m22" sdkver="0">

这地方我换了其他平台还有微信号都不行

yitiaoaishuijiaodexianyu commented 1 week ago

<?xml version="1.0"?><msg></msg> 你加这几个干什么 去掉 只要appmsg里面的东西

5d4D commented 1 week ago
from wcferry import Wcf

wcf = Wcf()

print(wcf.get_user_info())

print(wcf.get_msg_types())

receiver_id = "50498461990@chatroom"

xml_content = """<appmsg appid="wx79f2c4418704b4f8" sdkver="0"><title>威风堂堂</title><des>威风堂堂</des><action>view</action><type>3</type><showtype>0</showtype><content /><url>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</url><dataurl>https://frz.fan/mp3/威风堂堂.mp3</dataurl><lowurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</lowurl><lowdataurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</lowdataurl><recorditem /><thumburl>https://frz.fan/mp3/威风堂堂.mp3</thumburl><messageaction /><laninfo /><extinfo /><sourceusername /><sourcedisplayname /><songlyric></songlyric><commenturl /><appattach><totallen>0</totallen><attachid /><emoticonmd5></emoticonmd5><fileext /><aeskey></aeskey></appattach><webviewshared><publisherId /><publisherReqId>0</publisherReqId></webviewshared><weappinfo><pagepath /><username /><appid /><appservicetype>0</appservicetype></weappinfo><websearch /><songalbumurl>https://wx.qlogo.cn/mmopen/r48cSSlr7jgFutEJFpmolCux6WWZsm92KLTOmWITDvqPVIO5kLpTblfqsxuGzaZvGkgHsBOohkWuZlZuF48hRVEIcjRu1wVF/64</songalbumurl></appmsg><fromusername>wxid_4l801f8zo32m22</fromusername><scene>0</scene><appinfo><version>57</version><appname>酷狗音乐</appname></appinfo><commenturl />
"""

xml_type = 49

path = None

result = wcf.send_xml(receiver_id, xml_content, xml_type, path)

if result == 0:
    print("XML发送成功!")
else:
    print(f"XML发送失败,错误码:{result}")

1732340592138 还是一样,我看xml内容都有


<?xml version="1.0"?><msg></msg> 
``` 这个,