|
|
@ -1482,8 +1482,8 @@ get "/feed/channel/:ucid" do |env|
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|
author, ucid, auto_generated = get_about_info(ucid)
|
|
|
|
author, ucid, auto_generated = get_about_info(ucid)
|
|
|
|
rescue ex
|
|
|
|
rescue ex
|
|
|
|
error_message = "User does not exist"
|
|
|
|
error_message = ex.message
|
|
|
|
halt env, status_code: 404, response: error_message
|
|
|
|
halt env, status_code: 500, response: error_message
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
page = 1
|
|
|
|
page = 1
|
|
|
@ -1720,7 +1720,7 @@ get "/channel/:ucid" do |env|
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|
author, ucid, auto_generated, sub_count = get_about_info(ucid)
|
|
|
|
author, ucid, auto_generated, sub_count = get_about_info(ucid)
|
|
|
|
rescue ex
|
|
|
|
rescue ex
|
|
|
|
error_message = "User does not exist"
|
|
|
|
error_message = ex.message
|
|
|
|
next templated "error"
|
|
|
|
next templated "error"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -1763,7 +1763,7 @@ get "/api/v1/captions/:id" do |env|
|
|
|
|
rescue ex : VideoRedirect
|
|
|
|
rescue ex : VideoRedirect
|
|
|
|
next env.redirect "/api/v1/captions/#{ex.message}"
|
|
|
|
next env.redirect "/api/v1/captions/#{ex.message}"
|
|
|
|
rescue ex
|
|
|
|
rescue ex
|
|
|
|
halt env, status_code: 403
|
|
|
|
halt env, status_code: 500
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
captions = video.captions
|
|
|
|
captions = video.captions
|
|
|
@ -1955,7 +1955,7 @@ get "/api/v1/comments/:id" do |env|
|
|
|
|
response = JSON.parse(response.body)
|
|
|
|
response = JSON.parse(response.body)
|
|
|
|
|
|
|
|
|
|
|
|
if !response["response"]["continuationContents"]?
|
|
|
|
if !response["response"]["continuationContents"]?
|
|
|
|
halt env, status_code: 403
|
|
|
|
halt env, status_code: 500
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
response = response["response"]["continuationContents"]
|
|
|
|
response = response["response"]["continuationContents"]
|
|
|
@ -2486,8 +2486,8 @@ get "/api/v1/channels/:ucid" do |env|
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|
author, ucid, auto_generated = get_about_info(ucid)
|
|
|
|
author, ucid, auto_generated = get_about_info(ucid)
|
|
|
|
rescue ex
|
|
|
|
rescue ex
|
|
|
|
error_message = {"error" => "User does not exist"}.to_json
|
|
|
|
error_message = {"error" => ex.message}.to_json
|
|
|
|
halt env, status_code: 404, response: error_message
|
|
|
|
halt env, status_code: 500, response: error_message
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
page = 1
|
|
|
|
page = 1
|
|
|
@ -2627,8 +2627,8 @@ end
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|
author, ucid, auto_generated = get_about_info(ucid)
|
|
|
|
author, ucid, auto_generated = get_about_info(ucid)
|
|
|
|
rescue ex
|
|
|
|
rescue ex
|
|
|
|
error_message = {"error" => "User does not exist"}.to_json
|
|
|
|
error_message = {"error" => ex.message}.to_json
|
|
|
|
halt env, status_code: 404, response: error_message
|
|
|
|
halt env, status_code: 500, response: error_message
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
videos, count = get_60_videos(ucid, page, auto_generated)
|
|
|
|
videos, count = get_60_videos(ucid, page, auto_generated)
|
|
|
@ -2913,7 +2913,7 @@ get "/api/v1/playlists/:plid" do |env|
|
|
|
|
playlist = fetch_playlist(plid)
|
|
|
|
playlist = fetch_playlist(plid)
|
|
|
|
rescue ex
|
|
|
|
rescue ex
|
|
|
|
error_message = {"error" => "Playlist is empty"}.to_json
|
|
|
|
error_message = {"error" => "Playlist is empty"}.to_json
|
|
|
|
halt env, status_code: 404, response: error_message
|
|
|
|
halt env, status_code: 500, response: error_message
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|