src/Wallhaven/Wallpaper.php
public function getImageUrl($assumeJpg = false)
    {
        if ($assumeJpg) {
            return Wallhaven::URL_IMG_PREFIX . $this->id . '.jpg';
        }

        if (!$this->cacheEnabled || $this->imageUrl === null) {
            $dom = $this->getDom();
            $url = $dom->find('img#wallpaper')[0]->getAttribute('src');
            $this->imageUrl = (parse_url($url, PHP_URL_SCHEME) ?: "https:") . $url;
        }

        return $this->imageUrl;
    }
public function getImageUrl($assumeJpg = false)
    {
        if ($assumeJpg) {
            return Wallhaven::URL_IMG_PREFIX . $this->id . '.jpg';
        }

        if (!$this->cacheEnabled || $this->imageUrl === null) {
            $dom = $this->getDom();
            $url = $dom->find('img#wallpaper')[0]->getAttribute('src');
            $this->imageUrl = (parse_url($url, PHP_URL_SCHEME) ?: "https:") . $url;
        }

        return $this->imageUrl;
    }
@param bool $assumeJpg Assume the wallpaper is JPG. May speed up the method at the cost of potentially wrong URL.

@return string URL.
@throws LoginException
@throws NotFoundException