summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorsyeopite <syeopite@syeopite.dev>2021-05-08 04:54:12 -0700
committersyeopite <syeopite@syeopite.dev>2021-09-24 21:07:06 -0700
commit0b7a108a59b2f1def6aea5b611f68b29abf59064 (patch)
treec8bf5d5ee10f54343bf60cb3d9cf165baa38730d /src
parent57c63f3598867ce406b807923ea81352f9b1b384 (diff)
downloadinvidious-0b7a108a59b2f1def6aea5b611f68b29abf59064.tar.gz
invidious-0b7a108a59b2f1def6aea5b611f68b29abf59064.tar.bz2
invidious-0b7a108a59b2f1def6aea5b611f68b29abf59064.zip
Move continuation_token out of Category struct
(cherry picked from commit 0e96eda28f25171a0344b972af1852a4d6fc3007)
Diffstat (limited to 'src')
-rw-r--r--src/invidious/helpers/extractors.cr11
-rw-r--r--src/invidious/helpers/invidiousitems.cr1
2 files changed, 9 insertions, 3 deletions
diff --git a/src/invidious/helpers/extractors.cr b/src/invidious/helpers/extractors.cr
index ea9411d7..cd3b1f93 100644
--- a/src/invidious/helpers/extractors.cr
+++ b/src/invidious/helpers/extractors.cr
@@ -217,6 +217,7 @@ private class CategoryParser < ItemParser
title = ""
end
+ auxiliary_data = {} of String => String
browse_endpoint = item_contents["endpoint"]?.try &.["browseEndpoint"] || nil
browse_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/feed
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
else
browse_endpoint_data = browse_endpoint["browseId"].as_s
@@ -271,7 +279,6 @@ private class CategoryParser < ItemParser
title: title,
contents: contents,
browse_endpoint_data: browse_endpoint_data,
- continuation_token: nil,
badges: badges,
})
end
diff --git a/src/invidious/helpers/invidiousitems.cr b/src/invidious/helpers/invidiousitems.cr
index 50a47726..edcb2054 100644
--- a/src/invidious/helpers/invidiousitems.cr
+++ b/src/invidious/helpers/invidiousitems.cr
@@ -232,7 +232,6 @@ class Category
property title : String
property contents : Array(SearchItem) | SearchItem
property browse_endpoint_data : String?
- property continuation_token : String?
property badges : Array(Tuple(String, String))?
def to_json(locale, json : JSON::Builder)