summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-08-05 17:07:17 -0500
committerOmar Roth <omarroth@hotmail.com>2018-08-05 17:07:17 -0500
commit870ee1155394d8f3452609115e13a4e6fd4012b0 (patch)
tree7e904b7ecd5a56ba980eda247e45082c50141dc2 /src
parent0f778cbd9df92ccfefded998874525f27ac96eba (diff)
downloadinvidious-870ee1155394d8f3452609115e13a4e6fd4012b0.tar.gz
invidious-870ee1155394d8f3452609115e13a4e6fd4012b0.tar.bz2
invidious-870ee1155394d8f3452609115e13a4e6fd4012b0.zip
Add fix for movies in search results
Diffstat (limited to 'src')
-rw-r--r--src/invidious/search.cr5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/invidious/search.cr b/src/invidious/search.cr
index 1b1afbfb..da104c6f 100644
--- a/src/invidious/search.cr
+++ b/src/invidious/search.cr
@@ -47,6 +47,11 @@ def search(query, page = 1, search_params = build_search_params(content_type: "v
if metadata.size == 0
next
elsif metadata.size == 1
+ # Skip movies
+ if metadata[0]["class"].includes? "ytd-movie-renderer"
+ next
+ end
+
view_count = metadata[0].content.split(" ")[0].delete(",").to_i64
published = Time.now
else