all repos — fixyoutube-go @ 5f9d33f75666cde5e6b40a48e034d0d9e6ade442

A better way to embed YouTube videos everywhere (inspired by FixTweet).

invidious/queries.go (view raw)

 1package invidious
 2
 3const createQueryVideos = `
 4CREATE TABLE IF NOT EXISTS videos (
 5    videoId TEXT PRIMARY KEY,
 6    title TEXT NOT NULL,
 7    description TEXT NOT NULL,
 8    uploader TEXT NOT NULL,
 9    duration int NOT NULL,
10    url TEXT NOT NULL,
11    timestamp DATETIME DEFAULT (datetime('now')),
12    expire DATETIME NOT NULL
13);`
14
15const getVideoQuery = "SELECT * FROM videos WHERE videoId = (?);"
16
17const cacheVideoQuery = "INSERT OR REPLACE INTO videos (videoId, title, description, uploader, duration, url, expire) VALUES (?, ?, ?, ?, ?, ?, ?);"
18
19const clearQuery = "DELETE FROM videos;"