新增聆音的一个小功能

This commit is contained in:
iyuu.cn
2019-12-27 19:49:37 +08:00
parent 3c880ea5ee
commit 9e688e86d2
3 changed files with 18 additions and 5 deletions

View File

@@ -342,5 +342,6 @@ class Rpc
} }
} }
} }
return true;
} }
} }

View File

@@ -87,7 +87,7 @@ class Soulvoice implements decodeBase
* @param string * @param string
* @return array * @return array
*/ */
public static function run($url = 'torrents.php') public static function run($url = 'torrents.php', $type = true)
{ {
self::init(); self::init();
Rpc::init(self::SITE, self::METHOD); Rpc::init(self::SITE, self::METHOD);
@@ -95,10 +95,9 @@ class Soulvoice implements decodeBase
if ( $html === null ) { if ( $html === null ) {
exit(1); exit(1);
} }
$data = self::decode($html); $data = self::decode($html, $type);
#p($data);exit; #p($data);exit;
Rpc::call($data); Rpc::call($data);
exit(0);
} }
/** /**
@@ -126,7 +125,7 @@ class Soulvoice implements decodeBase
* @param array $data * @param array $data
* @return array * @return array
*/ */
public static function decode($data = array()) public static function decode($data = array(), $type = true)
{ {
$downloadStrLen = strlen(self::downloadPrefix); // 前缀长度 $downloadStrLen = strlen(self::downloadPrefix); // 前缀长度
$downloadStrEnd = '"'; //种子地址结束标志 $downloadStrEnd = '"'; //种子地址结束标志
@@ -179,7 +178,7 @@ class Soulvoice implements decodeBase
// 种子促销类型解码 // 种子促销类型解码
if(strpos($v,self::$getTorrent[0]) === false){ if(strpos($v,self::$getTorrent[0]) === false){
// 不免费 // 不免费
self::$TorrentList[$k]['type'] = 1; self::$TorrentList[$k]['type'] = $type ? 1 : 0;
}else{ }else{
// 免费种子 // 免费种子
self::$TorrentList[$k]['type'] = 0; self::$TorrentList[$k]['type'] = 0;

13
app/ly.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
/**
* 作用添加聆音阅听专区30页小包方便大家赚魔力
* 使用方法:放入/app/ 目录下即可。
*/
require_once __DIR__ . '/init.php';
$start = 0;
$end = 30;
$url = 'live.php?inclbookmarked=0&incldead=1&spstate=0&&sort=5&type=asc&page={}';
while ($start <= $end) {
soulvoice::run(str_replace('{}', $start, $url), false);
$start++;
}