deviantart: fix non-downloadable flash files
This commit is contained in:
@@ -88,6 +88,8 @@ module Sources
|
|||||||
url
|
url
|
||||||
elsif api_deviation[:is_downloadable]
|
elsif api_deviation[:is_downloadable]
|
||||||
api_download[:src]
|
api_download[:src]
|
||||||
|
elsif api_deviation[:flash].present?
|
||||||
|
api_deviation.dig(:flash, :src)
|
||||||
else
|
else
|
||||||
src = api_deviation.dig(:content, :src)
|
src = api_deviation.dig(:content, :src)
|
||||||
if deviation_id && deviation_id.to_i <= 790677560 && src =~ /^https:\/\/images-wixmp-/ && src !~ /\.gif\?/
|
if deviation_id && deviation_id.to_i <= 790677560 && src =~ /^https:\/\/images-wixmp-/ && src !~ /\.gif\?/
|
||||||
|
|||||||
@@ -254,6 +254,16 @@ module Sources
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "The source for a non-downloadable flash file" do
|
||||||
|
should "return working image url" do
|
||||||
|
@site = Sources::Strategies.find("https://www.deviantart.com/heartgear/art/SL-40v3-522007633")
|
||||||
|
|
||||||
|
# md5: 6adf1a3d532f898f44cf9948cbc7db7d
|
||||||
|
assert_match(%r!\Ahttps://api-da\.wixmp\.com/_api/download/file\?downloadToken=!, @site.image_url)
|
||||||
|
assert_downloaded(3_496_110, @site.image_url)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "The source for an DeviantArt artwork page" do
|
context "The source for an DeviantArt artwork page" do
|
||||||
setup do
|
setup do
|
||||||
@site = Sources::Strategies.find("http://noizave.deviantart.com/art/test-post-please-ignore-685436408")
|
@site = Sources::Strategies.find("http://noizave.deviantart.com/art/test-post-please-ignore-685436408")
|
||||||
|
|||||||
Reference in New Issue
Block a user