We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60e870b commit 57353feCopy full SHA for 57353fe
src/invidious/user/imports.cr
@@ -152,9 +152,16 @@ struct Invidious::User
152
# -------------------
153
154
def from_freetube(user : User, body : String)
155
+ # Legacy import?
156
matches = body.scan(/"channelId":"(?<channel_id>[a-zA-Z0-9_-]{24})"/)
157
+ subs = matches.map(&.["channel_id"])
158
- user.subscriptions += matches.map(&.["channel_id"])
159
+ if subs.empty?
160
+ data = JSON.parse(body)["subscriptions"]
161
+ subs = data.as_a.map(&.["id"].as_s)
162
+ end
163
+
164
+ user.subscriptions += subs
165
user.subscriptions.uniq!
166
user.subscriptions = get_batch_channels(user.subscriptions)
167
0 commit comments