mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Add simple file cache (no auto deletion yet)
This commit is contained in:
parent
64259ef1ea
commit
d070e76e1a
2 changed files with 25 additions and 11 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import strutils, strformat, uri
|
||||
import nimcrypto
|
||||
import nimcrypto, regex
|
||||
|
||||
const key = "supersecretkey"
|
||||
|
||||
|
|
@ -21,3 +21,7 @@ proc getSigUrl*(link: string; path: string): string =
|
|||
sig = getHmac(link)
|
||||
url = encodeUrl(link)
|
||||
&"/{path}/{sig}/{url}"
|
||||
|
||||
proc cleanFilename*(filename: string): string =
|
||||
const reg = re"[^A-Za-z0-9._-]"
|
||||
filename.replace(reg, "_")
|
||||
|
|
|
|||
Loading…
Reference in a new issue