mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-10 02:08:23 +00:00
Fix encoding of playlist index
This commit is contained in:
parent
477c84deb1
commit
25ba5bda62
@ -43,9 +43,11 @@ def fetch_playlist_videos(plid, page, video_count)
|
|||||||
nodeset = document.xpath_nodes(%q(.//tr[contains(@class, "pl-video")]))
|
nodeset = document.xpath_nodes(%q(.//tr[contains(@class, "pl-video")]))
|
||||||
videos = extract_playlist(plid, nodeset, index)
|
videos = extract_playlist(plid, nodeset, index)
|
||||||
else
|
else
|
||||||
|
# Playlist has less than one page of videos, so subsequent pages will be empty
|
||||||
if page > 1
|
if page > 1
|
||||||
videos = [] of PlaylistVideo
|
videos = [] of PlaylistVideo
|
||||||
else
|
else
|
||||||
|
# Extract first page of videos
|
||||||
response = client.get("/playlist?list=#{plid}&gl=US&hl=en&disable_polymer=1")
|
response = client.get("/playlist?list=#{plid}&gl=US&hl=en&disable_polymer=1")
|
||||||
document = XML.parse_html(response.body)
|
document = XML.parse_html(response.body)
|
||||||
nodeset = document.xpath_nodes(%q(.//tr[contains(@class, "pl-video")]))
|
nodeset = document.xpath_nodes(%q(.//tr[contains(@class, "pl-video")]))
|
||||||
@ -106,7 +108,8 @@ def produce_playlist_url(id, index)
|
|||||||
end
|
end
|
||||||
ucid = "VL" + id
|
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 = Base64.urlsafe_encode(meta, false)
|
||||||
meta = "PT:#{meta}"
|
meta = "PT:#{meta}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user