This commit is contained in:
parent
61106da689
commit
b0141d87fa
2 changed files with 0 additions and 30 deletions
|
@ -4,22 +4,11 @@ module Invidious::Database::Videos
|
||||||
extend self
|
extend self
|
||||||
|
|
||||||
def insert(video : Video)
|
def insert(video : Video)
|
||||||
request = <<-SQL
|
|
||||||
INSERT INTO videos
|
|
||||||
VALUES ($1, $2, $3)
|
|
||||||
ON CONFLICT (id) DO NOTHING
|
|
||||||
SQL
|
|
||||||
|
|
||||||
REDIS_DB.set(video.id, video.info.to_json, ex: 14400)
|
REDIS_DB.set(video.id, video.info.to_json, ex: 14400)
|
||||||
REDIS_DB.set(video.id + ":time", video.updated, ex: 14400)
|
REDIS_DB.set(video.id + ":time", video.updated, ex: 14400)
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete(id)
|
def delete(id)
|
||||||
request = <<-SQL
|
|
||||||
DELETE FROM videos *
|
|
||||||
WHERE id = $1
|
|
||||||
SQL
|
|
||||||
|
|
||||||
REDIS_DB.del(id)
|
REDIS_DB.del(id)
|
||||||
REDIS_DB.del(id + ":time")
|
REDIS_DB.del(id + ":time")
|
||||||
end
|
end
|
||||||
|
@ -44,11 +33,6 @@ module Invidious::Database::Videos
|
||||||
end
|
end
|
||||||
|
|
||||||
def select(id : String) : Video?
|
def select(id : String) : Video?
|
||||||
request = <<-SQL
|
|
||||||
SELECT * FROM videos
|
|
||||||
WHERE id = $1
|
|
||||||
SQL
|
|
||||||
|
|
||||||
if ((info = REDIS_DB.get(id)) && (time = REDIS_DB.get(id + ":time")))
|
if ((info = REDIS_DB.get(id)) && (time = REDIS_DB.get(id + ":time")))
|
||||||
return Video.new({
|
return Video.new({
|
||||||
id: id,
|
id: id,
|
||||||
|
|
|
@ -384,20 +384,6 @@ def parse_link_endpoint(endpoint : JSON::Any, text : String, video_id : String)
|
||||||
return text
|
return text
|
||||||
end
|
end
|
||||||
|
|
||||||
# Generates a list of external videoplayback proxies for
|
|
||||||
# CSP
|
|
||||||
def gen_videoplayback_proxy_list
|
|
||||||
if !CONFIG.external_videoplayback_proxy.empty?
|
|
||||||
external_videoplayback_proxy = ""
|
|
||||||
CONFIG.external_videoplayback_proxy.each do |proxy|
|
|
||||||
external_videoplayback_proxy += " #{proxy}"
|
|
||||||
end
|
|
||||||
else
|
|
||||||
external_videoplayback_proxy = ""
|
|
||||||
end
|
|
||||||
return external_videoplayback_proxy
|
|
||||||
end
|
|
||||||
|
|
||||||
def encrypt_ecb_without_salt(data, key)
|
def encrypt_ecb_without_salt(data, key)
|
||||||
cipher = OpenSSL::Cipher.new("aes-128-ecb")
|
cipher = OpenSSL::Cipher.new("aes-128-ecb")
|
||||||
cipher.encrypt
|
cipher.encrypt
|
||||||
|
|
Loading…
Add table
Reference in a new issue