Apply Use Faster Image Host to intra-4chan image/webm links.

This commit is contained in:
ccd0 2016-11-17 19:44:20 -08:00
parent 30a87b5057
commit 7a88b9f25d

View File

@ -6,7 +6,11 @@ ImageHost =
cb: @node
node: ->
return unless @file and not @isClone and (m = @file.url.match /^https?:\/\/is\.4chan\.org\/(.*)$/)
@file.link.hostname = 'i.4cdn.org'
@file.thumbLink.hostname = 'i.4cdn.org' if @file.thumbLink
@file.url = @file.link.href
return if @isClone
if @file and (m = @file.url.match /^https?:\/\/is\.4chan\.org\/(.*)$/)
@file.link.hostname = 'i.4cdn.org'
@file.thumbLink.hostname = 'i.4cdn.org' if @file.thumbLink
@file.url = @file.link.href
for link in $$ 'a[href^="http://is.4chan.org/"], a[href^="https://is.4chan.org/"]', @nodes.comment
link.hostname = 'i.4cdn.org'
return