Rewrite tumblr cdn urls
This commit is contained in:
@@ -2,7 +2,8 @@ module Downloads
|
||||
module Strategies
|
||||
class Tumblr < Base
|
||||
def rewrite(url, headers)
|
||||
if url =~ %r{^http?://(?:(?:\d+\.)\w+\.)?tumblr\.com}
|
||||
if url =~ %r{^https?://.*tumblr\.com}
|
||||
url, headers = rewrite_cdn(url, headers)
|
||||
url, headers = rewrite_thumbnails(url, headers)
|
||||
end
|
||||
|
||||
@@ -23,6 +24,14 @@ module Downloads
|
||||
|
||||
return [url, headers]
|
||||
end
|
||||
|
||||
def rewrite_cdn(url, headers)
|
||||
if url =~ %r{https?://gs1\.wac\.edgecastcdn\.net/8019B6/data\.tumblr\.com/}
|
||||
url.sub!("gs1.wac.edgecastcdn.net/8019B6/", "")
|
||||
end
|
||||
|
||||
return [url, headers]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user