Qwekkx 最开始排查数据的时候我对比了大约十首VIP歌曲,觉得fee=1这个字段值可能是用来标识vip歌曲的,我自己用的时候没有加筛选逻辑啦,偷懒返回了多个结果直接挑能播的【。

测试用的数据:https://music.163.com/api/search/pc?s=radwimps&type=1&limit=10
里面只有第5首 Light The Light是非vip,其他9首都是vip且fee都为1

    Qwekkx 好耶!学到用offset了!提醒一下大家偏移量编号是从0开始的【废话
    有个报错,假如歌名中包含#,offset会取不到值,attempt to concatenate a nil value (local 'offset')
    我指定了搜索位置必须在歌名后匹配#+一个数字的格式,这样拆分字符串时会精准些(?)仅供参考【心虚

     local offsetstring = string.match(rest, "#(%d*)",#rest - 1)
        local offset
        local isOffset = 0
        if (offsetstring ~= nil) then
            --存在偏移
            offset = tonumber(offsetstring)
            rest = string.sub(rest, 1,#rest-2)
            isOffset = 1
        else
            offset = 0
        end

      出现了新问题,把旧版的wisteriamusic.lua删掉,然后放进去新的ver2文件再重命名成wisteriamusic,反而出现调用getmusic函数失败了……之前旧版反而没这个问题 Orz
      错误代码长这样:
      调用/storage/emulated/0/Android/data/io.github.mzdluo123.mirai.android/files/Dice771541991/plugin/wisteriamusic.lua函数getMusic失败!
      …rai.android/files/Dice771541991/plugin/wisteriamusic.lua:39: attempt to index a nil value (field ‘result’)

        5 天 后

        无法调用,是第一次使用,也替换了json.lua,别的脚本正常,这个不行,错误代码:
        调用F:\Mirai Dice\Dicexxxxxxx\plugin\WisteriaMusic_Ver02.lua函数getMusic失败!
        …Mirai Dice\Dicexxxxxxx\plugin\WisteriaMusic_Ver02.lua:34: module ‘json’ not found:

          这边也是第一次加文件之后出现的错误orzzzz错误代码是↓

          调用/root/server/server_core/miluo/Dice2954758344/plugin/WisteriaMusic_Ver02.lua函数getMusic失败!
          …core/miluo/Dice2954758344/plugin/WisteriaMusic_Ver02.lua:38: attempt to index a nil value (field ‘result’)

            yikecan 嗯……这个看上去就是json的问题,我也不知道……或许你可以试试更新?

            4 天 后

            Qwekkx 不好意思这么久才回复!用的是最新的的windows版本,在重新启动几次之后不知道为什么就好了……还是很感谢www

            版本2.6.3(beta3)603在使用新版本后出现以下错误C:\bot2\DICE162\plugin\WISTER3.LUA函数getMusic失败!
            C:\bot2\DICE162\plugin\WISTER3.LUA:38: attempt to index a nil value (field ‘result’)
            服务器系统是window 2016
            请问一下大佬出现这个报错该怎么解决?

              麻了 2.6.3 beta5 2022-02-19
              17:54:27 I/MiraiNative: [DiceDriver DiceDriver] 调用C:\Users\12271\Desktop\1\DICE121\plugin\WISTER1.LUA函数getMusic失败!
              C:\Users\12271\Desktop\1\DICE121\plugin\WISTER1.LUA:38: attempt to index a nil value (field ‘result’)
              调试了半天也没用