Merge pull request #1544 from schwukas/fix-youtube-subscription-import
Fix youtube subscription import
This commit is contained in:
commit
68552b6d65
@ -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 New Issue
Block a user