mirror of https://github.com/iv-org/invidious.git
Add error handling for top videos
This commit is contained in:
parent
fb87b3347b
commit
48da2ced46
|
@ -259,7 +259,12 @@ def rank_videos(db, n, pool, filter)
|
|||
break
|
||||
else
|
||||
client = get_client(pool)
|
||||
begin
|
||||
video = get_video(id, client, db)
|
||||
rescue ex
|
||||
next
|
||||
end
|
||||
|
||||
pool << client
|
||||
|
||||
if video.language
|
||||
|
|
|
@ -135,7 +135,11 @@ spawn do
|
|||
end
|
||||
|
||||
loop do
|
||||
begin
|
||||
top = rank_videos(PG_DB, 40, youtube_pool, filter)
|
||||
rescue ex
|
||||
next
|
||||
end
|
||||
|
||||
if top.size > 0
|
||||
args = arg_array(top)
|
||||
|
@ -150,6 +154,7 @@ spawn do
|
|||
begin
|
||||
videos << get_video(id, client, PG_DB)
|
||||
rescue ex
|
||||
next
|
||||
end
|
||||
youtube_pool << client
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue