|
|
|
@ -1,6 +1,11 @@
|
|
|
|
|
require "csv"
|
|
|
|
|
|
|
|
|
|
def parse_subscription_export_csv(csv_content : String)
|
|
|
|
|
struct Invidious::User
|
|
|
|
|
module Import
|
|
|
|
|
extend self
|
|
|
|
|
|
|
|
|
|
# Parse a youtube CSV subscription file
|
|
|
|
|
def parse_subscription_export_csv(csv_content : String)
|
|
|
|
|
rows = CSV.new(csv_content, headers: true)
|
|
|
|
|
subscriptions = Array(String).new
|
|
|
|
|
|
|
|
|
@ -19,9 +24,10 @@ def parse_subscription_export_csv(csv_content : String)
|
|
|
|
|
channel_id = row[0].strip
|
|
|
|
|
|
|
|
|
|
next if channel_id.empty?
|
|
|
|
|
|
|
|
|
|
subscriptions << channel_id
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return subscriptions
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|