summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com>2020-12-03 22:46:53 +0000
committerGitHub <noreply@github.com>2020-12-03 22:46:53 +0000
commit501db8f27678d61b7c810d65e124e96b9e38565f (patch)
treee7b3bee447a6f34b6d9195f7b716839345daf393
parentc98c7d47db5d4767681a8af2ce3a3228060eb0c3 (diff)
parentcc684ff0b1bfb358f5ef567865e23a532b168132 (diff)
downloadinvidious-501db8f27678d61b7c810d65e124e96b9e38565f.tar.gz
invidious-501db8f27678d61b7c810d65e124e96b9e38565f.tar.bz2
invidious-501db8f27678d61b7c810d65e124e96b9e38565f.zip
Merge pull request #1526 from saltycrys/fix-redirect-channels
Fix redirect channels
-rw-r--r--src/invidious/channels.cr4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/invidious/channels.cr b/src/invidious/channels.cr
index 93507c56..444a6eda 100644
--- a/src/invidious/channels.cr
+++ b/src/invidious/channels.cr
@@ -801,6 +801,10 @@ def get_about_info(ucid, locale)
raise InfoException.new(error_message)
end
+ if browse_endpoint = initdata["onResponseReceivedActions"]?.try &.[0]?.try &.["navigateAction"]?.try &.["endpoint"]?.try &.["browseEndpoint"]?
+ raise ChannelRedirect.new(channel_id: browse_endpoint["browseId"].to_s)
+ end
+
author = initdata["metadata"]["channelMetadataRenderer"]["title"].as_s
author_url = initdata["metadata"]["channelMetadataRenderer"]["channelUrl"].as_s
author_thumbnail = initdata["metadata"]["channelMetadataRenderer"]["avatar"]["thumbnails"][0]["url"].as_s