mirror of
https://github.com/hakasenyang/tvple-php
synced 2026-08-22 04:53:07 +09:00
Bug fixed
This commit is contained in:
+9
-28
@@ -6,11 +6,7 @@
|
|||||||
* https://hakase.kr/
|
* https://hakase.kr/
|
||||||
*/
|
*/
|
||||||
class Tvple {
|
class Tvple {
|
||||||
private $httph = 'Mozilla/5.0';
|
private $httph = 'DEXT5U5928d310';
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
ob_start();
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* [splits description]
|
* [splits description]
|
||||||
* @param [type] $data [description]
|
* @param [type] $data [description]
|
||||||
@@ -35,10 +31,6 @@
|
|||||||
}
|
}
|
||||||
private function WEBParsing($url,$bodychk=false,$paramType="GET",$param="",$cookie="")
|
private function WEBParsing($url,$bodychk=false,$paramType="GET",$param="",$cookie="")
|
||||||
{
|
{
|
||||||
$uri = parse_url($url);
|
|
||||||
$paramType = strtoupper($paramType);
|
|
||||||
if (!$uri['port']) $uri['port'] = 80;
|
|
||||||
if (!$uri['path']) $uri['path'] = "/";
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
$opts = array(CURLOPT_RETURNTRANSFER => true,
|
$opts = array(CURLOPT_RETURNTRANSFER => true,
|
||||||
CURLOPT_URL => $url,
|
CURLOPT_URL => $url,
|
||||||
@@ -67,10 +59,6 @@
|
|||||||
}
|
}
|
||||||
private function Download($url,$range=0)
|
private function Download($url,$range=0)
|
||||||
{
|
{
|
||||||
$uri = parse_url($url);
|
|
||||||
$paramType = strtoupper($paramType);
|
|
||||||
if (!$uri['port']) $uri['port'] = 80;
|
|
||||||
if (!$uri['path']) $uri['path'] = "/";
|
|
||||||
$ch = curl_init();
|
$ch = curl_init();
|
||||||
$opts = array(CURLOPT_RETURNTRANSFER => true,
|
$opts = array(CURLOPT_RETURNTRANSFER => true,
|
||||||
CURLOPT_URL => $url,
|
CURLOPT_URL => $url,
|
||||||
@@ -93,23 +81,17 @@
|
|||||||
$link = abs(intval($link));
|
$link = abs(intval($link));
|
||||||
if(!is_numeric($link)) exit;
|
if(!is_numeric($link)) exit;
|
||||||
$data = $this->WEBParsing('http://tvple.com/'.$link);
|
$data = $this->WEBParsing('http://tvple.com/'.$link);
|
||||||
|
$data = $this->WEBParsing('http://tvple.com/'.$this->splits($data, '<a href="/', '"'));
|
||||||
|
|
||||||
$name = htmlspecialchars_decode($this->splits($data, '"og:title" content="','"'));
|
$name = htmlspecialchars_decode($this->splits($data, '"og:title" content="','"'));
|
||||||
|
|
||||||
$api = $this->splits($data,'data-meta="','"');
|
$api = $this->splits($data,'data-meta="','"');
|
||||||
$data = $this->WEBParsing($api);
|
$data = $this->WEBParsing($api);
|
||||||
$url = $this->splits($data,'"mp4_avc": "','"');
|
$link = $this->splits($data,'"mp4_avc": "','"');
|
||||||
|
|
||||||
if(!$url) return false;
|
if(!$link) return false;
|
||||||
$data = $this->WEBParsing($url,true);
|
|
||||||
// 2016-02-28 수정
|
// 2016-02-28 수정
|
||||||
// FULL URL
|
$data = $this->WEBParsing($link,true);
|
||||||
while(strpos($data, 'HTTP/1.1 200 OK') === false)
|
|
||||||
{
|
|
||||||
$url = $this->splits($data,'Location: ',PHP_EOL);
|
|
||||||
$data = $this->WEBParsing($url,true);
|
|
||||||
}
|
|
||||||
$data = $this->WEBParsing($url,true);
|
|
||||||
|
|
||||||
$size = $length = $this->splits($data, 'Content-Length: ', PHP_EOL);
|
$size = $length = $this->splits($data, 'Content-Length: ', PHP_EOL);
|
||||||
|
|
||||||
$start = 0; // Start byte
|
$start = 0; // Start byte
|
||||||
@@ -154,12 +136,11 @@
|
|||||||
header('Content-Disposition: filename="'.$filename.'"');
|
header('Content-Disposition: filename="'.$filename.'"');
|
||||||
|
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
ob_flush();
|
ob_start();
|
||||||
flush();
|
|
||||||
if ($rangeok)
|
if ($rangeok)
|
||||||
$this->Download($url,$start.'-'.$end);
|
$this->Download($link,$start.'-'.$end);
|
||||||
else
|
else
|
||||||
$this->Download($url);
|
$this->Download($link);
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,8 @@
|
|||||||
if($url) {
|
if($url) {
|
||||||
$tvpleurl = 'http://tvple.com/';
|
$tvpleurl = 'http://tvple.com/';
|
||||||
if(substr($url,0,strlen($tvpleurl)) == $tvpleurl) $url = substr($url, strpos($url, $tvpleurl) + strlen($tvpleurl));
|
if(substr($url,0,strlen($tvpleurl)) == $tvpleurl) $url = substr($url, strpos($url, $tvpleurl) + strlen($tvpleurl));
|
||||||
|
$pos = strpos($url, '/');
|
||||||
|
if($pos) $url = substr($url, $pos + 1);
|
||||||
if(!is_numeric($url)) echo 'Error... (URL Error)';
|
if(!is_numeric($url)) echo 'Error... (URL Error)';
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -21,6 +23,7 @@
|
|||||||
--주소 형식--<br>
|
--주소 형식--<br>
|
||||||
ex1) http://tvple.com/1234<br>
|
ex1) http://tvple.com/1234<br>
|
||||||
ex2) 1234<br>
|
ex2) 1234<br>
|
||||||
|
ex3) http://tvple.com/other/1234<br>
|
||||||
<label><input type="radio" name="s" value="0" checked>다운로드</label><label><input type="radio" name="s" value="1">스트리밍</label><br>
|
<label><input type="radio" name="s" value="0" checked>다운로드</label><label><input type="radio" name="s" value="1">스트리밍</label><br>
|
||||||
<a href='https://noref.tk/?http://tvple.com/' target='_blank'>티비플 접속해서 주소 가져오기</a><br>
|
<a href='https://noref.tk/?http://tvple.com/' target='_blank'>티비플 접속해서 주소 가져오기</a><br>
|
||||||
<input type="submit" value="전송"><br><br>
|
<input type="submit" value="전송"><br><br>
|
||||||
|
|||||||
Reference in New Issue
Block a user