kopia lustrzana https://github.com/iv-org/invidious
Add error message for fetching channel videos
rodzic
c5d2a57206
commit
1ea563f4f1
|
@ -2424,7 +2424,12 @@ get "/api/v1/channels/:ucid" do |env|
|
||||||
end
|
end
|
||||||
|
|
||||||
page = 1
|
page = 1
|
||||||
videos, count = get_60_videos(ucid, page, auto_generated)
|
begin
|
||||||
|
videos, count = get_60_videos(ucid, page, auto_generated)
|
||||||
|
rescue ex
|
||||||
|
error_message = {"error" => ex.message}.to_json
|
||||||
|
halt env, status_code: 500, response: error_message
|
||||||
|
end
|
||||||
|
|
||||||
client = make_client(YT_URL)
|
client = make_client(YT_URL)
|
||||||
channel_html = client.get("/channel/#{ucid}/about?disable_polymer=1").body
|
channel_html = client.get("/channel/#{ucid}/about?disable_polymer=1").body
|
||||||
|
@ -2565,7 +2570,12 @@ end
|
||||||
halt env, status_code: 500, response: error_message
|
halt env, status_code: 500, response: error_message
|
||||||
end
|
end
|
||||||
|
|
||||||
videos, count = get_60_videos(ucid, page, auto_generated)
|
begin
|
||||||
|
videos, count = get_60_videos(ucid, page, auto_generated)
|
||||||
|
rescue ex
|
||||||
|
error_message = {"error" => ex.message}.to_json
|
||||||
|
halt env, status_code: 500, response: error_message
|
||||||
|
end
|
||||||
|
|
||||||
result = JSON.build do |json|
|
result = JSON.build do |json|
|
||||||
json.array do
|
json.array do
|
||||||
|
|
Ładowanie…
Reference in New Issue