Diane 026698cba2 Fix AzuraCast integration against verified API behavior
Fix AzuraCast integration against verified API behavior

Verified against AzuraCast source (Files\BatchAction, FlowUploadAction,
Files\ListAction, Paginator, StationPlaylistMediaRepository):

- Rotation read a nonexistent 'mtime' key; the files API returns
  'timestamp' (unix epoch). Age buckets now work, so tracks actually
  migrate Currents -> Recurrents -> Gold as intended.
- Rotation now filters on type == 'media' (dirs are 'directory', not
  'dir') and skips rows without a path/timestamp.
- Follow ?page= pagination on /files: the default (no params) response
  is an unpaginated JSON array, but any paginated response is now
  traversed instead of only page 1 being visible.
- POST /files/upload returns only {success, message}; it never returns
  unique_id/path, and the file lands at the uploaded filename. Removed
  the dead unique_id search; playlist+queue now use the known path.
- Added success/error checks for batch ops (playlist/queue) instead of
  discarding responses, and queue no longer runs when playlist assign
  or Currents lookup failed.
- Replaced curl subprocess shelling with aiohttp (already a matrix-nio
  dependency): single helper for API calls, real multipart upload,
  timeouts everywhere, no temp JSON/pickle files in DATA_DIR.

Functional test (mock AzuraCast mirroring verified API shapes):
15/15 checks pass - upload contract, pagination, batch ops, and age
bucketing (fresh/6d/10d/30d -> Currents/Currents/Recurrents/Gold,
directories and non-media excluded).
2026-09-03 13:09:27 +00:00
2024-01-21 10:47:20 +01:00
2024-08-15 22:19:35 +02:00
2026-07-19 15:30:10 +02:00
2026-07-16 18:43:01 +02:00
2024-01-19 14:14:46 +01:00
2024-01-23 17:58:22 +01:00
2026-04-20 11:42:59 +02:00

ParkerBot

ParkerBot is a Matrix bot that monitors a channel for YouTube links and generates weekly playlists from them. It also sends YouTube link titles to the channel it's in.

Running locally

  1. Clone the repo
  2. Install the dependencies, preferably in a venv:
    uv venv --python 3.14 --seed
    source .venv/bin/activate
    uv pip install -r requirements.txt
    
  3. Copy example.env to .env, customize it.
  4. Source .env:
    source .env
    
  5. Execute the app:
    ./main.py
    

Running as a container

  1. Customize the compose.yml if necessary, you might want to change the data volume's path or make it a named volume.
  2. Copy example.env to .env and customize it.
  3. Run locally as described above at least once on a machine with a web browser. This is needed to get a valid token.pickle for YouTube. Copy it to the data directory where you want to run the container.
  4. Run the container, this is an example with podman-compose:
    podman-compose up -d
    
S
Description
Matrix bot that generates YouTube playlists from links in a channel.
Readme Apache-2.0
1.2 MiB
0 Stars 1 Watchers 1 Forks
1.2.3
Latest
2026-04-16 12:12:57 +02:00
Languages
Python 98.4%
Dockerfile 1.6%