diff options
| author | Omar Roth <omarroth@protonmail.com> | 2020-03-06 13:50:00 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2020-03-06 13:50:00 -0500 |
| commit | d96dee3aa66980cfdd4a18d728fa95d407797e36 (patch) | |
| tree | 4a1c781e98aac0d1c7b4936a88adb864d1f93e97 | |
| parent | bd0aaa343b69d65607a34d2a82bae2da493d6cba (diff) | |
| download | invidious-d96dee3aa66980cfdd4a18d728fa95d407797e36.tar.gz invidious-d96dee3aa66980cfdd4a18d728fa95d407797e36.tar.bz2 invidious-d96dee3aa66980cfdd4a18d728fa95d407797e36.zip | |
Add debug info to videoplayback
| -rw-r--r-- | src/invidious.cr | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index a066407f..1c810d1c 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -5482,8 +5482,8 @@ get "/videoplayback" do |env| end client = make_client(URI.parse(host), region) - response = HTTP::Client::Response.new(500) + error = "" 5.times do begin response = client.head(url, headers) @@ -5508,12 +5508,14 @@ get "/videoplayback" do |env| host = "https://r#{fvip}---#{mn}.googlevideo.com" client = make_client(URI.parse(host), region) rescue ex + error = ex.message end end if response.status_code >= 400 env.response.status_code = response.status_code - next + env.response.content_type = "text/plain" + next error end if url.includes? "&file=seg.ts" |
