marcopeocchi / yt-dlp-web-ui

A terrible web ui for yt-dlp. Designed to be self-hosted.
Mozilla Public License 2.0
657 stars 67 forks source link

Unable to clear downloads #160

Closed idlira closed 1 week ago

idlira commented 1 week ago

Version running Docker tag: latest as of Jun 19th 2024, running on a Raspi4 with latest RaspiOS 64 bit and a pretty vanilla docker-compose file:

  ytdl:
    image: marcobaobao/yt-dlp-webui
    ports:
      - 3033:3033
    volumes:
      - ./youtube-dl:/downloads
    restart: unless-stopped

Describe the bug Downloads are working alright, but I'm unable to clear them from the list after. In the docker logs I see this message being printed once I hit the clear button:

ytdl  | time=2024-06-19T06:31:32.520Z level=INFO msg="Trying killing process with id" id=7cbec09c-a491-488d-acd2-0f785f4c2ab9
ytdl  | time=2024-06-19T06:31:32.520Z level=INFO msg="failed killing process" id=7cbec09c-a491-488d-acd2-0f785f4c2ab9

To Reproduce Steps to reproduce the behavior:

  1. Download something
  2. Once complete, it shows in the active downloads as completed
  3. Press clear
  4. Nothing happens.

Expected behavior Remove completed downloads successfully.

Thanks for any help!

idlira commented 1 week ago

One more addition: in the browser dev tools I see the following response after clicking the Clear button:

{
    "id": "78",
    "result": null,
    "error": "no such process"
}
marcopeocchi commented 1 week ago

Hello @idlira,

The issue came from a misuse of the Kill function of the rpc: completed downloads had (rightfully) a nil pointer to the os process of yt-dlp, killing it errored the function.

Now completed downloads are removed with the Clear function as should have been.

Many thanks for creating this issue!