Skip to content
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

[core] Warn user when directly launching yt-dlp.exe #9250

Merged
merged 3 commits into from Feb 24, 2024

Conversation

seproDev
Copy link
Collaborator

@seproDev seproDev commented Feb 19, 2024

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

Detect if the user opened the standalone executable by double-clicking, and display a helpful error message.

Co-authored by Grub4K.

Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

Co-Authored-By: Simon Sawicki <contact@grub4k.xyz>
@seproDev seproDev added the enhancement New feature or request label Feb 19, 2024
Copy link
Member

@Grub4K Grub4K left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good middle ground for giving the user a bit of a hint as to what to do next

yt_dlp/__init__.py Outdated Show resolved Hide resolved
@pukkandan
Copy link
Member

This is awesome if the check is reliable. We don't need to error though. Why not launch into interactive mode as-if --config-location - has been passed?

@Grub4K
Copy link
Member

Grub4K commented Feb 19, 2024

I think people that would double click would kind of be overwhelmed by what --config-location - does. We would have to create more documentation for it, like relaying to README.md for how to use it:

Reading options from interactive input
Refer to the README for what options are available:
https://github.com/yt-dlp/yt-dlp#readme
Press Ctrl+Z and confirm with enter to stop entering options.

Alternatively, we could also have them enter -a -, which is easier to understand:

Please enter all the URLs to download, separated by a space or newline.
Press Ctrl+Z and confirm with enter to stop entering URLs.

We also have to care with what CWD we are at; for example C:\Windows\System32\ might be problematic.
At that point I think it might make more sense to direct them to using the shell instead.

@seproDev
Copy link
Collaborator Author

if the check is reliable

I tested this on both Windows 11 and 7 with py2exe, PyInstaller onefile, and PyInstaller onedir builds. In my testing, this worked reliably.

@seproDev seproDev merged commit 6a6cdcd into yt-dlp:master Feb 24, 2024
15 checks passed
@seproDev seproDev deleted the no-doubleclick branch February 24, 2024 11:58
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
…9250)

Authored by: seproDev, Grub4K

Co-authored-by: Simon Sawicki <contact@grub4k.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants