mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-14 04:08:23 +00:00
Add fix for unavailable channels
This commit is contained in:
parent
3ebe9139b7
commit
6b2774c081
@ -1579,7 +1579,12 @@ get "/channel/:ucid" do |env|
|
|||||||
end
|
end
|
||||||
|
|
||||||
document = XML.parse_html(json["content_html"].as_s)
|
document = 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.content
|
||||||
|
|
||||||
videos = [] of ChannelVideo
|
videos = [] of ChannelVideo
|
||||||
document.xpath_nodes(%q(//a[contains(@class,"pl-video-title-link")])).each do |node|
|
document.xpath_nodes(%q(//a[contains(@class,"pl-video-title-link")])).each do |node|
|
||||||
|
Loading…
Reference in New Issue
Block a user