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,12 +47,18 @@ module Sources
end
def get_image_url_from_page(page)
download_link = page.link_with(:class => /dev-page-download/)
image = page.search("div.dev-view-deviation img.dev-content-full")
if download_link
download_link.click.uri.to_s # need to follow the redirect now to get the full size url, following it later seems to not work.
if image.any?
image[0]["src"]
else
nil
download_link = page.link_with(:class => /dev-page-download/)
if download_link
download_link.click.uri.to_s # need to follow the redirect now to get the full size url, following it later seems to not work.
else
nil
end
end
end