diff options
| author | Omar Roth <omarroth@hotmail.com> | 2019-01-25 10:38:28 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2019-01-25 10:38:28 -0600 |
| commit | 586c0a05791b1d6b8a3ecf4facbc7aa8dc3fc636 (patch) | |
| tree | 7b6bc689ce460dc38f3315205f923724b12f59d2 | |
| parent | 1af86f6afbba9a479f8d6a615c9f2a9d263d8c18 (diff) | |
| download | invidious-586c0a05791b1d6b8a3ecf4facbc7aa8dc3fc636.tar.gz invidious-586c0a05791b1d6b8a3ecf4facbc7aa8dc3fc636.tar.bz2 invidious-586c0a05791b1d6b8a3ecf4facbc7aa8dc3fc636.zip | |
Add error message for unavailable endpoint /api/v1/insights/:id
| -rw-r--r-- | src/invidious.cr | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index f3404d23..d44bb069 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -2385,6 +2385,9 @@ get "/api/v1/insights/:id" do |env| id = env.params.url["id"] env.response.content_type = "application/json" + error_message = {"error" => "YouTube has removed publicly-available analytics."}.to_json + halt env, status_code: 503, response: error_message + client = make_client(YT_URL) headers = HTTP::Headers.new html = client.get("/watch?v=#{id}&gl=US&hl=en&disable_polymer=1") |
