From 5d7bd9af0f628b59fd3bb11d4f81236e7a8be5c3 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 26 Sep 2018 10:33:08 -0500 Subject: [PATCH] Add host language for comments --- src/invidious.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index abc61137..77959231 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -1832,8 +1832,8 @@ get "/api/v1/comments/:id" do |env| headers["content-type"] = "application/x-www-form-urlencoded" headers["x-client-data"] = "CIi2yQEIpbbJAQipncoBCNedygEIqKPKAQ==" - headers["x-spf-previous"] = "https://www.youtube.com/watch?v=#{id}" - headers["x-spf-referer"] = "https://www.youtube.com/watch?v=#{id}" + headers["x-spf-previous"] = "https://www.youtube.com/watch?v=#{id}&bpctr=#{Time.new.epoch + 2000}&gl=US&hl=en&disable_polymer=1" + headers["x-spf-referer"] = "https://www.youtube.com/watch?v=#{id}&bpctr=#{Time.new.epoch + 2000}&gl=US&hl=en&disable_polymer=1" headers["x-youtube-client-name"] = "1" headers["x-youtube-client-version"] = "2.20180719" @@ -1866,7 +1866,7 @@ get "/api/v1/comments/:id" do |env| } post_req = HTTP::Params.encode(post_req) - response = client.post("/comment_service_ajax?action_get_comments=1&pbj=1&ctoken=#{ctoken}&continuation=#{continuation}&itct=#{itct}", headers, post_req).body + response = client.post("/comment_service_ajax?action_get_comments=1&pbj=1&ctoken=#{ctoken}&continuation=#{continuation}&itct=#{itct}&hl=en&gl=US", headers, post_req).body response = JSON.parse(response) env.response.content_type = "application/json"