Support URL-safe base64 MD5 in sauce as %sMD5. #717
This commit is contained in:
parent
4ef3f19603
commit
325235c688
@ -721,11 +721,11 @@ Config =
|
||||
# uploaders:
|
||||
#//imgur.com/upload?url=%URL;types:gif,jpg,png,pdf;text:Upload to imgur
|
||||
# "View Same" in archives:
|
||||
#https://archive.4plebs.org/_/search/image/%MD5/;text:View same on 4plebs
|
||||
#https://archive.4plebs.org/%board/search/image/%MD5/;text:View same on 4plebs /%board/;boards:<%=
|
||||
#https://archive.4plebs.org/_/search/image/%sMD5/;text:View same on 4plebs
|
||||
#https://archive.4plebs.org/%board/search/image/%sMD5/;text:View same on 4plebs /%board/;boards:<%=
|
||||
grunt.file.readJSON('src/Archive/archives.json').filter(function(x) {return x.uid === 3})[0].files.join(',')
|
||||
%>
|
||||
#https://rbt.asia/%board/?task=search2&search_media_hash=%MD5;text:View same on RBT /%board/;boards:<%=
|
||||
#https://rbt.asia/%board/image/%sMD5;text:View same on RBT /%board/;boards:<%=
|
||||
grunt.file.readJSON('src/Archive/archives.json').filter(function(x) {return x.uid === 8})[0].files.join(',')
|
||||
%>
|
||||
"""
|
||||
|
||||
@ -8,7 +8,8 @@
|
||||
<li><code>%TURL</code>: Thumbnail URL.</li>
|
||||
<li><code>%URL</code>: Full image URL.</li>
|
||||
<li><code>%IMG</code>: Full image URL for GIF, JPG, and PNG; thumbnail URL for other types.</li>
|
||||
<li><code>%MD5</code>: MD5 hash.</li>
|
||||
<li><code>%MD5</code>: MD5 hash in base64.</li>
|
||||
<li><code>%sMD5</code>: MD5 hash in base64 using <code>-</code> and <code>_</code>.</li>
|
||||
<li><code>%name</code>: Original file name.</li>
|
||||
<li><code>%board</code>: Current board.</li>
|
||||
<li><code>%%</code>, <code>%semi</code>: Literal <code>%</code> and <code>;</code>.</li>
|
||||
|
||||
@ -42,12 +42,13 @@ Sauce =
|
||||
|
||||
skip = false
|
||||
for key of parts
|
||||
parts[key] = parts[key].replace /%(T?URL|IMG|MD5|board|name|%|semi)/g, (parameter) ->
|
||||
parts[key] = parts[key].replace /%(T?URL|IMG|s?MD5|board|name|%|semi)/g, (parameter) ->
|
||||
type = {
|
||||
'%TURL': post.file.thumbURL
|
||||
'%URL': post.file.url
|
||||
'%IMG': if ext in ['gif', 'jpg', 'png'] then post.file.url else post.file.thumbURL
|
||||
'%MD5': post.file.MD5
|
||||
'%sMD5': post.file.MD5.replace /[+/=]/g, (c) -> {'+': '-', '/': '_', '=': ''}[c]
|
||||
'%board': post.board.ID
|
||||
'%name': post.file.name
|
||||
'%%': '%'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user