-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add automatic yt-dlp update check #1
Conversation
Hi @nbtin Thanks for the idea and the PR 🙌 simply saying, that |
Ohh, I didn't realize that, hehe. Thanks for letting me know, keep up the good work @z1nc0r3 ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about just adding -U
flag to the current command variable.
command = f"yt-dlp -f {format_id}+ba {url} -P ~/Downloads/AnyDownloader -U --windows-filenames --quiet --progress --no-mtime --force-overwrites --no-part"
So it automatically checks and updates itself when the user tries to download videos if there is a new version.
wdyt?
Totally get it! 😸 It's just different perspectives on the same issue. Adding the In my opinion, nobody likes surprise updates when they're just trying to grab a funny cat video 😂. So, I think setting time intervals would make things less 'Windows Update-y', and users only update the first time running in a day (after a while)... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, got the idea 😉
Anyway, I have some suggestions for making the code as simple as possible.
- One thing noticed is here it seems to open a separate terminal for the update process, which may conflict with the actual download terminal. Because both trying to use the same executable file.
- So, maybe we can move the checking for the update function call to the download function, just after the command variable. And append the
-U
flag to the already existing command. - And the last thing is the logic behind the getting last day. I think we can use something like
os.path.getmtime(file_path)
to get the last modified date of the .exe file and compare it with today and take a decision.
Need your suggestions on this. And sorry to ask for lots of reviews 😅
A LOT OF good reviews help us code better =)) I'm okay with that, hehe. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Awesome! Thanks 🙌
Hi Lasith,
I've recently downloaded your plugin on Flow Launcher. This plugin is interesting. I love it!
After scrolling your GitHub repo, I found that your plugin is based on yt-dlp (actually a
.exe
file in your repo). I want to know what you intend to do if yt-dlp has its own updated version. Will you update the.exe
file manually? I noticed that by the time I made this pull request, they had a newer version of it (2024.08.01) but your file is still 2024.07.25.I suggest you fetch and download the
yt-dlp.exe
file directly from their repo (https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe). And this process doesn't need to be conducted every time the app is triggered, I recommend you to set an interval (eg: 3 days, 1 week...) to check it automatically.Have a good day!