don't try to parse deviant art urls that lack a deviation id in the url
This commit is contained in:
@@ -91,7 +91,7 @@ module Sources
|
||||
# work isn't downloadable, or download size is same as regular size.
|
||||
elsif api_deviation.present?
|
||||
src = api_deviation.dig(:content, :src)
|
||||
if deviation_id.to_i <= 790677560 && src =~ /^https:\/\/images-wixmp-/
|
||||
if deviation_id && deviation_id.to_i <= 790677560 && src =~ /^https:\/\/images-wixmp-/
|
||||
src = src.sub(%r!(/f/[a-f0-9-]+/[a-f0-9-]+)!, '/intermediary\1')
|
||||
src = src.sub(%r!/v1/(fit|fill)/.*\z!i, "")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user