mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Merge pull request #1544 from schwukas/fix-youtube-subscription-import
Fix youtube subscription import
This commit is contained in:
commit
68552b6d65
2 changed files with 5 additions and 4 deletions
|
@ -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!
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
<div class="pure-control-group">
|
||||
<label for="import_youtube">
|
||||
<a rel="noopener" target="_blank" href="https://support.google.com/youtube/answer/6224202?hl=en">
|
||||
<a rel="noopener" target="_blank" href="https://github.com/iv-org/documentation/blob/master/Export-YouTube-subscriptions.md">
|
||||
<%= translate(locale, "Import YouTube subscriptions") %>
|
||||
</a>
|
||||
</label>
|
||||
|
|
Loading…
Reference in a new issue