fix(downloader): Implement retry logic for download failures with fal… #3480
No reviewers
Labels
No labels
awaiting-reply
breaking changes
bug
cannot-reproduce
dependencies
documentation
duplicate
electron-issue
enhancement
fix-available
good first issue
help wanted
invalid
javascript
need more information
need rebase
official-youtube-music-issue
plugin request
question
release
security
stale
Status: blocked
typo
wontfix
ytmd-issue
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: YTMD/youtube-music#3480
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "User-425/master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request introduces a retry mechanism in the
downloadSongUnsafe
function to handle download failures more robustly. It includes retry logic with exponential backoff and a fallback to direct URL downloading if all retries fail.Enhancements to download handling:
src/plugins/downloader/main/index.ts
: Added a retry mechanism with a maximum of 3 attempts for downloading, including a delay between retries and a refresh of the session cookie. If all retries fail, the code attempts to download using the direct URL as a fallback. This ensures more reliable handling of intermittent failures during the download process.I tried to implement a retry mechanism, it works. To fix download error #3328. Although I fix this using the V.3.9.0. Because I can't figure it out how to open menu in the master. Also in my case, in a long run (using auto downloader). Some song still got error, but this PR drastically reduce the chance.
The reason you can't test on master is due to a recent commit that replaces
vite
(the bundler) withrolldown-vite
.You can revert this change in your local clone to test directly on master
(do not forget to run
pnpm i
)--
I tested it myself and the retry did indeed work!
This is my first time using the downloader, but I think I discovered a bug ☹️ (unrelated to ur PR btw, don't worry)
For some reason, the context menu downloads the current playing song, no matter what song I select to download from the "up next" list.
That only happens on the first time I click download, and it is unrelated to the player state (switching songs before pressing download doesn't fix it).
Honestly, I'd nag you about the code quality, but I won't do that since the downloader plugin needs major refactoring to be up to my standards.
So LGTM!
Hi, just a quick question - I was trying to build this branch locally and got the code to build successfully. However, when installing the local build (or running it from portable version) I cannot toggle the application menu (neither Alt is working nor backtick) and the plugins do not seem to be loaded. I've checked the config.json and hideMenu is false as well.
Are there any additional steps that need to be done on local builds to have this working and plugins loaded? I've followed the builds steps from readme.md (basically pnpm dist)
@halleck1 this PR is 24 commits behind master, so your local clone does not have the required fix to run properly
also, I already discussed this before master even had the fix,

either do
git merge master
orgit rebase master
or manually do what my comment saysView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.