feat: generate stable infohashes#569
Conversation
While keepking index order between hls.js and shaka player. Allows backend to easily run a private tracker with expected infohashes.
Concern 1 — positional index re-introduces infohash collisionsThe infohash is derived entirely from Pre-#509 used a positional index ( This PR reverts to a positional index (sorted by the hash, but still positional). That makes the index a function of which other streams are present, not of the stream itself, which brings back two failure modes whenever two clients see a different set of streams:
Under the current |
Concern 2 — Shaka/hls.js stream sets differ by OS/browser, so sorting doesn't keep indices alignedThe PR's premise is that sorting by
Worked example — renditions sorted H1<H2<H3<H4<H5:
H3 gets The PR's goal (predictable infohashes for a private tracker) is legitimate, but the content hash already gives determinism the backend can reproduce server-side from manifest metadata — without sacrificing cross-player/cross-platform stability. If sequential integers are genuinely required, they should be derived from a player-independent source (declared manifest order / DASH |
|
Do you have another idea? Running a private tracker is very important for PeerTube, because the trackers were overloaded by classic bittorrent clients (that support websocket protocol). |
|
It can be an option that enables predictable infohashes so they can be easily reproduced on the server. |
|
Added such options in #571 |
Re-use the same infohash structure as v2 (using index suffix) while keeping index order between hls.js and shaka player.
Allows backend to easily run a private tracker with expected infohashes.