Deviantart: Fix full-size image not always being uploaded

This commit is contained in:
Toks
2015-07-08 00:58:06 -04:00
parent 67e46f6e5c
commit 3c92a58585

View File

@@ -47,15 +47,15 @@ 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") download_link = page.link_with(:class => /dev-page-download/)
if image.any? if download_link
image[0]["src"] 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 else
download_link = page.link_with(:class => /dev-page-download/) image = page.search("div.dev-view-deviation img.dev-content-full")
if download_link if image.any?
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. image[0]["src"]
else else
nil nil
end end