mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Add fix for channels that have been deleted
This commit is contained in:
parent
d1841b9be5
commit
b52803904c
1 changed files with 3 additions and 2 deletions
|
@ -585,7 +585,8 @@ def fetch_channel(id, client, db)
|
||||||
ON CONFLICT (id) DO NOTHING", video_array)
|
ON CONFLICT (id) DO NOTHING", video_array)
|
||||||
end
|
end
|
||||||
|
|
||||||
author = rss.xpath_node("//feed/author/name").not_nil!.content
|
author = rss.xpath_node("//feed/author/name").try &.content
|
||||||
|
author ||= ""
|
||||||
|
|
||||||
channel = InvidiousChannel.new(id, author, Time.now)
|
channel = InvidiousChannel.new(id, author, Time.now)
|
||||||
|
|
||||||
|
@ -623,7 +624,7 @@ def fetch_user(sid, client, headers)
|
||||||
channels = [] of String
|
channels = [] of String
|
||||||
feed.xpath_nodes(%q(//ul[@id="guide-channels"]/li/a)).each do |channel|
|
feed.xpath_nodes(%q(//ul[@id="guide-channels"]/li/a)).each do |channel|
|
||||||
if !["Popular on YouTube", "Music", "Sports", "Gaming"].includes? channel["title"]
|
if !["Popular on YouTube", "Music", "Sports", "Gaming"].includes? channel["title"]
|
||||||
channel_id = channel["href"].lstrip("/channel/").not_nil!
|
channel_id = channel["href"].lstrip("/channel/")
|
||||||
get_channel(channel_id, client, PG_DB)
|
get_channel(channel_id, client, PG_DB)
|
||||||
|
|
||||||
channels << channel_id
|
channels << channel_id
|
||||||
|
|
Loading…
Reference in a new issue