From 909bb2be7f264e64bf4bd0680d6964328d98e942 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sat, 17 Mar 2018 12:20:22 -0500 Subject: [PATCH] Limit size of language request --- src/helpers.cr | 1 + 1 file changed, 1 insertion(+) diff --git a/src/helpers.cr b/src/helpers.cr index 2f8b90b9..b96fd6da 100644 --- a/src/helpers.cr +++ b/src/helpers.cr @@ -267,6 +267,7 @@ def rank_videos(db, n, pool, filter) else description = XML.parse(video.description) content = [video.title, description.content].join(" ") + content = content[0,1000] results = DetectLanguage.detect(content) language = results[0].language