7.9 KiB
Task Log
- youdis v2 goals:
- [X] 2.0.0: define architecture (2-4)
- [X] 2.0.1: build backend yt-dlp worker (3)
- [ ] 2.0.2: update discord bot to use new backend (3)
- [ ] 2.0.3: remove deprecated discord-bot functionality (2)
- [ ] 2.0.5: fix automation and build pipeline (3)
youdis v2 goals:
- Separate backend from frontend
- Offload auth
- Ensure auto nightly builds
- Default output format supports plex browsing youtube channels as "tv shows"
- Facilitate multiple GUI inbounds: Discord, Zulip, XMPP
[X] 2.0.0: define architecture (2-4)
define the target architecture for a private backend yt-dlp worker with thin chat frontends
pm notes:
- keep this iterative. the point is to choose the shape and seam, not prematurely implement infra. likely decisions include backend framework, request/status model, and how thin the discord shim should be.
- goal is simple, private, maintainable deployment
- avoid auth, queues, or persistence beyond clear & immediate needs
Acceptance Criteria
-
document the target architecture at a high level
- backend owns yt-dlp execution and job state
- frontends own chat-specific UX
-
identify key decisions still open
- backend choice
- service seam/endpoints
- status/progress model
-
capture enough structure to begin implementation
- repo/component layout is sketched
- next implementation task is unblocked
evidence
- commit:
0ed16ec - tests: n/a
- datetime: [2026-03-31 Tue 18:48]
notes
- first architecture draft captured in `docs/architecture-v2.org`
[X] 2.0.1: build backend yt-dlp worker (3)
create the minimal backend/service skeleton and establish a working yt-dlp baseline with clean hooks for future frontends
pm notes
- foundation; don't need the full finished service here, just the basic shape plus enough real yt-dlp execution to validate the seam and build on it.
- keep single-job semantics
- prioritize inspectable behavior over polish
Acceptance Criteria
-
create the backend/service skeleton
- app/module layout exists
- core request path is stubbed or minimally working
-
establish a working yt-dlp baseline
- archive behavior is preserved
- output path behavior is preserved or intentionally updated
- use yt-dlp .conf and set reasonable default
-
expose basic hooks/interfaces for future frontends
- submit/request path exists
- status/progress hook exists
- basic health/version visibility exists
-
make local testing practical without breaking container defaults
- backend can run when `/config` or `/downloads` are not writable in local dev
- env vars may override executable/config/download paths
- status makes the effective runtime command/paths inspectable
evidence
- commit: 7926534,2a56485
-
tests:
- `python3 -m py_compile ./youdis/main.py ./youdis/models.py ./youdis/adapters/__init__.py ./youdis/adapters/discord.py`
- `python3 -m uvicorn youdis.main:app –host 127.0.0.1 –port 8000`
- `sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/download/2026.03.17/yt-dlp -o /usr/local/bin/yt-dlp`
- `sudo chmod +x /usr/local/bin/yt-dlp`
- `yt-dlp –version`
- `curl http://127.0.0.1:8000/health`
- `curl http://127.0.0.1:8000/version`
- `curl -X POST http://127.0.0.1:8000/jobs -H 'content-type: application/json' -d '{"url":"https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'`
- `curl http://127.0.0.1:8000/jobs/current`
- if testing in container: `docker build -t youdis:v2 .`
- if testing in container: `docker run –rm -p 8000:8000 -v [config]:/config -v [downloads]:/downloads youdis:v2`
user@paladin:~/proj/youdis$ curl http://127.0.0.1:8000/health
{"status":"ok"} user@paladin:~/proj/youdis$ curl http://127.0.0.1:8000/version {"version":"20250829-ec72c56","active_job":false} user@paladin:~/proj/youdis$ curl -X POST http://127.0.0.1:8000/jobs -H 'content-type: application/json' -d '{"url":"https://www.youtube.com/watch?v=3i72yY_LaW4"}' {"job_id":"cc85165e-d906-4eee-864f-1a398b6de2e0","state":"accepted","url":"https://www.youtube.com/watch?v=3i72yY_LaW4","message":"accepted","phase":"queued","disposition":null,"requester_id":null,"requester_name":null,"origin":null,"result_path":null,"command":[],"returncode":null,"created_at":"2026-04-01T00:44:35.657196","updated_at":"2026-04-01T00:44:35.657198"} user@paladin:~/proj/youdis$ curl http://127.0.0.1:8000/jobs/current {"active":false,"job":{"job_id":"cc85165e-d906-4eee-864f-1a398b6de2e0","state":"failed","url":"https://www.youtube.com/watch?v=3i72yY_LaW4","message":"ERROR: unable to create directory [Errno 13] Permission denied: '/downloads'","phase":null,"disposition":null,"requester_id":null,"requester_name":null,"origin":null,"result_path":null,"command":["yt-dlp","--config-locations","/home/user/proj/youdis/default-yt-dlp.conf","https://www.youtube.com/watch?v=3i72yY_LaW4"],"returncode":1,"created_at":"2026-04-01T00:44:35.657196","updated_at":"2026-03-31T20:44:36.653353"}}user@paladin:~/proj/youdis$
:END:
- datetime: [2026-03-31 Tue 20:45]
notes
- validate `yt-dlp` subprocess invocation in-container; not verifiable in the current shell because `yt-dlp` is not installed here
- confirm `–config-locations` behavior against the installed `yt-dlp` version during integration testing
- current backend scaffold is not yet wired into `dockerfile` or `run-youdis.sh`
- archive-hit and result-path parsing currently depend on `yt-dlp` stdout text patterns, so treat them as provisional until integration-tested
- local dev now falls back to repo-local `.runtime/{config,downloads}` when `/config` or `/downloads` are not writable
- had to uninstall yt-dlp python pkg from the venv, which resulted in a '403 Forbidden'
[ ] 2.0.2: update discord bot to use new backend (3)
update the discord bot into a thin frontend that talks to the backend and verify the flow end to end
pm notes
- this is the first real frontend proof. once this works cleanly, zulip/xmpp should mostly be adapter work rather than downloader rewrites.
- keep discord logic thin; no auth
- do not duplicate yt-dlp behavior in the bot
Acceptance Criteria
-
discord bot submits requests to backend
- command/input handling works
- acceptance/busy/failure responses are clear
-
discord bot relays useful backend status
- progress reporting works at a basic level
- completion/failure/skipped outcomes are surfaced
-
backend-discord flow is tested end to end
- valid request path tested
- busy or conflict behavior tested
- failure path tested
evidence
- commit:
- tests:
- datetime:
notes
[ ] 2.0.3: remove deprecated discord-bot functionality (2)
delete or retire legacy bot behaviors that no longer fit once the backend split is in place
pm notes
- only remove this after the new path works. this is cleanup, not pioneering work.
- favor deletion over compatibility shims
- keep operator controls only if still useful
Acceptance Criteria
-
remove obsolete auth/user-management behavior
- old user persistence and commands are removed
- backend-facing flow no longer depends on them
-
remove obsolete downloader/runtime logic from bot
- bot no longer owns yt-dlp execution
- dead code paths are deleted
-
leave the bot in a coherent state
- remaining commands reflect actual supported behavior
- deprecated artifacts are clearly removed or marked
evidence
- commit:
- tests:
- datetime:
notes
[ ] 2.0.5: fix automation and build pipeline (3)
repair and simplify the build/update/deploy path so it matches the new backend-plus-frontend structure
pm notes
- this should come after architecture and discord integration stabilize. no point polishing the pipeline for the wrong shape.
- optimize for simple manual ops first
- stop here after pipeline is sane
Acceptance Criteria
-
align build artifacts with the new structure
- docker/build scripts reflect current components
- runtime assumptions are consistent
-
review old automation artifacts
- stale runner/update/restart logic is removed or updated
- manual update/rebuild flow is clear
-
confirm deployment path works
- local or unraid deployment is validated
- pipeline is understandable enough to maintain
evidence
- commit:
- tests:
- datetime: