debug
This commit is contained in:
@@ -74,6 +74,26 @@ class Scheduler
|
||||
*/
|
||||
public function crawlFull()
|
||||
{
|
||||
$Site = $this->getSite();
|
||||
$arrVSourceId = [];
|
||||
|
||||
$arrVSourceId[] = ['v_source_id' => 66281];
|
||||
|
||||
|
||||
$arrAllVideoInfoPage = $Site->getVideoInfoPageList($arrVSourceId);
|
||||
foreach ($arrAllVideoInfoPage as $VideoInfoPage) {
|
||||
$arrVideo = $VideoInfoPage->getVideo();
|
||||
print_r($arrVideo);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$intLimit = 10;
|
||||
|
||||
$Site = $this->getSite();
|
||||
@@ -91,32 +111,37 @@ class Scheduler
|
||||
];
|
||||
|
||||
$arrVideoPageList = $Site->getVideoPageList($arrFilter);
|
||||
$arrVideoPager = $arrVideoPageList[0]->getVideoPager();
|
||||
|
||||
foreach ($arrVideoPageList as $VideoPage) {
|
||||
$arrAllVideoPager = $VideoPage->getVideoPager();
|
||||
$arrVSourceId = [];
|
||||
|
||||
$arrVSourceId = [];
|
||||
foreach ($arrAllVideoPager['list'] as $arrVideoPager) {
|
||||
$arrVSourceId[] = ['v_source_id' => (int)$arrVideoPager['vod_id']];
|
||||
}
|
||||
|
||||
$arrAllVideoInfoPage = $Site->getVideoInfoPageList($arrVSourceId);
|
||||
foreach ($arrAllVideoInfoPage as $VideoInfoPage) {
|
||||
$arrVideo = $VideoInfoPage->getVideo();
|
||||
print_r($arrVideo);
|
||||
}
|
||||
foreach ($arrVideoPager['list'] as $arrVideoPager) {
|
||||
$arrVSourceId[] = ['v_source_id' => (int)$arrVideoPager['vod_id']];
|
||||
}
|
||||
|
||||
$arrAllVideoInfoPage = $Site->getVideoInfoPageList($arrVSourceId);
|
||||
foreach ($arrAllVideoInfoPage as $VideoInfoPage) {
|
||||
$arrVideo = $VideoInfoPage->getVideo();
|
||||
print_r($arrVideo);
|
||||
}
|
||||
|
||||
|
||||
// foreach ($arrVideoPageList as $VideoPage) {
|
||||
// $arrAllVideoPager = $VideoPage->getVideoPager();
|
||||
|
||||
// $arrVSourceId = [];
|
||||
// foreach ($arrAllVideoPager['list'] as $arrVideoPager) {
|
||||
// $arrVSourceId[] = ['v_source_id' => (int)$arrVideoPager['vod_id']];
|
||||
// }
|
||||
|
||||
// $arrAllVideoInfoPage = $Site->getVideoInfoPageList($arrVSourceId);
|
||||
// foreach ($arrAllVideoInfoPage as $VideoInfoPage) {
|
||||
// $arrVideo = $VideoInfoPage->getVideo();
|
||||
// print_r($arrVideo);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$arrCover = [];
|
||||
|
||||
|
||||
if ($arrCover) {
|
||||
// $Site->downRemoteImgToLocal($arrCover);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,18 +68,8 @@ class Site
|
||||
],
|
||||
'headers' => [
|
||||
'User-Agent' => 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36',
|
||||
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
|
||||
'Accept-Language' => 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
|
||||
'Referer' => $this->strDomain,
|
||||
'Connection' => 'keep-alive',
|
||||
'sec-ch-ua' => '"Not/A)Brand";v="8", "Chromium";v="130", "Google Chrome";v="130"',
|
||||
'sec-ch-ua-mobile' => '?1',
|
||||
'sec-ch-ua-platform' => '"Android"',
|
||||
'sec-fetch-dest' => 'document',
|
||||
'sec-fetch-mode' => 'navigate',
|
||||
'sec-fetch-site' => 'same-origin',
|
||||
'sec-fetch-user' => '?1',
|
||||
'upgrade-insecure-requests' => '1',
|
||||
],
|
||||
'pool_size' => 20,
|
||||
'verify' => false,
|
||||
@@ -261,7 +251,7 @@ class Site
|
||||
*/
|
||||
public function getVideoUri(int $intVSourceId): string
|
||||
{
|
||||
return sprintf('/inc/api_mac10.php?ac=detail&tds=%s', $intVSourceId);
|
||||
return sprintf('/inc/api_mac10.php?ac=detail&ids=%s', $intVSourceId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -279,17 +269,12 @@ class Site
|
||||
$arrPromises = [];
|
||||
foreach ($arrFilter as $intKey => $arrItem) {
|
||||
$arrFilter[$intKey]['uri'] = $this->getVideoUri($arrItem['v_source_id']);
|
||||
$arrPromises[$intKey] = $arrFilter[$intKey]['uri'];
|
||||
|
||||
$arrPromises[$intKey] = $this->getClient()->getAsync($arrFilter[$intKey]['uri']);
|
||||
}
|
||||
|
||||
print_r($arrFilter);
|
||||
|
||||
$arrResults = Promise\Utils::settle($arrPromises)->wait();
|
||||
|
||||
|
||||
var_dump($arrResults);
|
||||
return [];
|
||||
|
||||
$arrSuccessfulResults = array_filter($arrResults, function ($arrResult) {
|
||||
return $arrResult['state'] === 'fulfilled';
|
||||
});
|
||||
@@ -297,8 +282,6 @@ class Site
|
||||
foreach ($arrSuccessfulResults as $intKey => $arrResult) {
|
||||
$Response = $arrResult['value'];
|
||||
|
||||
var_dump($arrResult);
|
||||
|
||||
$strContent = $Response->getBody()->getContents();;
|
||||
|
||||
$VideoInfoPage = $this->getVideoInfoPage($this, $arrFilter[$intKey]['uri']);
|
||||
|
||||
@@ -44,7 +44,7 @@ class VideoInfoPage extends BasePage
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
/**
|
||||
* Undocumented function
|
||||
*
|
||||
* @return array
|
||||
@@ -54,6 +54,16 @@ class VideoInfoPage extends BasePage
|
||||
if (empty($this->arrVideo)) {
|
||||
|
||||
$this->arrVideo = json_decode($this->getContent(), true);
|
||||
$this->arrVideo = $this->arrVideo['list'][0];
|
||||
$this->arrVideo['vod_play_url'] = str_replace('#', '$', $this->arrVideo['vod_play_url']);
|
||||
$this->arrVideo['vod_play_url'] = explode('$', $this->arrVideo['vod_play_url']);
|
||||
$this->arrVideo['vod_play_url'] = array_chunk($this->arrVideo['vod_play_url'], 2);
|
||||
foreach ($this->arrVideo['vod_play_url'] as $intKey => $arrVal) {
|
||||
$this->arrVideo['vod_play_url'][$intKey] = [
|
||||
'name' => $arrVal[0],
|
||||
'url' => $arrVal[1],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->arrVideo;
|
||||
|
||||
Reference in New Issue
Block a user