mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-16 01:48:51 +00:00
@@ -179,8 +179,8 @@ module Invidious::Routes::API::V1::Misc
|
||||
begin
|
||||
resolved_url = YoutubeAPI.resolve_url(url.as(String))
|
||||
endpoint = resolved_url["endpoint"]
|
||||
pageType = endpoint.dig?("commandMetadata", "webCommandMetadata", "webPageType").try &.as_s || ""
|
||||
if pageType == "WEB_PAGE_TYPE_UNKNOWN"
|
||||
page_type = endpoint.dig?("commandMetadata", "webCommandMetadata", "webPageType").try &.as_s || ""
|
||||
if page_type == "WEB_PAGE_TYPE_UNKNOWN"
|
||||
return error_json(400, "Unknown url")
|
||||
end
|
||||
|
||||
@@ -196,7 +196,7 @@ module Invidious::Routes::API::V1::Misc
|
||||
json.field "playlistId", sub_endpoint["playlistId"].as_s if sub_endpoint["playlistId"]?
|
||||
json.field "startTimeSeconds", sub_endpoint["startTimeSeconds"].as_i if sub_endpoint["startTimeSeconds"]?
|
||||
json.field "params", params.try &.as_s
|
||||
json.field "pageType", pageType
|
||||
json.field "pageType", page_type
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user