mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-27 03:15:08 +00:00
feat(import): reconstruct downloads from an --export sidecar
Add a shareable --export schema and a new `unshackle import` command that rebuilds tracks from the export, injects the licensed content keys, and runs the normal download/decrypt/mux pipeline with no re-authentication or licensing.
This commit is contained in:
@@ -195,6 +195,29 @@ class Subtitle(Track):
|
||||
# Called after Track has been converted to another format
|
||||
self.OnConverted: Optional[Callable[[Subtitle.Codec], None]] = None
|
||||
|
||||
def to_dict(self) -> dict[str, Any]:
|
||||
data = super().to_dict()
|
||||
data.update(
|
||||
{
|
||||
"codec": self.codec.name if self.codec else None,
|
||||
"cc": self.cc,
|
||||
"sdh": self.sdh,
|
||||
"forced": self.forced,
|
||||
}
|
||||
)
|
||||
return data
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, data: dict[str, Any]) -> Subtitle:
|
||||
kwargs = Track.base_kwargs_from_dict(data)
|
||||
return cls(
|
||||
**kwargs,
|
||||
codec=Subtitle.Codec[data["codec"]] if data.get("codec") else None,
|
||||
cc=data.get("cc", False),
|
||||
sdh=data.get("sdh", False),
|
||||
forced=data.get("forced", False),
|
||||
)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return " | ".join(
|
||||
filter(
|
||||
|
||||
Reference in New Issue
Block a user