mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Fix 500 on channel page when video list is empty
This commit is contained in:
parent
2b911aabc4
commit
503c47c8bf
1 changed files with 10 additions and 0 deletions
|
@ -2222,6 +2222,16 @@ get "/channel/:ucid" do |env|
|
|||
response = client.get(url)
|
||||
|
||||
json = JSON.parse(response.body)
|
||||
if json["content_html"].as_s.strip(" \n").empty?
|
||||
rss = client.get("/feeds/videos.xml?channel_id=#{ucid}").body
|
||||
rss = XML.parse_html(rss)
|
||||
author = rss.xpath_node("//feed/author/name").not_nil!.content
|
||||
|
||||
videos = [] of ChannelVideo
|
||||
|
||||
next templated "channel"
|
||||
end
|
||||
|
||||
document = XML.parse_html(json["content_html"].as_s)
|
||||
author = document.xpath_node(%q(//div[@class="pl-video-owner"]/a)).not_nil!.content
|
||||
|
||||
|
|
Loading…
Reference in a new issue