Improve getting deviatnart url from page

fix #2366
This commit is contained in:
Toks
2015-04-06 18:32:12 -04:00
parent 2d99501f91
commit 4b36acdd19

View File

@@ -47,6 +47,11 @@ module Sources
end end
def get_image_url_from_page(page) def get_image_url_from_page(page)
image = page.search("div.dev-view-deviation img.dev-content-full")
if image.any?
image[0]["src"]
else
download_link = page.link_with(:class => /dev-page-download/) download_link = page.link_with(:class => /dev-page-download/)
if download_link if download_link
@@ -55,6 +60,7 @@ module Sources
nil nil
end end
end end
end
def normalized_url def normalized_url
@normalized_url ||= begin @normalized_url ||= begin