master
cn.yimian.xyz 4 years ago
parent c829589b0a
commit 2f56858b55
  1. 5
      composer.json
  2. 68
      composer.lock
  3. 582
      functions.php
  4. 142
      index.php
  5. 58
      intro.html
  6. 7
      vendor/autoload.php
  7. 445
      vendor/composer/ClassLoader.php
  8. 21
      vendor/composer/LICENSE
  9. 9
      vendor/composer/autoload_classmap.php
  10. 9
      vendor/composer/autoload_namespaces.php
  11. 10
      vendor/composer/autoload_psr4.php
  12. 52
      vendor/composer/autoload_real.php
  13. 31
      vendor/composer/autoload_static.php
  14. 54
      vendor/composer/installed.json
  15. 24
      vendor/metowolf/meting/.editorconfig
  16. 3
      vendor/metowolf/meting/.gitignore
  17. 28
      vendor/metowolf/meting/.travis.yml
  18. 21
      vendor/metowolf/meting/LICENSE
  19. 92
      vendor/metowolf/meting/README.md
  20. 38
      vendor/metowolf/meting/composer.json
  21. 1365
      vendor/metowolf/meting/src/Meting.php

@ -0,0 +1,5 @@
{
"require": {
"metowolf/meting": "^1.5"
}
}

68
composer.lock generated

@ -0,0 +1,68 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "70ff81c59564e9617fed0bf28f62fad1",
"packages": [
{
"name": "metowolf/meting",
"version": "v1.5.7",
"source": {
"type": "git",
"url": "https://github.com/metowolf/Meting.git",
"reference": "54178aa112da5db09f487d862d7ae62cbf7bc060"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/metowolf/Meting/zipball/54178aa112da5db09f487d862d7ae62cbf7bc060",
"reference": "54178aa112da5db09f487d862d7ae62cbf7bc060",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-openssl": "*",
"php": ">=5.4.0"
},
"suggest": {
"ext-bcmath": "Required to use BC Math calculate RSA.",
"ext-openssl": "Required to use OpenSSL encrypt params."
},
"type": "library",
"autoload": {
"psr-4": {
"Metowolf\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "metowolf",
"email": "i@i-meto.com",
"homepage": "https://i-meto.com"
}
],
"description": "A powerful music API framework to accelerate development.",
"homepage": "https://github.com/metowolf/Meting",
"keywords": [
"lightweight",
"lighty",
"music api",
"php music"
],
"time": "2019-06-16T05:55:00+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}

@ -0,0 +1,582 @@
<?php
include '/mnt/config/dbKeys/log.php';
include '/mnt/config/php/config.php';
/**database connection**/
//connect to database
function db__connect($servername="",$username="",$password="",$dbname="")
{echo $GLOBALS['g_db_serverName'];
/* reset */
if($servername=="") $servername=$GLOBALS['g_db_serverName'];
if($username=="") $username=$GLOBALS['g_db_usrName'];
if($password=="") $password=$GLOBALS['g_db_psswd'];
if($dbname=="") $dbname=$GLOBALS['g_db_dbName'];
if($servername == "log"){
$servername = $GLOBALS['g_db_log_serverName'];
$username = $GLOBALS['g_db_log_usrName'];
$password = $GLOBALS['g_db_log_psswd'];
$dbname = $GLOBALS['g_db_log_dbName'];
}elseif($servername == "yulu"){
$servername = $GLOBALS['g_db_log_serverName'];
$username = $GLOBALS['g_db_log_usrName'];
$password = $GLOBALS['g_db_log_psswd'];
$dbname = "yulu";
}
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error)
{
die("Mysql Connect Failed: " . $conn->connect_error);
}
return ($conn);
}
//get table row number::(data_cnnct var,table name) ::(row number)
function db__rowNum($conn,$table,$clmnName="",$value="",$clmnName2="",$value2="")
{
$table=db__antisql($table);
$clmnName=db__antisql($clmnName);
$value=db__antisql($value);
$clmnName2=db__antisql($clmnName2);
$value2=db__antisql($value2);
if($clmnName=="") $sql = "SELECT COUNT(*) FROM $table";
elseif($clmnName2=="") $sql = "SELECT COUNT(*) FROM $table where $clmnName='$value'";
else $sql = "SELECT COUNT(*) FROM $table where $clmnName='$value' AND $clmnName2='$value2'";
$row_count = $conn->query($sql);
list($row_num) = $row_count->fetch_row();
return ($row_num);
}
//get row data from database::(data_cnnct var, table name,column name, column value)::(row info)
function db__getData($conn,$table,$clmnName="",$value="",$clmnName2="",$value2="")
{
$table=db__antisql($table);
$clmnName=db__antisql($clmnName);
$value=db__antisql($value);
$clmnName2=db__antisql($clmnName2);
$value2=db__antisql($value2);
if($clmnName=="") $sql = "SELECT * FROM $table";
elseif($clmnName2=="") $sql = "SELECT * FROM $table where $clmnName='$value'";
else $sql = "SELECT * FROM $table where $clmnName='$value' AND $clmnName2='$value2'";
$result = $conn->query($sql);
//no data
if ($result->num_rows > 0) {}else{return 404;}
$i=0;
$arr=array();
while($row = $result->fetch_assoc()) {
$arr[$i++]=$row;
}
return ($arr);
}
//fnct for insert a row to database
function db__insertData($conn,$table,$content)
{
$table=db__antisql($table);
$key=array_keys($content);
$key=db__antisql($key);
$sql="insert INTO $table (";
for($i=0;$i<count($key);$i++)
{
$sql.="$key[$i]";
if($i!=count($key)-1) $sql.=", ";
}
$sql.=") VALUES (";
for($i=0;$i<count($key);$i++)
{
$tmp_key=$key[$i];
$content[$tmp_key]=db__antisql($content[$tmp_key]);
$sql.="'$content[$tmp_key]'";
if($i!=count($key)-1) $sql.=", ";
}
$sql.=")";
if (!($conn->query($sql) === TRUE)) echo "SQL Insert Error: " . $sql . "<br>" . $conn->error;
}
//fnct for update a row to database without check
function db__updateData($conn,$table,$content,$index)
{
$key=array_keys($content);
$key=db__antisql($key);
$sql="UPDATE $table SET ";
for($i=0;$i<count($key);$i++)
{
$tmp_key=$key[$i];
$content[$tmp_key]=db__antisql($content[$tmp_key]);
$sql.="$key[$i]='$content[$tmp_key]'";
if($i!=count($key)-1) $sql.=", ";
}
$key=array_keys($index);
$key=db__antisql($key);
$sql.=" WHERE ";
for($i=0;$i<count($key);$i++)
{
$tmp_key=$key[$i];
$index[$tmp_key]=db__antisql($index[$tmp_key]);
$sql.="$tmp_key='$index[$tmp_key]'";
if($i!=count($key)-1) $sql.=" AND ";
}
if (!($conn->query($sql) === TRUE)) echo "SQL Insert Error: " . $sql . "<br>" . $conn->error;
}
//push row data from database::(data_cnnct var, table name,column name, column value)::(row info)
function db__pushData($conn,$table,$content,$index="",$is_force=1)
{
if($index)
{
$index_keys=array_keys($index);
if(count($index_keys)==1) $result=db__rowNum($conn,$table,$index_keys[0],$index[$index_keys[0]]);
elseif(count($index_keys)==2) $result=db__rowNum($conn,$table,$index_keys[0],$index[$index_keys[0]],$index_keys[1],$index[$index_keys[1]]);
else return -1;
if($result>0) db__updateData($conn,$table,$content,$index);
else if($is_force) db__insertData($conn,$table,$content);
}
else
db__insertData($conn,$table,$content);
}
function db__delData($conn, $table, $clmnName, $value)
{
$value=db__antisql($value);
$clmnName=db__antisql($clmnName);
$sql = "DELETE FROM $table WHERE $clmnName = '$value'";
$conn->query($sql);
}
//anti sql
function db__antisql($str)
{
return(str_ireplace("'","",$str));
}
/*****log******/
function yimian__log($table, $val, $index = "", $cnt = null){
if(!isset($cnt)) $cnt = db__connect("log");
if($index != "") db__pushData($cnt, $table, $val, $index);
else db__pushData($cnt, $table, $val);
}
/** get from address **/
function get_from(){
if($_SERVER['HTTP_REFERER']) return $_SERVER['HTTP_REFERER'];
elseif($_REQUEST['from']) return $_REQUEST['from'];
}
function get_from_domain(){
$str = str_replace("http://","",get_from());
$str = str_replace("https://","",$str);
$strdomain = explode("/",$str);
return $strdomain[0];
}
/*****curl*****/
function curl__post($url = '', $param) {
if(empty($url)) {
return false;
}
$o = "";
foreach ($param as $k => $v) {
$o .= "$k=".urlencode($v)."&" ;
}
$postUrl = $url;
$curlPost = substr($o,0,-1);
$ch = curl_init();//初始化curl
curl_setopt($ch, CURLOPT_URL,$postUrl);//抓取指定网页
curl_setopt($ch, CURLOPT_HEADER, 0);//设置header
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
$data = curl_exec($ch);//运行curl
curl_close($ch);
return $data;
}
/* get IP */
function get_ip(){
return getIp();
}
function getIp()
{
if (isset($_SERVER)) {
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
foreach ($arr as $ip) {
$ip = trim($ip);
if ($ip != 'unknown') {
$realip = $ip;
break;
}
}
} else if (isset($_SERVER['HTTP_CLIENT_IP'])) {
$realip = $_SERVER['HTTP_CLIENT_IP'];
} else if (isset($_SERVER['REMOTE_ADDR'])) {
$realip = $_SERVER['REMOTE_ADDR'];
} else {
$realip = '0.0.0.0';
}
} else if (getenv('HTTP_X_FORWARDED_FOR')) {
$realip = getenv('HTTP_X_FORWARDED_FOR');
} else if (getenv('HTTP_CLIENT_IP')) {
$realip = getenv('HTTP_CLIENT_IP');
} else {
$realip = getenv('REMOTE_ADDR');
}
preg_match('/[\\d\\.]{7,15}/', $realip, $onlineip);
$realip = (!empty($onlineip[0]) ? $onlineip[0] : '0.0.0.0');
return $realip;
}
/* obs get video */
function getVideo($path, $time = 120*60){
return trim(exec(__DIR__."/obsutil sign obs://yimian-video/". $path ." -e=". $time));
}
/* obs get img */
function getImg($path, $time = 300){
return str_replace('yimian-image.obs.cn-east-2.myhuaweicloud.com:443','image.yimian.xyz',trim(exec(__DIR__."/obsutil sign obs://yimian-image/". $path ." -e=". $time)));
}
function getImgsInfo($type){
$arr_os = array();
$arr = array();
ini_set("pcre.backtrack_limit" , -1); ini_set("pcre.recursion_limit" , -1); ini_set("memory_limit" , "1024M");
exec(__DIR__.'/obsutil ls obs://yimian-image/'.$type.' -limit=-1', $arr_os);
//exec(__DIR__.'/obsutil', $arr_os);
//var_dump($arr_os);
//echo count($arr_os);
$str = implode ($arr_os);
preg_match_all('/img_(\S*?)_(\d{2,4})x(\d{2,4})_(\S*?)_(\S*?)_(\S*?).(jpe?g|png|gif|svg)\b/', $str, $arr);
return $arr;
}
/*****gugu*****/
function yimian__gugu($body){
$body = iconv("UTF-8","gbk//TRANSLIT",$body);
$url = "http://open.memobird.cn/home/printpaper";
return curl__post($url, array("ak" => $GLOBALS['ggj_ak'], "userID" => $GLOBALS['ggj_userID'], "memobirdID" => $GLOBALS['ggj_memobirdID'], "printcontent" => "T:".base64_encode($body)."", "timestamp" => "".time().""));
}
function gugu__send($ak, $userID, $memobirdID, $body){
$body = iconv("UTF-8","gbk//TRANSLIT",$body);
$url = "http://open.memobird.cn/home/printpaper";
return curl__post($url, array("ak" => $ak, "userID" => $userID, "memobirdID" => $memobirdID, "printcontent" => "T:".base64_encode($body)."", "timestamp" => "".time().""));
}
/** function for mail **/
function yimian__mail($to, $subject, $body, $from){
if($from == "") $from = "IoTcat 呓喵酱";
if($body == "") $body = "额(⊙﹏⊙) 未找到指定的邮件内容耶( •̀ ω •́ )y<br/><br/>更多信息请咨询<a href = 'https://iotcat.me'>IoTcat</a>期待你的回应啦~";
if($subject == "") $subject = "来自IoTcat的一声问候~";
$data = array(
'fromName' => $from, // 发件人名称
'from' => "admin@iotcat.xyz", // 发件地址
'to' => $to, // 收件地址
'replyTo' => "i@iotcat.me", // 回信地址
'subject' => $subject,
'html' => $body
);
// 当前请求区域
// 杭州
// API地址
$data['api'] = 'https://dm.aliyuncs.com/';
// API版本号
$data['version'] = '2015-11-23';
// 机房信息
$data['region'] = 'cn-hangzhou';
// AccessKeyId
$data['accessid'] = $GLOBALS['aym_AccessKey'];
// AccessKeySecret
$data['accesssecret'] = $GLOBALS['aym_SecretKey'];
// 是否成功
return aliyun($data);
}
//mail alliyun api
function aliyun($param)
{
// 重新组合为阿里云所使用的参数
$data = array(
'Action' => 'SingleSendMail', // 操作接口名
'AccountName' => $param['from'], // 发件地址
'ReplyToAddress' => "true", // 回信地址
'AddressType' => 1, // 地址类型
'ToAddress' => $param['to'], // 收件地址
'FromAlias' => $param['fromName'], // 发件人名称
'Subject' => $param['subject'], // 邮件标题
'HtmlBody' => $param['html'], // 邮件内容
'Format' => 'JSON', // 返回JSON
'Version' => $param['version'], // API版本号
'AccessKeyId' => $param['accessid'], // Access Key ID
'SignatureMethod' => 'HMAC-SHA1', // 签名方式
'Timestamp' => gmdate('Y-m-d\TH:i:s\Z'), // 请求时间
'SignatureVersion' => '1.0', // 签名算法版本
'SignatureNonce' => md5(time()), // 唯一随机数
'RegionId' => $param['region'] // 机房信息
);
// 请求签名
$data['Signature'] = sign($data, $param['accesssecret']);
// 初始化Curl
$ch = curl_init();
// 设置为POST请求
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
// 请求地址
curl_setopt($ch, CURLOPT_URL, $param['api']);
// 返回数据
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
// 提交参数
curl_setopt($ch, CURLOPT_POSTFIELDS, getPostHttpBody($data));
// 关闭ssl验证
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
// 执行请求
$result = curl_exec($ch);
// 获取错误代码
$errno = curl_errno($ch);
// 获取错误信息
$error = curl_error($ch);
// 获取返回状态码
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
// 关闭请求
curl_close($ch);
// 成功标识
$flag = TRUE;
// 如果开启了Debug
if (1) {
// 记录时间
$log = '[Aliyun] ' . date('Y-m-d H:i:s') . ': ' . PHP_EOL;
// 如果失败
if ( $errno ) {
// 设置失败
$flag = FALSE;
$log .= '邮件发送失败, 错误代码:' . $errno . ',错误提示: ' . $error . PHP_EOL;
}
// 如果失败
if ( 400 <= $httpCode ) {
// 设置失败
$flag = FALSE;
// 尝试转换json
if ( $json = json_decode($result) ) {
$log .= '邮件发送失败,错误代码:' . $json->Code . ',错误提示:' . $json->Message . PHP_EOL;
} else {
$log .= '邮件发送失败, 请求返回HTTP Code:' . $httpCode . PHP_EOL;
}
}
// 记录返回值
$log .= '邮件发送返回数据:' . serialize($result) . PHP_EOL;
// 写入文件
}
yimian__log("log_mail",array("timestamp" => date('Y-m-d H:i:s', time()), "to_" => $param['to'], "from_" => $param['fromName'], "subject" => $param['subject'], "body" => $param['html'], "success" => (($flag)?1:0), "return_" => $log));
// 返回结果
//echo $log;
return $flag;
}
/**
* 阿里云签名
*
* @static
* @access private
*
* @param array $param 签名参数
* @param string $accesssecret 秘钥
*
* @return string
*/
function sign($param, $accesssecret)
{
// 参数排序
ksort($param);
// 组合基础
$stringToSign = 'POST&' . percentEncode('/') . '&';
// 临时变量
$tmp = '';
// 循环参数列表
foreach ( $param as $k => $v ) {
// 组合参数
$tmp .= '&' . percentEncode($k) . '=' . percentEncode($v);
}
// 去除最后一个&
$tmp = trim($tmp, '&');
// 组合签名参数
$stringToSign = $stringToSign . percentEncode($tmp);
// 数据签名
$signature = base64_encode(hash_hmac('sha1', $stringToSign, $accesssecret . '&', TRUE));
// 返回签名
return $signature;
}
/**
* 阿里云签名编码转换
*
* @static
* @access private
*
* @param string $val 要转换的编码
*
* @return string|string[]|null
*/
function percentEncode($val)
{
// URL编码
$res = urlencode($val);
// 加号转换为%20
$res = preg_replace('/\+/', '%20', $res);
// 星号转换为%2A
$res = preg_replace('/\*/', '%2A', $res);
// %7E转换为~
$res = preg_replace('/%7E/', '~', $res);
return $res;
}
/**
* 阿里云请求参数组合
*
* @static
* @access private
*
* @param array $param 发送参数
*
* @return bool|string
*/
function getPostHttpBody($param)
{
// 空字符串
$str = "";
// 循环参数
foreach ( $param as $k => $v ) {
// 组合参数
$str .= $k . '=' . urlencode($v) . '&';
}
// 去除第一个&
return substr($str, 0, -1);
}
/* sms */
require __DIR__ . "/../../../lib/qcloudsms/src/index.php";
use Qcloud\Sms\SmsSingleSender;
use Qcloud\Sms\SmsMultiSender;
use Qcloud\Sms\SmsVoiceVerifyCodeSender;
use Qcloud\Sms\SmsVoicePromptSender;
use Qcloud\Sms\SmsStatusPuller;
use Qcloud\Sms\SmsMobileStatusPuller;
use Qcloud\Sms\VoiceFileUploader;
use Qcloud\Sms\FileVoiceSender;
use Qcloud\Sms\TtsVoiceSender;
function yimian__sms($to, $tpl, $msg1, $msg2, $msg3){
$msg = array();
if($tpl == 3) array_push($msg, $msg1, $msg2, $msg3);
else array_push($msg, $msg1, $msg2);
$appid = $GLOBALS['sms_appid'];
$appkey = $GLOBALS['sms_appkey'];
$smsSign = $GLOBALS['sms_smsSign'];
if($tpl == 1) $templateId = 287129; /*由于{1},本站{2}。给您带来不便深表歉意!*/
if($tpl == 2) $templateId = 300726; /*您好!您收到一条来自{1}的消息,内容是{2}。感谢您使用本站的服务!*/
if($tpl == 3) $templateId = 205311; /*您{1}的{2}为{3},请于5分钟内填写。如非本人操作,请忽略本短信。祝好!*/
if($tpl == 4) $templateId = 244004; /*{1}已解决,本站{2}服务已恢复!给您带来不便深表歉意!特此告知!*/
if($tpl == 5) $templateId = 300722; /*你好呀,你收到了一条来自访客{1}的评论,内容是{2}。感谢你使用本站的服务啦 ~*/
try {
$ssender = new SmsSingleSender($appid, $appkey);
$params = $msg;
$result = $ssender->sendWithParam("86", $to, $templateId,
$params, $smsSign, "", ""); /* 签名参数未提供或者为空时,会使用默认签名发送短信*/
$rsp = json_decode($result);
echo $result;
} catch(\Exception $e) {
echo var_dump($e);
}
}

@ -0,0 +1,142 @@
<?php
header('Access-Control-Allow-Origin:*');
/* anti ddos */
/*if(!isset($_COOKIE['_token__']) || $_COOKIE['_token__'] != md5(date('Y-m-d-H'))) {
setcookie("_token__",md5(date('Y-m-d-H')),time()+1*3600);
header("Location: https://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], true, 301);
}*/
require 'vendor/autoload.php';
include './functions.php';
header("Content-Type: application/json;charset=utf-8");
use Metowolf\Meting;
$API = new Meting('netease');
$type = $_REQUEST['type'];
$id = $_REQUEST['id'];
$random = $_REQUEST['random'];
$limit = $_REQUEST['limit'];
if($type == "url"){
if(!isset($id)){
echo json_encode(array("code"=>500, "err"=>"You need to provide an id!!"));
die();
}
$res = get_object_vars(json_decode($API->format(true)->url($id, 320)));
if(in_array("url", $res)){
echo json_encode(array("code"=>404, "err"=>"No Found!!"));
die();
}
$res['url'] = str_replace("http", "https", $res['url']);
log_api();
header("Location: ".$res['url']);
die();
}
if($type == "cover"){
if(!isset($id)){
echo json_encode(array("code"=>500, "err"=>"You need to provide an id!!"));
die();
}
$res = get_object_vars(json_decode($API->format(true)->pic($id)));
if(in_array("url", $res)){
echo json_encode(array("code"=>404, "err"=>"No Found!!"));
die();
}
log_api();
header("Location: ".$res["url"]);
die();
}
if($type == "lrc"){
if(!isset($id)){
echo json_encode(array("code"=>500, "err"=>"You need to provide an id!!"));
die();
}
$res = get_object_vars(json_decode($API->format(true)->lyric($id)));
if(in_array("lyric", $res)){
echo json_encode(array("code"=>404, "err"=>"No Found!!"));
die();
}
log_api();
header("Content-Type: text/plain;charset=utf-8");
echo $res["lyric"];
die();
}
if($type == "single"){
if(!isset($id)){
echo json_encode(array("code"=>500, "err"=>"You need to provide an id!!"));
die();
}
$content = get_object_vars(getSongInfo($id, $API)[0]);
//var_dump($content);
$o = array("id"=>$content["id"], "name"=>$content["name"], "artist"=>$content["artist"][0], "album"=>$content["album"], "url"=>"https://api.yimian.xyz/msc/?type=url&id=".$content["url_id"], "cover"=>"https://api.yimian.xyz/msc/?type=cover&id=".$content["pic_id"], "lrc"=>"https://api.yimian.xyz/msc/?type=lrc&id=".$content["lyric_id"]);
if(!$o){
echo json_encode(array("code"=>404, "err"=>"Cannot find any songs!!"));
die();
}
echo json_encode($o);
log_api();
die();
}
if($type == "playlist"){
/* 7.18 events */
//$id="2889727316";
if(!isset($id)){
echo json_encode(array("code"=>500, "err"=>"You need to provide an id!!"));
die();
}
$content = array();
$o = array();
foreach (getPlaylistInfo($id, $API) as $key => $value) {
$content = get_object_vars($value);
array_push($o, array("id"=>$content["id"], "name"=>$content["name"], "artist"=>$content["artist"][0], "album"=>$content["album"], "url"=>"https://api.yimian.xyz/msc/?type=url&id=".$content["url_id"], "cover"=>"https://api.yimian.xyz/msc/?type=cover&id=".$content["pic_id"], "lrc"=>"https://api.yimian.xyz/msc/?type=lrc&id=".$content["lyric_id"]));
}
if(!$o){
echo json_encode(array("code"=>404, "err"=>"Cannot find any songs!!"));
die();
}
if($random) shuffle($o);
if($limit) $o = array_slice($o, 0, $limit);
echo json_encode($o);
log_api();
die();
}
echo json_encode(array("code"=>500, "err"=>"Cannot find such type!!"));
function getSongInfo($id, $API){
return json_decode($API->format(true)->song($id));
}
function getPlaylistInfo($id, $API){
return json_decode($API->format(true)->playlist($id));
}
function log_api(){
yimian__log("log_api", array("api" => "msc", "timestamp" => date('Y-m-d H:i:s', time()), "ip" => ip2long(getIp()), "_from" => get_from(), "content" => $_SERVER["QUERY_STRING"]));
return;
}

@ -0,0 +1,58 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>音乐获取 API</title>
<meta name="theme-color" content="#fd4b5c">
<script src="https://cdn.yimian.xyz/ushio-js/ushio-head.min.js"></script>
</head>
<body>
<style type="text/css">h3:hover {box-shadow:0px 0px 8px #D1D1D1;}</style>
<div style="box-shadow: 5px 5px 25px 0 rgba(46,61,73,.2);border-radius:15px;font-size:13px;width:950px;font-family:微软雅黑,'Helvetica Neue',Arial,sans-serif;margin:10px auto 0px;border:0px solid #eee;max-width:100%;">
<div style="width:100%;background-color: #3174ed;background-image: linear-gradient(90deg, #3174ed 0%, #FA8BFF 35%, #3fd9fb 88%);color:#FFFFFF;border-radius:15px 15px 0 0;">
<h2 style="font-size:15px;word-break:break-all;padding:20px 32px;margin:0;text-align:center">音乐获取 - API</h2></div>
<div style="margin:0px auto;width:90%">
<h3 style="-webkit-transition: all .2s cubic-bezier(0, 0, 0, 0.48);-moz-transition: all .2s ease;border:.0625rem solid #fafafa;background:#fafafa repeating-linear-gradient(-45deg,#fff,#fff 1.125rem,transparent 1.125rem,transparent 2.25rem);margin:15px 0px;padding:20px;border-radius:5px;font-size:14px;color:#333;"># 音乐获取API请求方式 #
<ul>
<li>Method: GET/POST</li></ul>
<hr># 请求地址 #
<br/>
<a style="color:#fd4b5c;text-decoration:none;">https://api.yimian.xyz/msc</a>
<br/># 参数 # 【目前仅支持网易云音乐】
<br/>
<li>type (必填)//type=single单曲信息/playlist歌单歌曲信息/url获取歌曲/cover获取封面/lrc获取歌词</li>
<li>id (必填,搭配type使用) //id=198401123</li>
<li>random //random=true 仅对playlist有效,返回的歌曲是否打乱顺序,默认false</li>
<li>limit //limit=10 返回歌单最大长度</li>
<hr>
# 返回数据(Json格式) #<br/><br/>
<li> single模式: {id: "歌曲id", name: "歌曲名称", artist: "第一作者", album: "专辑名称", url: "单曲地址", cover: "封面地址", lrc: "歌词地址"}</li><br/>
<li> playlist模式: [{id: "歌曲id", name: "歌曲名称", artist: "第一作者", album: "专辑名称", url: "单曲地址", cover: "封面地址", lrc: "歌词地址"}, {歌曲2..}, {歌曲3..}]</li><br/>
<li> 错误: {code: 500, err: "错误信息"}</li>
<hr># 备注 #
<br/>更多用法参考
<a href="https://www.eee.dog/tech/rand-pic-api.html">https://www.eee.dog/tech/rand-pic-api.html</a>
<br/>
<hr># 示例 #
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/msc/?type=single&id=36308263</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/msc/?type=playlist&id=808097971</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/msc/?type=playlist&id=808097971&limit=14</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/msc/?type=playlist&id=808097971&limit=14&random=true</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/msc/?type=url&id=36308263</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/msc/?type=cover&id=3384296792803059</a>
<br/>
<a style="color:#fd4b5c;text-decoration:none;" target="_blank">https://api.yimian.xyz/msc/?type=lrc&id=36308263</a></h3>
</div>
</div>
</body>
<script src="https://cdn.yimian.xyz/ushio-js/ushio-footer.min.js"></script>
</html>

@ -0,0 +1,7 @@
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit7bd602fdce79cdf3c88e3cdb52a761f5::getLoader();

@ -0,0 +1,445 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
// PSR-4
private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
private $fallbackDirsPsr4 = array();
// PSR-0
private $prefixesPsr0 = array();
private $fallbackDirsPsr0 = array();
private $useIncludePath = false;
private $classMap = array();
private $classMapAuthoritative = false;
private $missingClasses = array();
private $apcuPrefix;
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0);
}
return array();
}
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
}
/**
* Unregisters this instance as an autoloader.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return bool|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*/
function includeFile($file)
{
include $file;
}

@ -0,0 +1,21 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

@ -0,0 +1,9 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

@ -0,0 +1,10 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Metowolf\\' => array($vendorDir . '/metowolf/meting/src'),
);

@ -0,0 +1,52 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit7bd602fdce79cdf3c88e3cdb52a761f5
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit7bd602fdce79cdf3c88e3cdb52a761f5', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit7bd602fdce79cdf3c88e3cdb52a761f5', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit7bd602fdce79cdf3c88e3cdb52a761f5::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
return $loader;
}
}

@ -0,0 +1,31 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit7bd602fdce79cdf3c88e3cdb52a761f5
{
public static $prefixLengthsPsr4 = array (
'M' =>
array (
'Metowolf\\' => 9,
),
);
public static $prefixDirsPsr4 = array (
'Metowolf\\' =>
array (
0 => __DIR__ . '/..' . '/metowolf/meting/src',
),
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit7bd602fdce79cdf3c88e3cdb52a761f5::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit7bd602fdce79cdf3c88e3cdb52a761f5::$prefixDirsPsr4;
}, null, ClassLoader::class);
}
}

@ -0,0 +1,54 @@
[
{
"name": "metowolf/meting",
"version": "v1.5.7",
"version_normalized": "1.5.7.0",
"source": {
"type": "git",
"url": "https://github.com/metowolf/Meting.git",
"reference": "54178aa112da5db09f487d862d7ae62cbf7bc060"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/metowolf/Meting/zipball/54178aa112da5db09f487d862d7ae62cbf7bc060",
"reference": "54178aa112da5db09f487d862d7ae62cbf7bc060",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-openssl": "*",
"php": ">=5.4.0"
},
"suggest": {
"ext-bcmath": "Required to use BC Math calculate RSA.",
"ext-openssl": "Required to use OpenSSL encrypt params."
},
"time": "2019-06-16T05:55:00+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Metowolf\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "metowolf",
"email": "i@i-meto.com",
"homepage": "https://i-meto.com"
}
],
"description": "A powerful music API framework to accelerate development.",
"homepage": "https://github.com/metowolf/Meting",
"keywords": [
"lightweight",
"lighty",
"music api",
"php music"
]
}
]

@ -0,0 +1,24 @@
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.yml]
indent_style = space
indent_size = 2
[*.php]
indent_style = space
indent_size = 4
[*.sh]
indent_style = space
indent_size = 4

@ -0,0 +1,3 @@
vendor/
composer.lock
.idea/

@ -0,0 +1,28 @@
language: php
matrix:
fast_finish: true
include:
- php: '5.4'
- php: '5.5'
- php: '5.6'
- php: '7.0'
- php: '7.1'
- php: '7.2'
- php: '7.3'
- php: 'nightly'
- php: 'hhvm'
allow_failures:
- php: '5.4'
- php: '5.5'
- php: '5.6'
- php: '7.0'
- php: 'nightly'
- php: 'hhvm'
sudo: false
script:
- find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 METO <i@i-meto.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

@ -0,0 +1,92 @@
<p align="center">
<img src="https://user-images.githubusercontent.com/2666735/30165599-36623bea-93a6-11e7-8956-1ddf99ce0e6f.png" alt="Meting">
</p>
<p align="center">
<a href="https://i-meto.com"><img alt="Author" src="https://img.shields.io/badge/Author-METO-blue.svg?style=flat-square"/></a>
<a href="https://packagist.org/packages/metowolf/Meting"><img alt="Version" src="https://img.shields.io/packagist/v/metowolf/Meting.svg?style=flat-square"/></a>
<a href="https://packagist.org/packages/metowolf/meting/stats"><img alt="Downloads" src="https://img.shields.io/packagist/dt/metowolf/Meting.svg?style=flat-square"/></a>
<a href="https://travis-ci.org/metowolf/Meting"><img alt="Travis" src="https://img.shields.io/travis/metowolf/Meting.svg?style=flat-square"></a>
<img alt="License" src="https://img.shields.io/packagist/l/metowolf/Meting.svg?style=flat-square"/>
</p>
> :cake: 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 46KB.
+ **Powerful** - Support various music platforms, including Tencent, NetEase, Xiami, KuGou, Baidu 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](https://getcomposer.org), in the root directory of your project.
```bash
$ composer require metowolf/meting
```
Then you can import the class into your application:
```php
use Metowolf\Meting;
$api = new Meting('netease');
$data = $api->format(true)->search('Soldier');
```
> **Note:** Meting requires [BCMath](http://php.net/manual/en/book.bc.php), [cURL](http://php.net/manual/en/book.curl.php) and [OpenSSL](http://php.net/manual/en/book.openssl.php) extension in order to work.
## Quick Start
```php
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
- [docs](https://github.com/metowolf/Meting/wiki)
- [special for netease](https://github.com/metowolf/Meting/wiki/special-for-netease)
## Join the Discussion
- [Telegram Group](https://t.me/adplayer)
- [Official website](https://i-meto.com)
## Related Projects
- [Hermit-X (Wordpress)](https://github.com/MoePlayer/Hermit-X)
- [APlayer-Typecho](https://github.com/MoePlayer/APlayer-Typecho)
- [MKOnlineMusicPlayer](https://github.com/mengkunsoft/MKOnlineMusicPlayer)
- [WP-Player](https://github.com/webjyh/WP-Player)
## Author
**Meting** © [metowolf](https://github.com/metowolf), Released under the [MIT](./LICENSE) License.<br>
> Blog [@meto](https://i-meto.com) · GitHub [@metowolf](https://github.com/metowolf) · Twitter [@metowolf](https://twitter.com/metowolf) · Telegram Channel [@metooooo](https://t.me/metooooo)

@ -0,0 +1,38 @@
{
"name": "metowolf/meting",
"type": "library",
"description": "A powerful music API framework to accelerate development.",
"keywords": [
"php music",
"music api",
"lighty",
"lightweight"
],
"homepage": "https://github.com/metowolf/Meting",
"license": "MIT",
"authors": [
{
"name": "metowolf",
"email": "i@i-meto.com",
"homepage": "https://i-meto.com"
}
],
"support": {
"issues": "https://github.com/metowolf/Meting/issues",
"source": "https://github.com/metowolf/Meting"
},
"require": {
"php": ">=5.4.0",
"ext-curl": "*",
"ext-openssl": "*"
},
"suggest": {
"ext-bcmath": "Required to use BC Math calculate RSA.",
"ext-openssl": "Required to use OpenSSL encrypt params."
},
"autoload": {
"psr-4": {
"Metowolf\\" : "src/"
}
}
}

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save