4chan has moved thumbnails to i.4cdn.org.

This commit is contained in:
ccd0 2015-02-11 23:50:46 -08:00
parent d41a0529d1
commit 2ad16e2d89
3 changed files with 3 additions and 7 deletions

View File

@ -14,9 +14,6 @@ Build =
"#{filename[...threshold - 5]}(...)#{ext}"
else
filename
thumbRotate: do ->
n = 0
-> n = (n + 1) % 2
sameThread: (boardID, threadID) ->
g.VIEW is 'thread' and g.BOARD.ID is boardID and g.THREADID is +threadID
postURL: (boardID, threadID, postID) ->
@ -62,7 +59,7 @@ Build =
width: data.w
MD5: data.md5
size: data.fsize
turl: "//#{Build.thumbRotate()}.t.4cdn.org/#{boardID}/#{data.tim}s.jpg"
turl: "//i.4cdn.org/#{boardID}/#{data.tim}s.jpg"
theight: data.tn_h
twidth: data.tn_w
isSpoiler: !!data.spoiler

View File

@ -231,7 +231,7 @@ Get =
width: data.media.media_w
MD5: data.media.media_hash
size: data.media.media_size
turl: data.media.thumb_link or "//t.4cdn.org/#{boardID}/#{data.media.preview_orig}"
turl: data.media.thumb_link or "//i.4cdn.org/#{boardID}/#{data.media.preview_orig}"
theight: data.media.preview_h
twidth: data.media.preview_w
isSpoiler: data.media.spoiler is '1'

View File

@ -14,7 +14,6 @@ class Post
for el in $$ 'a[rel=canonical]', root2
el.removeAttribute 'rel'
for el in $$ 'img[src]', root2
el.src = el.src.replace /^(\w+:\/\/)[0-2](\.t\.4cdn\.org\/)/, '$10$2'
el.src = el.src.replace /(spoiler-\w+)\d(\.png)$/, '$11$2'
Fourchan.code.call nodes: comment: $ '.postMessage', root2
for el in $$ 'pre[style=""]', root2
@ -175,7 +174,7 @@ class Post
unit = ['B', 'KB', 'MB', 'GB'].indexOf @file.size.match(/\w+$/)[0]
size *= 1024 while unit-- > 0
@file.sizeInBytes = size
@file.thumbURL = "#{location.protocol}//t.4cdn.org/#{@board}/#{@file.URL.match(/(\d+)\./)[1]}s.jpg"
@file.thumbURL = "#{location.protocol}//i.4cdn.org/#{@board}/#{@file.URL.match(/(\d+)\./)[1]}s.jpg"
@file.isImage = /(jpg|png|gif)$/i.test @file.URL
@file.isVideo = /webm$/i.test @file.URL
nameNode = $ 'a', fileText