mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Add error handling for top videos
This commit is contained in:
parent
fb87b3347b
commit
48da2ced46
2 changed files with 13 additions and 3 deletions
|
@ -259,7 +259,12 @@ def rank_videos(db, n, pool, filter)
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
client = get_client(pool)
|
client = get_client(pool)
|
||||||
|
begin
|
||||||
video = get_video(id, client, db)
|
video = get_video(id, client, db)
|
||||||
|
rescue ex
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
pool << client
|
pool << client
|
||||||
|
|
||||||
if video.language
|
if video.language
|
||||||
|
|
|
@ -135,7 +135,11 @@ spawn do
|
||||||
end
|
end
|
||||||
|
|
||||||
loop do
|
loop do
|
||||||
|
begin
|
||||||
top = rank_videos(PG_DB, 40, youtube_pool, filter)
|
top = rank_videos(PG_DB, 40, youtube_pool, filter)
|
||||||
|
rescue ex
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
if top.size > 0
|
if top.size > 0
|
||||||
args = arg_array(top)
|
args = arg_array(top)
|
||||||
|
@ -150,6 +154,7 @@ spawn do
|
||||||
begin
|
begin
|
||||||
videos << get_video(id, client, PG_DB)
|
videos << get_video(id, client, PG_DB)
|
||||||
rescue ex
|
rescue ex
|
||||||
|
next
|
||||||
end
|
end
|
||||||
youtube_pool << client
|
youtube_pool << client
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue