Invidious is an alternative front-end to YouTube
Move continuation_token out of Category struct
syeopite0b7a108a59b2
diff --git a/src/invidious/helpers/extractors.cr b/src/invidious/helpers/extractors.crindex ea9411d7..cd3b1f93 100644--- a/src/invidious/helpers/extractors.cr+++ b/src/invidious/helpers/extractors.cr@@ -217,6 +217,7 @@ private class CategoryParser < ItemParsertitle = ""end+ auxiliary_data = {} of String => Stringbrowse_endpoint = item_contents["endpoint"]?.try &.["browseEndpoint"] || nilbrowse_endpoint_data = ""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# category is a playlist/feedif 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 = 1elsebrowse_endpoint_data = browse_endpoint["browseId"].as_s@@ -271,7 +279,6 @@ private class CategoryParser < ItemParsertitle: title,contents: contents,browse_endpoint_data: browse_endpoint_data,- continuation_token: nil,badges: badges,})enddiff --git a/src/invidious/helpers/invidiousitems.cr b/src/invidious/helpers/invidiousitems.crindex 50a47726..edcb2054 100644--- a/src/invidious/helpers/invidiousitems.cr+++ b/src/invidious/helpers/invidiousitems.cr@@ -232,7 +232,6 @@ class Categoryproperty title : Stringproperty contents : Array(SearchItem) | SearchItemproperty browse_endpoint_data : String?- property continuation_token : String?property badges : Array(Tuple(String, String))?def to_json(locale, json : JSON::Builder)