|
|
@ -217,6 +217,7 @@ private class CategoryParser < ItemParser
|
|
|
|
title = ""
|
|
|
|
title = ""
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auxiliary_data = {} of String => String
|
|
|
|
browse_endpoint = item_contents["endpoint"]?.try &.["browseEndpoint"] || nil
|
|
|
|
browse_endpoint = item_contents["endpoint"]?.try &.["browseEndpoint"] || nil
|
|
|
|
browse_endpoint_data = ""
|
|
|
|
browse_endpoint_data = ""
|
|
|
|
category_type = 0 # 0: Video, 1: Channels, 2: Playlist/feed, 3: trending
|
|
|
|
category_type = 0 # 0: Video, 1: Channels, 2: Playlist/feed, 3: trending
|
|
|
@ -233,7 +234,14 @@ private class CategoryParser < ItemParser
|
|
|
|
# instead it uses the browseId parameter. So if there isn't a params value we can assume the
|
|
|
|
# instead it uses the browseId parameter. So if there isn't a params value we can assume the
|
|
|
|
# category is a playlist/feed
|
|
|
|
# category is a playlist/feed
|
|
|
|
if browse_endpoint["params"]?
|
|
|
|
if browse_endpoint["params"]?
|
|
|
|
browse_endpoint_data = browse_endpoint["params"].as_s
|
|
|
|
# However, even though the channel category type returns the browse endpoint param
|
|
|
|
|
|
|
|
# we're not going to be using it in order to preserve compatablity with Youtube.
|
|
|
|
|
|
|
|
# and for an URL that looks cleaner
|
|
|
|
|
|
|
|
url = item_contents["endpoint"]["commandMetadata"]["webCommandMetadata"]["url"]
|
|
|
|
|
|
|
|
url = URI.parse(url.as_s)
|
|
|
|
|
|
|
|
auxiliary_data["view"] = url.query_params["view"]
|
|
|
|
|
|
|
|
auxiliary_data["shelf_id"] = url.query_params["shelf_id"]
|
|
|
|
|
|
|
|
|
|
|
|
category_type = 1
|
|
|
|
category_type = 1
|
|
|
|
else
|
|
|
|
else
|
|
|
|
browse_endpoint_data = browse_endpoint["browseId"].as_s
|
|
|
|
browse_endpoint_data = browse_endpoint["browseId"].as_s
|
|
|
@ -271,7 +279,6 @@ private class CategoryParser < ItemParser
|
|
|
|
title: title,
|
|
|
|
title: title,
|
|
|
|
contents: contents,
|
|
|
|
contents: contents,
|
|
|
|
browse_endpoint_data: browse_endpoint_data,
|
|
|
|
browse_endpoint_data: browse_endpoint_data,
|
|
|
|
continuation_token: nil,
|
|
|
|
|
|
|
|
badges: badges,
|
|
|
|
badges: badges,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|