viptv/music

The ThinkPHP6 Helper Package

dev-master 2019-09-08 18:44 UTC

This package is not auto-updated.

Last update: 2020-07-21 01:37:40 UTC


README

Meting

Author

Version Downloads Travis License

> :cake: Wow, such a powerful music API framework

Introduction

A powerful music API framework to accelerate development

  • Easy - Easy to use, suppose format return.
  • Light - 46KB around with only one file.
  • Powerful - Suppose various webserver, include tencent, netease, xiami, kugou, baidu and more.
  • Free - Under MIT license, you can use it anywhere if you want.

Requirement

PHP 5.4+ and BCMath, Curl, OpenSSL extension installed

Install

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 the BCMath, cURL and OpenSSL extension in order to work.

Quick Start

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 · Telegram Channel @metooooo