Add support for comments under controversial videos

This commit is contained in:
Omar Roth 2018-09-13 16:09:14 -05:00
parent a54668688b
commit d4ee786cab
1 changed files with 1 additions and 1 deletions

View File

@ -1803,7 +1803,7 @@ get "/api/v1/comments/:id" do |env|
if source == "youtube" if source == "youtube"
client = make_client(YT_URL) client = make_client(YT_URL)
headers = HTTP::Headers.new headers = HTTP::Headers.new
html = client.get("/watch?v=#{id}&disable_polymer=1") html = client.get("/watch?v=#{id}&bpctr=#{Time.new.epoch + 2000}&disable_polymer=1")
headers["cookie"] = html.cookies.add_request_headers(headers)["cookie"] headers["cookie"] = html.cookies.add_request_headers(headers)["cookie"]
headers["content-type"] = "application/x-www-form-urlencoded" headers["content-type"] = "application/x-www-form-urlencoded"