[HDWallpapersBridge] Fix URLs (#1892)
This commit is contained in:
parent
21798e8228
commit
3aae00b56a
1 changed files with 7 additions and 5 deletions
|
@ -32,7 +32,7 @@ class HDWallpapersBridge extends BridgeAbstract {
|
||||||
$lastpage = 1;
|
$lastpage = 1;
|
||||||
|
|
||||||
for($page = 1; $page <= $lastpage; $page++) {
|
for($page = 1; $page <= $lastpage; $page++) {
|
||||||
$link = self::URI . '/' . $category . '/page/' . $page;
|
$link = self::URI . $category . '/page/' . $page;
|
||||||
$html = getSimpleHTMLDOM($link)
|
$html = getSimpleHTMLDOM($link)
|
||||||
or returnServerError('No results for this query.');
|
or returnServerError('No results for this query.');
|
||||||
|
|
||||||
|
@ -41,13 +41,16 @@ class HDWallpapersBridge extends BridgeAbstract {
|
||||||
$lastpage = min($matches[1], ceil($max / 14));
|
$lastpage = min($matches[1], ceil($max / 14));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$html = defaultLinkTo($html, self::URI);
|
||||||
|
|
||||||
foreach($html->find('.wallpapers .wall a') as $element) {
|
foreach($html->find('.wallpapers .wall a') as $element) {
|
||||||
$thumbnail = $element->find('img', 0);
|
$thumbnail = $element->find('img', 0);
|
||||||
|
|
||||||
|
$search = array(self::URI, 'wallpapers.html');
|
||||||
|
$replace = array(self::URI . 'download/', $this->getInput('r') . '.jpg');
|
||||||
|
|
||||||
$item = array();
|
$item = array();
|
||||||
$item['uri'] = self::URI
|
$item['uri'] = str_replace($search, $replace, $element->href);
|
||||||
. '/download'
|
|
||||||
. str_replace('wallpapers.html', $this->getInput('r') . '.jpg', $element->href);
|
|
||||||
|
|
||||||
$item['timestamp'] = time();
|
$item['timestamp'] = time();
|
||||||
$item['title'] = $element->find('em1', 0)->text();
|
$item['title'] = $element->find('em1', 0)->text();
|
||||||
|
@ -55,7 +58,6 @@ class HDWallpapersBridge extends BridgeAbstract {
|
||||||
. '<br><a href="'
|
. '<br><a href="'
|
||||||
. $item['uri']
|
. $item['uri']
|
||||||
. '"><img src="'
|
. '"><img src="'
|
||||||
. self::URI
|
|
||||||
. $thumbnail->src
|
. $thumbnail->src
|
||||||
. '" /></a>';
|
. '" /></a>';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue