Batch torrents are torrents that have multiple files bundled within
one torrent file.
RealDebrid does support these, but it is difficult to get them to work.
The main flow requires setting a specific combination in RealDebrid
to allow for link generation. However, this is not intuitive to users
and is bad API design on RealDebrid's part.
Ferrite's implementation presents users with all the possible files
from batches (duplicates deleted) and selects the user-chosen file
to download. That way, only the user chosen file is presented to
play on an external video player.
This still needs work for optimization purposes, but this commit
does produce a working build.
Signed-off-by: kingbri <bdashore3@gmail.com>
The instantAvailability endpoint is now decoded using Codable
and does not have any ambiguity.
Batches are now checked, but still not accounted for due to how
RD handles batches from this endpoint. All batch links are not
supported for instant streaming from Ferrite until support is added.
Thanks to Skitty for helping out with decoding the endpoint.
Signed-off-by: kingbri <bdashore3@gmail.com>
Every request has to add an authentication header. If the response
is 401 (Unauthorized), log the user out of RealDebrid.
Signed-off-by: kingbri <bdashore3@gmail.com>