youwee icon indicating copy to clipboard operation
youwee copied to clipboard

Allow download.failed plugins to mark a recovered queue item as completed

Open anhtahaylove opened this issue 5 months ago • 1 comments

Summary

Please expose an official SDK/API path for a download.failed plugin to mark the original queue item as recovered/completed when the plugin successfully produces a replacement file.

Current behavior

A plugin can return ctx.ok(...) with mutations.activeFilepath, and the post-processing workflow is logged as completed. However, the original download queue item remains in the UI as Failed because the original yt-dlp command failed before the plugin fallback recovered it.

Example from a local plugin test:

  • Original URL: https://m.facebook.com/reel/1976285736162997/
  • Original Youwee download failed with [facebook] Cannot parse data
  • download.failed plugin retried without browser cookies and wrote a recovered MP4 to Downloads
  • Plugin workflow log: Status: Completed
  • Queue UI still shows the item as Failed

Why this matters

Fallback plugins can recover public videos when the default command fails, but users still see a failed queue item even though the recovered file exists. This is confusing and makes fallback plugins look unsuccessful.

Requested API

One of these would work:

  1. Allow download.failed hook result mutations to mark the original queue item as recovered/completed when activeFilepath points to an approved output file.
  2. Add an explicit SDK mutation such as queueStatus: "completed" / recovered: true plus filepath, filesize, and optional title/thumbnail metadata.
  3. Add an app-owned helper, e.g. ctx.youwee.download.markRecovered(...), that validates the file path and updates queue/history safely.

Constraint

Please prefer an official SDK/app-mediated API. Plugins should not patch Youwee's SQLite queue state directly because that is outside the plugin contract and risks corrupting app state.

anhtahaylove avatar Jun 25 '26 17:06 anhtahaylove

Released in v0.18.0 and SDK v2.3.0

vanloctech avatar Jun 28 '26 18:06 vanloctech