mirror of
https://github.com/iv-org/invidious.git
synced 2025-01-10 08:47:52 +05:30
Compare commits
4 Commits
875b8ea0c2
...
e6f5fcbc4b
Author | SHA1 | Date | |
---|---|---|---|
|
e6f5fcbc4b | ||
|
df6b51f9c6 | ||
|
7a569d81ca | ||
|
1b942f4f0a |
@ -440,7 +440,7 @@ def parse_link_endpoint(endpoint : JSON::Any, text : String, video_id : String)
|
|||||||
# - https://github.com/iv-org/invidious/issues/3062
|
# - https://github.com/iv-org/invidious/issues/3062
|
||||||
text = %(<a href="#{url}">#{text}</a>)
|
text = %(<a href="#{url}">#{text}</a>)
|
||||||
else
|
else
|
||||||
text = %(<a href="#{url}">#{reduce_uri(url)}</a>)
|
text = %(<a href="#{url}">#{reduce_uri(text)}</a>)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return text
|
return text
|
||||||
|
@ -6,7 +6,7 @@ struct Invidious::User
|
|||||||
|
|
||||||
# Parse a youtube CSV subscription file
|
# Parse a youtube CSV subscription file
|
||||||
def parse_subscription_export_csv(csv_content : String)
|
def parse_subscription_export_csv(csv_content : String)
|
||||||
rows = CSV.new(csv_content, headers: true)
|
rows = CSV.new(csv_content.strip('\n'), headers: true)
|
||||||
subscriptions = Array(String).new
|
subscriptions = Array(String).new
|
||||||
|
|
||||||
# Counter to limit the amount of imports.
|
# Counter to limit the amount of imports.
|
||||||
@ -32,10 +32,10 @@ struct Invidious::User
|
|||||||
|
|
||||||
def parse_playlist_export_csv(user : User, raw_input : String)
|
def parse_playlist_export_csv(user : User, raw_input : String)
|
||||||
# Split the input into head and body content
|
# Split the input into head and body content
|
||||||
raw_head, raw_body = raw_input.split("\n\n", limit: 2, remove_empty: true)
|
raw_head, raw_body = raw_input.strip('\n').split("\n\n", limit: 2, remove_empty: true)
|
||||||
|
|
||||||
# Create the playlist from the head content
|
# Create the playlist from the head content
|
||||||
csv_head = CSV.new(raw_head, headers: true)
|
csv_head = CSV.new(raw_head.strip('\n'), headers: true)
|
||||||
csv_head.next
|
csv_head.next
|
||||||
title = csv_head[4]
|
title = csv_head[4]
|
||||||
description = csv_head[5]
|
description = csv_head[5]
|
||||||
@ -51,7 +51,7 @@ struct Invidious::User
|
|||||||
Invidious::Database::Playlists.update_description(playlist.id, description)
|
Invidious::Database::Playlists.update_description(playlist.id, description)
|
||||||
|
|
||||||
# Add each video to the playlist from the body content
|
# Add each video to the playlist from the body content
|
||||||
csv_body = CSV.new(raw_body, headers: true)
|
csv_body = CSV.new(raw_body.strip('\n'), headers: true)
|
||||||
csv_body.each do |row|
|
csv_body.each do |row|
|
||||||
video_id = row[0]
|
video_id = row[0]
|
||||||
if playlist
|
if playlist
|
||||||
|
Loading…
x
Reference in New Issue
Block a user