A powerful music API framework to accelerate your development

Overview

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

Comments
  • 请求网易的api 时候url($id) 获取不到音乐链接。

    请求网易的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 }

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

    bug 
    opened by DJ-clamp 17
  • Getting album pic failed

    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!

    opened by D-Bood 8
  • Meto 大佬可以考虑下接口简洁化嘛?

    Meto 大佬可以考虑下接口简洁化嘛?

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

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

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

    opened by Dreamer-Paul 5
  • syntax error, unexpected '['

    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

    opened by farlandliu 5
  • api报错net::ERR_TIMED_OUT

    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 接口测试工具可以正常访问

    opened by booboom 4
  • Pagination Problem

    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

    opened by fung626 4
  • 网易云音乐里获取专辑图片不正确

    网易云音乐里获取专辑图片不正确

    在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”才是真实的专辑图片。

    opened by SLT2 4
  • 网易云url无损解析存在问题

    网易云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地址数据。望改进

    opened by and0rw 4
  • 百度音乐获取歌曲地址失败

    百度音乐获取歌曲地址失败

    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返回空字符串

    opened by luguoguo 3
Owner
METO
METO
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

Excalibur 1 Oct 14, 2021
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

Abdelrahman Samir 2 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

null 3 Dec 15, 2022
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

BinarCode 394 Dec 23, 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

Weibo R&D Open Source Projects 5.8k Dec 20, 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

Ihar Aliakseyenka 3 Mar 4, 2022
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

Yajie Zhu 162 Oct 7, 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

Friends Of Cake 357 Jan 2, 2023
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

Uladzislau Yermakou 5 Jul 7, 2022
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

PHP_Depend 837 Dec 14, 2022
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

Mirasvit 71 Dec 7, 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

Sentrifugo 447 Dec 27, 2022
NamelessMC is a free, easy to use & powerful website software for your Minecraft server, which includes a large range of features.

NamelessMC is a free, easy to use & powerful website software for your Minecraft server, which includes a large range of features

NamelessMC 519 Dec 31, 2022
The game is implemented as an example of scalable and high load architecture combined with modern software development practices

Crossword game The game is implemented as an example of scalable and high load architecture combined with modern software development practices Exampl

Roman 56 Oct 27, 2022
Full PHP development environment for Docker.

Full PHP development environment based on Docker. Use Docker First - Learn About It Later! Join Us Awesome People Laradock is an MIT-licensed open sou

laradock 11.7k Jan 7, 2023
Web Site developed for the subject of Web Development 2

Trabalho - DW2 Web Site developed for the discipline of Web Development 2. It has been developed to simulate a FIFA World Cup's system where you can C

Erik Gaborim 1 Feb 15, 2022
⚙️ Web3 PHP CLI is a blazing fast blockchain server for local development.

Web3 PHP CLI is a blazing fast blockchain server for local development. This project is a work-in-progress. Code and documentation are currently under

Web3 PHP 139 Jan 6, 2023