mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-12 20:15:10 +00:00
fix(services): register modules in sys.modules so repo-cloned services can self-import and remove old benchmark that should have been deleted
This commit is contained in:
@@ -67,6 +67,20 @@ unshackle dl EX 20914 # via an ALIAS
|
||||
placeholders while the secrets that fill them stay out of it. Both halves
|
||||
read back through the same `self.config[...]`.
|
||||
|
||||
!!! warning "Split across files? Use relative imports"
|
||||
If your service grows beyond a single `__init__.py`, import your own
|
||||
modules **relatively**:
|
||||
|
||||
```python
|
||||
from .helpers import parse_manifest # correct
|
||||
from unshackle.services.TAG.helpers import parse_manifest # breaks from a repo
|
||||
```
|
||||
|
||||
A service loaded from a remote repo lives outside the `unshackle` package,
|
||||
so the absolute `unshackle.services.<TAG>.*` path does not resolve and the
|
||||
import fails with `no known parent package`. Relative imports work both
|
||||
locally and from a cloned repo.
|
||||
|
||||
---
|
||||
|
||||
## The Service base class
|
||||
@@ -629,6 +643,7 @@ unshackle dl MYSVC https://myservice.com/watch/abc123
|
||||
- [ ] Tracks come from a manifest parser with `to_tracks(language=title.language)`; no filtering by quality/language.
|
||||
- [ ] Encrypted tracks are marked with DRM; the license callbacks you need return responses **unmodified**.
|
||||
- [ ] URLs, user agents, and certificates live in `config.yaml`, read via `self.config[...]`.
|
||||
- [ ] Multi-file services import their own modules relatively (`from .helpers import x`), so they work when loaded from a repo.
|
||||
|
||||
Read `unshackle/services/EXAMPLE/` end to end; it annotates every feature
|
||||
touched above in one place.
|
||||
|
||||
Reference in New Issue
Block a user