Invidious is an alternative front-end to YouTube
Add helper function parse_subscription_export_csv() which parses the csv format returned by the subscription exporter
bbielsa7cbd79fee5f8
diff --git a/src/invidious/helpers/utils.cr b/src/invidious/helpers/utils.crindex 8453d605..6d12fe8d 100644--- a/src/invidious/helpers/utils.cr+++ b/src/invidious/helpers/utils.cr@@ -1,3 +1,5 @@+require "csv"+# See http://www.evanmiller.org/how-not-to-sort-by-average-rating.htmldef ci_lower_bound(pos, n)if n == 0@@ -367,3 +369,23 @@ def fetch_random_instancereturn filtered_instance_list.sample(1)[0]end++def parse_subscription_export_csv(csv_content : String)+ rows = CSV.new(csv_content, headers: true)+ subscriptions = Array(String).new++ rows.each do |row|+ # Channel ID is the first column in the csv export we can't use the header+ # name, because I believe the header name is localized depending on the+ # language the user has set on their account+ channel_id = row[0].strip++ if channel_id.empty?+ next+ end++ subscriptions << channel_id+ end++ subscriptions+end