Remove tumblr 1280w -> 500h source rewriting

It was thought that 500h was always the biggest size when it exists, but
it seems it can actually be either bigger or smaller than 1280w.
This commit is contained in:
Toks
2014-10-03 14:21:53 -04:00
parent 6dce66f33d
commit d499bb4d04

View File

@@ -11,19 +11,10 @@ module Downloads
protected
def rewrite_thumbnails(url, headers)
if url =~ %r{^http?://.+\.tumblr\.com/(?:\w+/)?(?:tumblr_)?(\w+_)(250|400|500|1280)\..+$}
if url =~ %r{^http?://.+\.tumblr\.com/(?:\w+/)?(?:tumblr_)?(\w+_)(250|400|500)\..+$}
match = $1
given_size = $2
big_500h_url = url.sub(match + given_size, match + "500h")
if http_exists?(big_500h_url, headers)
return [big_500h_url, headers]
end
if given_size == "1280"
return [url, headers]
end
big_1280_url = url.sub(match + given_size, match + "1280")
if http_exists?(big_1280_url, headers)
return [big_1280_url, headers]