resize medium + small artstation urls also
This commit is contained in:
@@ -3,7 +3,7 @@ module Downloads
|
||||
class ArtStation < Base
|
||||
def rewrite(url, headers, data = {})
|
||||
# example: https://cdnb3.artstation.com/p/assets/images/images/003/716/071/large/aoi-ogata-hate-city.jpg?1476754974
|
||||
if url =~ %r!^https?://cdn\w*\.artstation\.com/p/assets/images/images/\d+/\d+/\d+/large/!
|
||||
if url =~ %r!^https?://cdn\w*\.artstation\.com/p/assets/images/images/\d+/\d+/\d+/(?:medium|small|large)/!
|
||||
url, headers = rewrite_large_url(url, headers)
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ module Downloads
|
||||
protected
|
||||
def rewrite_large_url(url, headers)
|
||||
# example: https://cdnb3.artstation.com/p/assets/images/images/003/716/071/original/aoi-ogata-hate-city.jpg?1476754974
|
||||
url = url.sub(%r!/large/!, "/original/")
|
||||
url = url.sub(%r!/(?:medium|small|large)/!, "/original/")
|
||||
return [url, headers]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,7 +15,7 @@ class PostArchive < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
def self.export(version_id = 0)
|
||||
def self.export(version_id = 9096768)
|
||||
PostVersion.where("id > ?", version_id).find_each do |version|
|
||||
previous = version.previous
|
||||
tags = version.tags.scan(/\S+/)
|
||||
|
||||
Reference in New Issue
Block a user