mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 22:39:31 -05:00
Fix YouTube subscription import parser
This commit is contained in:
parent
cb40a74aaf
commit
62e8c09183
@ -1492,9 +1492,10 @@ post "/data_control" do |env|
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
when "import_youtube"
|
when "import_youtube"
|
||||||
subscriptions = XML.parse(body)
|
subscriptions = JSON.parse(body)
|
||||||
user.subscriptions += subscriptions.xpath_nodes(%q(//outline[@type="rss"])).map do |channel|
|
|
||||||
channel["xmlUrl"].match(/UC[a-zA-Z0-9_-]{22}/).not_nil![0]
|
user.subscriptions += subscriptions.as_a.compact_map do |entry|
|
||||||
|
entry["snippet"]["resourceId"]["channelId"].as_s
|
||||||
end
|
end
|
||||||
user.subscriptions.uniq!
|
user.subscriptions.uniq!
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user