|
|
@ -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
|
|
|
@ -267,7 +272,7 @@ def rank_videos(db, n, pool, filter)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
description = XML.parse(video.description)
|
|
|
|
description = XML.parse(video.description)
|
|
|
|
content = [video.title, description.content].join(" ")
|
|
|
|
content = [video.title, description.content].join(" ")
|
|
|
|
content = content[0,10000]
|
|
|
|
content = content[0, 10000]
|
|
|
|
|
|
|
|
|
|
|
|
results = DetectLanguage.detect(content)
|
|
|
|
results = DetectLanguage.detect(content)
|
|
|
|
language = results[0].language
|
|
|
|
language = results[0].language
|
|
|
|