From 157c4c3e9827921b9bce1908e9d294e27bfe0ed5 Mon Sep 17 00:00:00 2001 From: Dmitry Sandalov Date: Wed, 28 Aug 2024 23:54:31 +0200 Subject: [PATCH 1/2] Fix 'invalid byte sequence' error when subscribing to playlists --- src/invidious/playlists.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.cr index 3e6eef95..3cbab617 100644 --- a/src/invidious/playlists.cr +++ b/src/invidious/playlists.cr @@ -270,7 +270,7 @@ end def subscribe_playlist(user, playlist) playlist = InvidiousPlaylist.new({ - title: playlist.title.byte_slice(0, 150), + title: playlist.title.chars[0, 150].join, id: playlist.id, author: user.email, description: "", # Max 5000 characters From bd34659ff60bd049a2503f2d5e59d353d01840d8 Mon Sep 17 00:00:00 2001 From: Dmitry Sandalov Date: Thu, 29 Aug 2024 22:47:59 +0200 Subject: [PATCH 2/2] Fix 'invalid byte sequence' error when subscribing to playlists ([] accessor with range) --- src/invidious/playlists.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.cr index 3cbab617..a51e88b4 100644 --- a/src/invidious/playlists.cr +++ b/src/invidious/playlists.cr @@ -270,7 +270,7 @@ end def subscribe_playlist(user, playlist) playlist = InvidiousPlaylist.new({ - title: playlist.title.chars[0, 150].join, + title: playlist.title[..150], id: playlist.id, author: user.email, description: "", # Max 5000 characters