From cb40a74aafb5e2df3899475a4046a1ccd002e5a4 Mon Sep 17 00:00:00 2001 From: Lukas Date: Sun, 6 Dec 2020 21:46:58 +0100 Subject: [PATCH 1/3] Add temporary link to subscription export instructions --- src/invidious/views/data_control.ecr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/views/data_control.ecr b/src/invidious/views/data_control.ecr index e3edb9ea..6031d953 100644 --- a/src/invidious/views/data_control.ecr +++ b/src/invidious/views/data_control.ecr @@ -14,7 +14,7 @@
From 62e8c091831ce2d2db7e928dd25cb55330d72323 Mon Sep 17 00:00:00 2001 From: Lukas Date: Sun, 6 Dec 2020 21:47:50 +0100 Subject: [PATCH 2/3] Fix YouTube subscription import parser --- src/invidious.cr | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/invidious.cr b/src/invidious.cr index 1b59025c..c4ca9c08 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -1492,9 +1492,10 @@ post "/data_control" do |env| end end when "import_youtube" - subscriptions = XML.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] + subscriptions = JSON.parse(body) + + user.subscriptions += subscriptions.as_a.compact_map do |entry| + entry["snippet"]["resourceId"]["channelId"].as_s end user.subscriptions.uniq! From 77c13e10ecc2bab5e9de7109514b8e0dbf79ef2a Mon Sep 17 00:00:00 2001 From: Lukas Date: Mon, 7 Dec 2020 13:34:40 +0100 Subject: [PATCH 3/3] Update link to instructions --- src/invidious/views/data_control.ecr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/views/data_control.ecr b/src/invidious/views/data_control.ecr index 6031d953..74ccc06c 100644 --- a/src/invidious/views/data_control.ecr +++ b/src/invidious/views/data_control.ecr @@ -14,7 +14,7 @@