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

[Request] CLI argument support #486

Closed
iG8R opened this issue Dec 28, 2022 · 6 comments
Closed

[Request] CLI argument support #486

iG8R opened this issue Dec 28, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@iG8R
Copy link

iG8R commented Dec 28, 2022

Hi.
Could you, please, implement the possibility to pass arguments (URL, control arguments for Tartube) from external sources to Tartube via command line, e.g. there is an addon for Firefox called "Open with...", it can pass the URL and whatever arguments a user needs to external applications for opening or for any other actions with it. The process is as follows: the "Open with..." add-on created a link of the following format - [external app name] [any arguments for this external app] %s, where %s is the page URL or the URL selected on a page and captured by the add-on.
If Tartube could be able to handle an external call of "tartube_portable_64bit.bat [URL] [general playlist/channel/video/folder]" or "tartube_portable_64bit.bat [URL] [classic] format, where general playlist/... or classic are the arguments indicating where passed URL will be processed in Tartube.

@iG8R iG8R added the enhancement New feature or request label Dec 28, 2022
@axcore
Copy link
Owner

axcore commented Jan 6, 2023

I have considered adding CLI support many times, but there are many problems:

  1. What happens if an instance of Tartube is already running? Two instances of Tartube, running at the same time, cannot load the same database into memory. What happens if the user tries to start ten instances of Tartube using CLI?

  2. People will keep asking for more command-line options. So eventually the interface will become extremely complicated, and Tartube's own code will also become much more complicated

  3. yt-dlp already has CLI, why not just use that?

@iG8R
Copy link
Author

iG8R commented Jan 6, 2023

1. What happens if an instance of Tartube is already running? Two instances of Tartube, running at the same time, cannot load the same database into memory. What happens if the user tries to start ten instances of Tartube using CLI?

Is it possible when already running Tartube intercepts a program call then extracts the arguments and does what those arguments tell it to do?

2. People will keep asking for more command-line options. So eventually the interface will become extremely complicated, and Tartube's own code will also become much more complicated

Yeah... There is no limit to perfection... :) But people always needs to have in mind that Tartube is a GUI for yt-dlp and only arguments except yt-dlp's itself could be arguments doubling the Tartube functions and nothing else.
Is this too troublesome or/and tedious to match CLI arguments with the existing Tartube functions?

3. yt-dlp already has CLI, why not just use that?

The main reason - yt-dlp doesn't give an opportunity for a user dynamically to choose what the destination path to save a file to. With Tartube as the GUI this is way too easy to do it, e.g. in a browser RMB click on a link -> Open with... -> Tartube (where CLI is - tartube_portable_64bit.bat %s classic where %s is an URL) -> Tartube intercepts it and add passed URL to the "Add URL" textbox, after all this a user begins a work with Tartube.
And the second reason is that it is convenient to have a database of downloaded videos, the role of which is taken over by Tartube.

@axcore
Copy link
Owner

axcore commented Jan 8, 2023

Is it possible when already running Tartube intercepts a program call then extracts the arguments and does what those arguments tell it to do?

I researched this, when I was writing code to check that two instances of Tartube are not using the same database. I could not find a sensible way for two instances to communicate with each other.

Problems 2 and 3 are tricky, but not impossible. But I cannot see a solution for problem 1.

@iG8R
Copy link
Author

iG8R commented Jan 8, 2023

The point of my request was to pass an URL and some commanding arguments from the browser to Tartube to make it more easy to download videos. How it'll be done - it's not so important, some apps use arguments (https://github.com/KurtBestor/Hitomi-Downloader/wiki/Command-Line-Switches), as I described in my request, and I thought it was more easy to implement than how some apps (https://github.com/setvisible/DownZemAll) use special protocols to communicate with the browser.

@axcore
Copy link
Owner

axcore commented Jan 9, 2023

The point of my request was to pass an URL and some commanding arguments from the browser to Tartube to make it more easy to download videos.

You can drag and drop videos from your browser window into Tartube's window. Unfortunately, drag and drop does not work on MS Windows, but that seems to be a GTK and/or Microsoft problem.

Alternatively, you can enable automatic copy/paste, then in your browser, you can just right-click a video and select "Copy link".

Writing special protocols to communicate with browsers is not in my skillset. The authors of DownThemAll have been writing Firefox addons for many years, so they have a very different skillset.

@iG8R
Copy link
Author

iG8R commented Jan 9, 2023

You can drag and drop videos from your browser window into Tartube's window. Unfortunately, drag and drop does not work on MS Windows, but that seems to be a GTK and/or Microsoft problem.

Unfortunately or otherwise:), I'm on Windows.

Alternatively, you can enable automatic copy/paste, then in your browser, you can just right-click a video and select "Copy link".

There are already 2 apps that monitor the clipboard - ArsClip(ClipboardManager) and DownZemAll(DownloadManager), and every has its own pattern. Also, direct link management gives you more control over what you do when you select exactly the operation you want, rather than a indiscriminate operation like automatic copy/paste.

Writing special protocols to communicate with browsers is not in my skillset. The authors of DownThemAll have been writing Firefox addons for many years, so they have a very different skillset.

Yes, that's why, understanding what is feasible and what is not, from the very beginning I asked about CLI support and not about anything else.

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

No branches or pull requests

2 participants