From d499bb4d042116c52601ef54f233033b71710dea Mon Sep 17 00:00:00 2001 From: Toks Date: Fri, 3 Oct 2014 14:21:53 -0400 Subject: [PATCH] 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. --- app/logical/downloads/strategies/tumblr.rb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/logical/downloads/strategies/tumblr.rb b/app/logical/downloads/strategies/tumblr.rb index 846ab516b..84b0953af 100644 --- a/app/logical/downloads/strategies/tumblr.rb +++ b/app/logical/downloads/strategies/tumblr.rb @@ -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]