Invidious is an alternative front-end to YouTube
Add fix for unavailable channels
Omar Roth6b2774c081f0
diff --git a/src/invidious.cr b/src/invidious.crindex c7081d94..f1e8c691 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -1579,7 +1579,12 @@ get "/channel/:ucid" do |env|enddocument = XML.parse_html(json["content_html"].as_s)- author = document.xpath_node(%q(//div[@class="pl-video-owner"]/a)).not_nil!.content+ anchor = document.xpath_node(%q(//div[@class="pl-video-owner"]/a))+ if !anchor+ error_message = "This channel is not available"+ next templated "error"+ end+ author = anchor.contentvideos = [] of ChannelVideodocument.xpath_nodes(%q(//a[contains(@class,"pl-video-title-link")])).each do |node|