1
0
mirror of https://github.com/zedeus/nitter.git synced 2025-12-08 04:55:37 -05:00

Cache videos

This commit is contained in:
Zed
2019-08-06 19:02:38 +02:00
parent eeead99e32
commit bfcb74c6cc
4 changed files with 47 additions and 20 deletions

View File

@@ -3,6 +3,10 @@ import norm/sqlite
export sqlite, options
type
VideoType* = enum
vmap, m3u8, mp4
db("cache.db", "", "", ""):
type
Profile* = object
@@ -30,6 +34,24 @@ db("cache.db", "", "", ""):
formatIt: getTime().toUnix()
.}: Time
Video* = object
videoId*: string
contentId*: string
durationMs*: int
url*: string
thumb*: string
views*: string
playbackType* {.
dbType: "STRING",
parseIt: parseEnum[VideoType](it.s),
formatIt: $it,
.}: VideoType
available* {.
dbType: "STRING",
parseIt: parseBool(it.s)
formatIt: $it
.}: bool
type
QueryKind* = enum
replies, media, multi, custom = "search"
@@ -42,18 +64,6 @@ type
fromUser*: seq[string]
sep*: string
VideoType* = enum
vmap, m3u8, mp4
Video* = object
contentId*: string
playbackType*: VideoType
durationMs*: int
url*: string
thumb*: string
views*: string
available*: bool
Gif* = object
url*: string
thumb*: string