[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;
|
||||
|
||||
for($page = 1; $page <= $lastpage; $page++) {
|
||||
$link = self::URI . '/' . $category . '/page/' . $page;
|
||||
$link = self::URI . $category . '/page/' . $page;
|
||||
$html = getSimpleHTMLDOM($link)
|
||||
or returnServerError('No results for this query.');
|
||||
|
||||
|
@ -41,13 +41,16 @@ class HDWallpapersBridge extends BridgeAbstract {
|
|||
$lastpage = min($matches[1], ceil($max / 14));
|
||||
}
|
||||
|
||||
$html = defaultLinkTo($html, self::URI);
|
||||
|
||||
foreach($html->find('.wallpapers .wall a') as $element) {
|
||||
$thumbnail = $element->find('img', 0);
|
||||
|
||||
$search = array(self::URI, 'wallpapers.html');
|
||||
$replace = array(self::URI . 'download/', $this->getInput('r') . '.jpg');
|
||||
|
||||
$item = array();
|
||||
$item['uri'] = self::URI
|
||||
. '/download'
|
||||
. str_replace('wallpapers.html', $this->getInput('r') . '.jpg', $element->href);
|
||||
$item['uri'] = str_replace($search, $replace, $element->href);
|
||||
|
||||
$item['timestamp'] = time();
|
||||
$item['title'] = $element->find('em1', 0)->text();
|
||||
|
@ -55,7 +58,6 @@ class HDWallpapersBridge extends BridgeAbstract {
|
|||
. '<br><a href="'
|
||||
. $item['uri']
|
||||
. '"><img src="'
|
||||
. self::URI
|
||||
. $thumbnail->src
|
||||
. '" /></a>';
|
||||
|
||||
|
|
Loading…
Reference in a new issue