A powerful music API framework to accelerate your development

Last update: Jun 30, 2022

Meting

Author Version Downloads Travis License

🍰 Wow, such a powerful music API framework

Introduction

A powerful music API framework to accelerate your development

  • Elegant - Easy to use, a standardized format for all music platforms.
  • Lightweight - A single-file library that's less than 51KB.
  • Powerful - Support various music platforms, including Tencent, NetEase, Xiami, KuGou, Baidu, Kuwo and more.
  • Free - Under MIT license, need I say more?

Requirement

PHP 5.4+ and BCMath, Curl, OpenSSL extension installed.

Installation

Require this package, with Composer, in the root directory of your project.

$ composer require metowolf/meting

Then you can import the class into your application:

use Metowolf\Meting;

$api = new Meting('netease');

$data = $api->format(true)->search('Soldier');

Note: Meting requires BCMath, cURL and OpenSSL extension in order to work.

Quick Start

format(true)->url(35847388); echo $data; // {"url":"http:\/\/...","size":4729252,"br":128}">
require 'vendor/autoload.php';
// require 'Meting.php';

use Metowolf\Meting;

// Initialize to netease API
$api = new Meting('netease');

// Use custom cookie (option)
// $api->cookie('paste your cookie');

// Get data
$data = $api->format(true)->search('Soldier', [
    'page' => 1,
    'limit' => 50
]);

echo $data;
// [{"id":35847388,"name":"Hello","artist":["Adele"],"album":"Hello","pic_id":"1407374890649284","url_id":35847388,"lyric_id":35847388,"source":"netease"},{"id":33211676,"name":"Hello","artist":["OMFG"],"album":"Hello",...

// Parse link
$data = $api->format(true)->url(35847388);

echo $data;
// {"url":"http:\/\/...","size":4729252,"br":128}

More usage

Join the Discussion

Related Projects

Author

Meting © metowolf, Released under the MIT License.

Blog @meto · GitHub @metowolf · Twitter @metowolf

GitHub

https://github.com/metowolf/meting
Comments
  • 1. 请求网易的api 时候url($id) 获取不到音乐链接。

    { "data": [ { "id": 65795, "url": null, "br": 0, "size": 0, "md5": null, "code": 404, "expi": 1200, "type": null, "gain": 0, "fee": 0, "uf": null, "payed": 0, "flag": 0, "canExtend": false } ], "code": 200 }

    返回数据如上所示,有点奇怪。。。。

    Reviewed by DJ-clamp at 2017-04-12 07:07
  • 2. Getting album pic failed

    Hi! I use $API->pic($id); to get the album pic. But when I open the link there's nothing and the debugger returns me a 404. I choose Netease and my server isn't in China. My PHP version is 7.1.0 Thanks your hard work!

    Reviewed by D-Bood at 2017-02-15 02:27
  • 3. Meto 大佬可以考虑下接口简洁化嘛?

    RT,我发现如果要供一个播放器使用你的 API,需要发多次 XHR 请求分别请求一次歌曲信息和歌词内容。如果有翻译还得额外请求一次,食用起来略嫌麻烦。

    我自己分析找到了 Meting 使用的部分网易接口,发现部分接口并不需要 paramsencSecKey 参数就能获得内容,不解为什么还要额外发送它们。

    而近期我打算发布一个精简轻量的播放器(Kico Player Mini),这个东西在我博客的 文章 里也有 Demo。由于本人穷的慌,没钱完善服务器资源,可能无法给予用户最好的体验。暂时打算考虑食用一下大佬的接口,不知道大佬能否完善下 Meting 或是为我提供帮助?

    Reviewed by Dreamer-Paul at 2019-04-16 03:32
  • 4. syntax error, unexpected '['

    Want to test this API, but failed. PHP=5.3.6 BTW, i'm not familiar to PHP.

    <?php
    // If you installed via composer, just use this code to requrie autoloader on the top of your projects.
    //require 'mting.php';
    
    //Or require file
    require 'Meting.php';
    
    use Metowolf\Meting;
    //use Metowolf\Meting;
    
    // Initialize to netease API
    $API = new Meting('netease');
    
    // Get data
    $data = $API->format(true)->search('Soldier');
    
    // Enjoy
    echo $data;
    ?>
    
    

    Parse error: syntax error, unexpected '[' in .....\www\mting\Meting.php on line 703

    Reviewed by farlandliu at 2017-04-06 07:22
  • 5. api报错net::ERR_TIMED_OUT

    如题, 本地和托管在GitHub上的博客都报这个错误: Meting.min.js:1 GET https://api.i-meto.com/meting/api?server=netease&type=playlist&id=536254974&r=0.5307348801325908 net::ERR_TIMED_OUT 接口测试工具可以正常访问

    Reviewed by booboom at 2018-10-16 11:14
  • 6. Pagination Problem

    I want to setup a pagination search function in my application. And I have finished API part by follow your instruction

    $api = new Meting('netease');
    
    $data = $api->format(true)->search('Soldier', [
        'page' => 1,
        'limit' => 50
    ]);
    
    echo $data;
    

    The data have successfully received. However, without the total I can't calculate the last page. Same as your NeteaseCloudMusicApi repo songCount data.

    Also, I had reviewed Meting.php. And I found out there is a parameter call total in netease. By default set it to true, but I still can't get the total.

    My question is how I get the total when run the search function? thanks in advance

    Reviewed by fung626 at 2018-04-27 16:24
  • 7. 网易云音乐里获取专辑图片不正确

    在wiki里的获取 专辑图片在代码, $id=28535; $data = $API->pic($id); echo $data; 输出的结果是https://p3.music.126.net/6vxf0W45d7u_o-NZiRJgkQ==/28535.jpg?param=300z300&quality=100 不是有效图片,真实的专辑图片是http://p1.music.126.net/rpN_SSV-plUaFsw06NXZqQ==/37383395345629.jpg 在获取专辑信息里$API->album($id);输出的“blurPicUrl”才是真实的专辑图片。

    Reviewed by SLT2 at 2017-05-24 02:38
  • 8. 网易云url无损解析存在问题

    网易云的url解析里对有ape格式的无损音乐会单独放在uf结构体内。整体结构类似于

    {
        "data": [
            {
                "id": 418603077,
                "url": "320k地址",
                "br": 320000,
                "size": 8608958,
                "md5": "7917f621d8ec9ad72e8261b3f5c1cd19",
                "code": 200,
                "expi": 1200,
                "type": "MP3",
                "gain": 0,
                "fee": 0,
                "uf": {
                    "id": 418603077,
                    "url": "ape地址",
                    "br": 930354,
                    "size": 25020330,
                    "md5": "7917f621d8ec9ad72e8261b3f5c1cd19",
                    "code": 200,
                    "expi": 1200,
                    "type": "APE",
                    "gain": 0,
                    "fee": 0,
                    "uf": null,
                    "payed": 1,
                    "flag": 0,
                    "canExtend": false
                },
                "payed": 1,
                "flag": 0,
                "canExtend": false
            }
        ],
        "code": 200
    }
    

    在当前版本的解析中只会获取320k地址数据。望改进

    Reviewed by and0rw at 2017-03-29 07:07
  • 9. 百度音乐获取歌曲地址失败

    public function url($id, $br = 320000)
        {
            code...
                case 'baidu':
                $api = array(
                    'method' => 'GET',
                    'url'    => 'https://gss2.baidu.com/6Ls1aze90MgYm2Gp8IqW0jdnxx1xbK/v1/restserver/ting',
                    'body'   => array(
                        'from'     => 'qianqianmini',
                        'method'   => 'baidu.ting.song.getInfos',
                        'songid'   => $id,
                        'res'      => 1,
                        'platform' => 'darwin',
                        'version'  => '1.0.0',
                    ),
                    'encode' => 'baidu_AESCBC',
                    'decode' => 'baidu_url',
                );
                break;
            }
            code...
        }
    

    github拉的最新版本 这里面的url已失效了. 测试: http://music.taihe.com/song/137406983 id给的137406983 返回

    {
        "url": "",
        "br": 1002
    }
    

    url返回空字符串

    Reviewed by luguoguo at 2018-11-03 21:32
This plugin allow you play music from resources pack in minecraft

Music Player for PocketMine-MP Commands music-start songname music-stop songname IMPORTANT! You must add music resources pack to PocketMine resources

Oct 14, 2021
Musicoker is a music player made by Laravel & Reactjs
Musicoker is a music player made by Laravel & Reactjs

Musicoker | Music Player Music player created with Laravel 8 and React 17.0.2 ReactJs Laravel MySQL Used Packages: Sanctum Getid3 Bootstrap React Rout

Apr 3, 2022
Generates a static website of metal music events in Leipzig

About EN: This projects generates a static website of metal music events in Leipzig (Ger). DE: Dieses Projekt erstellt einen Webkalender zu diversen M

Mar 13, 2022
The fastest way to make a powerful JSON:API compatible Rest API with Laravel.
The fastest way to make a powerful JSON:API compatible Rest API with Laravel.

The first fully customizable Laravel JSON:API builder. "CRUD" and protect your resources with 0 (zero) extra line of code. Installation You can instal

Jun 24, 2022
A powerful debug and profilers tool for the Phalcon Framework
A powerful debug and profilers tool for the Phalcon Framework

Phalcon Debugbar Integrates PHP Debug Bar with Phalcon Framework. 中文说明 Features Normal request capturing Ajax request capturing Redirect request chain

Oct 26, 2021
Magento 2 Blog Extension - FREE, fully featured, powerful Blog solution for your online store!

Blog MX | Magento 2 Blog Module by Mirasvit FREE, fully featured, powerful Blog solution for your online store! Magento 2 Blog MX allows you to open a

Jan 21, 2022
Sentrifugo is a FREE and powerful Human Resource Management System (HRMS) that can be easily configured to meet your organizational needs.

Sentrifugo Sentrifugo is a free and powerful new-age Human Resource Management System that can be easily configured to adapt to your organizational pr

Jun 27, 2022
A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.

Motan Overview Motan is a cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services. Related

Jun 25, 2022
Developer-friendly framework heavily inspired by Laravel and based on Timber and Wpemerge solutions for WordPress themes development with Bedrock folder structure

Lightweight Brocooly (Brocket) Improved Controllers, Middleware and Routers, but slightly less powerful Container Open beta. Package in development Cr

Mar 4, 2022
Production-grade rapid controller development with built in love for API and Search

Installation For CakePHP 4.x compatible version: composer require friendsofcake/crud For CakePHP 3.x compatible version: composer require friendsofca

Jun 7, 2022
A library that improve your WordPress development experience. 🚀

UYCore WordPress The main idea of the UYCore WordPress library is to decrease development time and have enjoyed the development process. The UYCore li

Dec 28, 2021
PHP_Depend is an adaptation of the established Java development tool JDepend. This tool shows you the quality of your design in terms of extensibility, reusability and maintainability.

PHP Depend Documentation PHP Depend for enterprise Available as part of the Tidelift Subscription. The maintainers of PHP Depend and thousands of othe

Jun 22, 2022
The new, most powerful Comic Reader ever created by the human race. Reworked by an Otaku.
The new, most powerful Comic Reader ever created by the human race. Reworked by an Otaku.

FoOlSlideX The new, most powerful Comic Reader ever created by the human race. Reworked by an Otaku. Requirements PHP greater than 7.0 and everything

Jun 21, 2022
Sey is a powerful math interpreter with infinite-precision.

Sey, pronounce say, is a powerful math interpreter with infinite-precision.

Dec 5, 2021
Powerful and flexible component for building site breadcrumbs.
Powerful and flexible component for building site breadcrumbs.

Phalcon Breadcrumbs Phalcon Breadcrumbs is a powerful and flexible component for building site breadcrumbs. You can adapt it to your own needs or impr

Mar 31, 2021
A library of powerful code snippets to help you get the job done with Gravity Forms and Gravity Perks.

Gravity Wiz Snippet Library Gravity Wiz is creating the most comprehensive library of snippets for Gravity Forms ever. We'll be consistently moving ou

Jun 24, 2022
Provides powerful menu editor to replace category based menus in Magento 2

Magento 2 Menu Provides powerful menu editor to replace category based menus in Magento 2. Setup Create new menu in the admin area Content > Elements

Jun 23, 2022
Yclas Self Hosted is a powerful script that can transform any domain into a fully customizable classifieds site within a few seconds.

Yclas 4.4.0. Description Yclas self-hosted is a powerful script that can transform any domain into a fully customizable classifieds site within a few

May 29, 2022