diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-09-28 09:54:01 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-09-28 09:54:01 -0500 |
| commit | 25ba5bda62fcc9015a76cb586904250886d45e95 (patch) | |
| tree | 63026d25c64ba8e285f86aa65fd8d7eef1b93a96 | |
| parent | 477c84deb158e461135d32a688a057e20fa4db5c (diff) | |
| download | invidious-25ba5bda62fcc9015a76cb586904250886d45e95.tar.gz invidious-25ba5bda62fcc9015a76cb586904250886d45e95.tar.bz2 invidious-25ba5bda62fcc9015a76cb586904250886d45e95.zip | |
Fix encoding of playlist index
| -rw-r--r-- | src/invidious/playlists.cr | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/invidious/playlists.cr b/src/invidious/playlists.cr index e6bc917b..0626f4ae 100644 --- a/src/invidious/playlists.cr +++ b/src/invidious/playlists.cr @@ -43,9 +43,11 @@ def fetch_playlist_videos(plid, page, video_count) nodeset = document.xpath_nodes(%q(.//tr[contains(@class, "pl-video")])) videos = extract_playlist(plid, nodeset, index) else + # Playlist has less than one page of videos, so subsequent pages will be empty if page > 1 videos = [] of PlaylistVideo else + # Extract first page of videos response = client.get("/playlist?list=#{plid}&gl=US&hl=en&disable_polymer=1") document = XML.parse_html(response.body) nodeset = document.xpath_nodes(%q(.//tr[contains(@class, "pl-video")])) @@ -106,7 +108,8 @@ def produce_playlist_url(id, index) end ucid = "VL" + id - meta = "\x08#{write_var_int(index).join}" + meta = [0x08_u8] + write_var_int(index) + meta = Slice.new(meta.to_unsafe, meta.size) meta = Base64.urlsafe_encode(meta, false) meta = "PT:#{meta}" |
