完整修复PIX主题音乐接口并新增一次性发布多首歌曲功能

大概半个月之前,经过10多天的努力,借鉴网上各路大神的代码,终于拼凑并修复PIX主题音乐接口的BUG,并由自带主题的1.5.11版本自定义为1.6.0版本。PIX主题音乐接口是依托Github的metowolf大神制作而成,好巧不巧,刚才浏览时发现他也更新到了1.6.0版本,但是内容发生了很大变化,大家可以膜拜一下。

修复后的接口已经可以正常播放4个音乐平台的免费歌曲,并且新增了一次性发布多首歌曲的功能,且先后顺序在发布时可以随意拖动调整,并且为了加以区分,我在前台增加了来源自动显示。如果歌曲播放不出来,若平台官方API没有发生变化,只有如下两种可能:歌曲下架或者歌曲为会员VIP类型。各平台拥有各自歌曲的知识产权,个人认为可以偶尔引用免费歌曲聆听一下无伤大雅,但切勿使用变成一个音乐网站,尤其是不要对收费VIP歌曲进行侵权。

完整修复PIX主题音乐接口并新增一次性发布多首歌曲功能-似水流年

改造开始:

1、修改pix/inc/pix-type.php文件,支持一次性发布多首歌曲。找到

//音乐编辑

function audio_type_box(){

从这里开始至视频模块上方,把所有的音乐代码修改成如下:

温馨提示: 此处为隐藏内容,需要评论本文后才能查看.
评论后请刷新一次页面,但注意不要清除缓存,否则还需要再次评论!

2、修改pix/inc/assets/js/app.js,找到function get_audio_data(){ 函数,替换如下:

温馨提示: 此处为隐藏内容,需要评论本文后才能查看.
评论后请刷新一次页面,但注意不要清除缓存,否则还需要再次评论!

找到function get_moment_error(type){函数,替换为:

温馨提示: 此处为隐藏内容,需要评论本文后才能查看.
评论后请刷新一次页面,但注意不要清除缓存,否则还需要再次评论!

3、修改pix/inc/pix-meting.php、pix/inc/pix-music.php、pix/action/rewrite-musicapi.php、pix/inc/lib/music-api.php、pix/inc/assets/js/pixplayer.js、pix/style.css,新增pix/inc/assets/js/pixlyrics.js。由于改动实在太多,不再详细叙述修改细节,只提供打包文件。

温馨提示: 此处为隐藏内容,需要评论本文后才能查看.
评论后请刷新一次页面,但注意不要清除缓存,否则还需要再次评论!

大功告成!

Comments | 35 条评论
  • 2368791@qq.com

    Microsoft Edge 142 Microsoft Edge 142 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d745:e230:*:*

    回复看看

  • kiss

    Microsoft Edge 142 Microsoft Edge 142 Windows 10 Windows 10 cn中国–上海–上海 电信 ip address 61.169.*.*

    厉害了功能越来越全了,博主下一个准备折腾哪块内容呢

    • 似水流年

      Microsoft Edge 141 Microsoft Edge 141 Windows 10 Windows 10 cn中国 中国联通 ip address 2408:8220:5f15:b890:*:*

      网站暂时没啥了,目前给自己工作写一个小玩意儿。

  • 李的日志

    Mozilla Compatible Mozilla Compatible iPhone iOS 18.0 iPhone iOS 18.0 cn中国–广东 广电网 ip address 240a:42c7:a801:f62:*:*

    这整的越来越完美了。我发现凌晨的夜访问你的博客速度就是快,白天都加载很久才能进来哈哈

    • 似水流年

      IBrowse r IBrowse r Android 12 Android 12 cn中国–河南–漯河 电信 ip address 222.89.*.*

      可能是服务器在国外,咱们晚上是他们白天的缘故。

  • 彬红茶

    Google Chrome 116 Google Chrome 116 Windows 10 Windows 10 cn中国 中国电信 ip address 240e:3ba:ca0:2841:*:*

    哇瑟真是越来越好了!不要太拼命了😊

    • 似水流年

      IBrowse r IBrowse r Android 12 Android 12 cn中国–河南–漯河 电信 ip address 222.89.*.*

      谢谢,这一段没有太多时间弄网站。。

  • ymz316

    Firefox 140 Firefox 140 GNU/Linux GNU/Linux cn中国 中国电信 ip address 240e:385:da08:3300:*:*

    已完全沉醉在网站打造中了,注意休息啊。

  • 全局变量

    Google Chrome 132 Google Chrome 132 Windows 10 Windows 10 cn中国–湖南–岳阳–平江县 联通 ip address 110.52.*.*

    啥时候也上了ai摘要

    • 似水流年

      IBrowse r IBrowse r Android 12 Android 12 cn中国 中国联通 ip address 2408:8220:5f11:f370:*:*

      我装的wpopt插件升级了,这次更新新增了AI摘要。

  • obaby

    Google Chrome 134 Google Chrome 134 Mac OS X 10.15 Mac OS X 10.15 cn中国 中国联通 ip address 2408:8417:d10:1e53:*:*

    nice,不过我没在网站上加音乐。折腾万岁。

    • 似水流年

      IBrowse r IBrowse r Android 12 Android 12 cn中国 中国联通 ip address 2408:8220:5f11:f370:*:*

      很想和你一样写生活文章,但是实在没有可写的地方。

  • 靓仔

    Google Chrome 128 Google Chrome 128 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d747:bc70:*:*

    大佬全部替换完跟修改了还是没效果

    • 似水流年

      IBrowse r IBrowse r Android 12 Android 12 cn中国 中国联通 ip address 2408:8220:5f11:f370:*:*

      缓存啥的清理一遍试试。

      • 靓仔

        Google Chrome 128 Google Chrome 128 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d747:bc70:*:*

        清理过了还是一样,发布后连播放器样式都没有只显示片刻的文字

        • 似水流年

          Microsoft Edge 141 Microsoft Edge 141 Windows 10 Windows 10 cn中国 中国联通 ip address 2408:8220:5f11:f370:*:*

          忘记还有样式了,已经更新压缩包了。

          • 靓仔

            Google Chrome 128 Google Chrome 128 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d747:bc70:*:*

            新加的文件是放在哪呢?

            • 似水流年

              Microsoft Edge 141 Microsoft Edge 141 Windows 10 Windows 10 cn中国 中国联通 ip address 2408:8220:5f11:f370:*:*

              文章内容我也更新了,pix/style.css。

              • 靓仔

                Google Chrome 128 Google Chrome 128 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d747:bc70:*:*

                https://twt.tf/ 同步修改了还是一样不显示😭

                • 似水流年

                  Microsoft Edge 141 Microsoft Edge 141 Windows 10 Windows 10 cn中国 中国联通 ip address 2408:8220:5f11:f370:*:*

                  我看你后台音乐设置。

                  • 靓仔

                    Google Chrome 128 Google Chrome 128 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d747:bc70:*:*

                    主题里的音乐设置吗?我里面没设置有api接口,修改上述文件还需要填写音乐API地址那些吗?没修改之前都不需要通过这个api就可以获取网易云音乐的

                    • 似水流年

                      Microsoft Edge 141 Microsoft Edge 141 Windows 10 Windows 10 cn中国 中国联通 ip address 2408:8220:5f11:f370:*:*

                      压缩包里的代码,不要改成自己的域名,只能使用abohe.cn获取。

                    • 似水流年

                      Microsoft Edge 141 Microsoft Edge 141 Windows 10 Windows 10 cn中国 中国联通 ip address 2408:8220:5f11:f370:*:*

                      如果你曾经在后台扩展的HTML底部添加了歌词可视化,用我的就删除掉这个文章里后台扩展的代码,更换成[script src="https://你的域名/wp-content/themes/pix/inc/assets/js/pixlyrics.js"][/script](前后[]更换成<>)。另外你后台把网站样式改成三栏试试。

                      • 靓仔

                        Google Chrome 128 Google Chrome 128 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d745:e230:*:*

                        )。另外你后台把网站样式改成三栏试试。; pos: top" href="#comment-3012"> 有单栏的改法吗 这个主题单栏的设置也改了很多文件美化

                        )。另外你后台把网站样式改成三栏试试。; pos: top" href="#comment-3012">

                      • 靓仔

                        Google Chrome 128 Google Chrome 128 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d745:e230:*:*

                        )。另外你后台把网站样式改成三栏试试。; pos: top" href="#comment-3012"> 后台添加了然后改了三栏模式也是没办法获取,只有网易云音乐才会播放器样式出现,但是网易云点击播放又无法播放不知道怎么回事

                        )。另外你后台把网站样式改成三栏试试。; pos: top" href="#comment-3012">

                        • 似水流年

                          IBrowse r IBrowse r Android 12 Android 12 cn中国–河南–漯河 电信 ip address 222.89.*.*

                          我没有试过单栏的,我的所有修改都是基于三栏修改的。

                          • 2368791@qq.com

                            Microsoft Edge 142 Microsoft Edge 142 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d745:e230:*:*

                            大佬,我本地搭建在没更改过任何文件情况下替换上述的文件也是没效果,网易云无法播放,是不是有什么文件弄错了

                            • 似水流年

                              Microsoft Edge 141 Microsoft Edge 141 Windows 10 Windows 10 cn中国 中国联通 ip address 2408:8220:5f15:b890:*:*

                              代码更新了,新增第2个app.js漏掉了,再试试。

                              • 2368791@qq.com

                                Microsoft Edge 142 Microsoft Edge 142 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d745:e230:*:*

                                还是没有效果😭

                                • 似水流年

                                  Microsoft Edge 141 Microsoft Edge 141 Windows 10 Windows 10 cn中国 中国联通 ip address 2408:8220:5f15:b890:*:*

                                  你使用酷我音乐填入这个499610341试试看能显示不能。

                                  • 2368791@qq.com

                                    Microsoft Edge 142 Microsoft Edge 142 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d745:e230:*:*

                                    跟网易云效果一样只有个播放器样式但是点击播放播不了,而且点击添加歌曲也没效果

                                    • 似水流年

                                      IBrowse r IBrowse r Android 12 Android 12 cn中国 中国联通 ip address 2408:8220:5f15:b890:*:*

                                      我提供的文件,你是直接覆盖了还是修改了一些内容?

                                      • 2368791@qq.com

                                        Microsoft Edge 142 Microsoft Edge 142 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d745:e230:*:*

                                        直接覆盖的,没改任何东西,只根据上面帖子修改了app.js跟pix-type.php这两个文件是手动改的,其他压缩包里面的文件是直接覆盖原文件的

                                        • 似水流年

                                          Microsoft Edge 142 Microsoft Edge 142 Windows 10 Windows 10 cn中国 中国联通 ip address 2408:8220:5f15:f920:*:*

                                          我能想到的改动的文件就这么多了,如果是这样,就看你后台配置了,登录4个平台后,把后台中所有的cookies都更新一下看看。

  • 靓仔

    Google Chrome 128 Google Chrome 128 Windows 10 Windows 10 cn中国 中国移动 ip address 2409:8a55:d747:bc70:*:*

    感谢大佬分享🌹🌹

消息盒子
# 您需要首次评论以获取消息 #
# 您需要首次评论以获取消息 #

只显示最新10条未读和已读信息