mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-01 06:14:56 +03:00
[ZoneTelechargement] Change URL load method (#2044)
This commit is contained in:
parent
5966cc0a9c
commit
3423b3bbe1
1 changed files with 15 additions and 7 deletions
|
@ -34,19 +34,28 @@ class ZoneTelechargementBridge extends BridgeAbstract {
|
||||||
);
|
);
|
||||||
|
|
||||||
// This is an URL that is not protected by robot protection for Direct Download
|
// This is an URL that is not protected by robot protection for Direct Download
|
||||||
const UNPROTECTED_URI = 'https://www.zone-telechargement.net/';
|
const UNPROTECTED_URI = 'https://www.zt-za.com/';
|
||||||
|
|
||||||
// This is an URL that is not protected by robot protection for Streaming Links
|
// This is an URL that is not protected by robot protection for Streaming Links
|
||||||
const UNPROTECTED_URI_STREAMING = 'https://zone-telechargement.stream/';
|
const UNPROTECTED_URI_STREAMING = 'https://zone-telechargement.stream/';
|
||||||
|
|
||||||
public function getIcon() {
|
// This function use curl library with curl as User Agent instead of
|
||||||
|
// simple_html_dom to load the HTML content as the website has some captcha
|
||||||
|
// request for other user agents
|
||||||
|
private function loadURL($url){
|
||||||
|
$header = array();
|
||||||
|
$opts = array(CURLOPT_USERAGENT => 'curl/7.64.0');
|
||||||
|
$html = getContents($url, $header, $opts)
|
||||||
|
or returnServerError('Could not request Zone Telechargement.');
|
||||||
|
return str_get_html($html);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIcon(){
|
||||||
return self::UNPROTECTED_URI . '/templates/Default/images/favicon.ico';
|
return self::UNPROTECTED_URI . '/templates/Default/images/favicon.ico';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function collectData(){
|
public function collectData(){
|
||||||
$html = getSimpleHTMLDOM(self::UNPROTECTED_URI . $this->getInput('url'))
|
$html = $this->loadURL(self::UNPROTECTED_URI . $this->getInput('url'));
|
||||||
or returnServerError('Could not request Zone Telechargement.');
|
|
||||||
|
|
||||||
$filter = $this->getInput('filter');
|
$filter = $this->getInput('filter');
|
||||||
|
|
||||||
// Get the TV show title
|
// Get the TV show title
|
||||||
|
@ -79,8 +88,7 @@ class ZoneTelechargementBridge extends BridgeAbstract {
|
||||||
// Handle the Streaming links
|
// Handle the Streaming links
|
||||||
if($filter == 'both' || $filter == 'streaming') {
|
if($filter == 'both' || $filter == 'streaming') {
|
||||||
// Get the post content, on the dedicated streaming website
|
// Get the post content, on the dedicated streaming website
|
||||||
$htmlstreaming = getSimpleHTMLDOM(self::UNPROTECTED_URI_STREAMING . $this->getInput('url'))
|
$htmlstreaming = $this->loadURL(self::UNPROTECTED_URI_STREAMING . $this->getInput('url'));
|
||||||
or returnServerError('Could not request Zone Telechargement.');
|
|
||||||
// Get the HTML element containing all the links
|
// Get the HTML element containing all the links
|
||||||
$streaminglinkshtml = $htmlstreaming->find('p[style=background-color: #FECC00;]', 1)->parent()->next_sibling();
|
$streaminglinkshtml = $htmlstreaming->find('p[style=background-color: #FECC00;]', 1)->parent()->next_sibling();
|
||||||
// Get all streaming Links
|
// Get all streaming Links
|
||||||
|
|
Loading…
Add table
Reference in a new issue