QupZilla / qupzilla

Cross-platform Qt web browser
http://www.qupzilla.com
GNU General Public License v3.0
1.11k stars 350 forks source link

How to pass custom arguments in Videoner plugin? #2618

Open ghost opened 6 years ago

ghost commented 6 years ago

After recently discovering videoner plugin. I streams youtube videos exclusively using this plugin and Its awesome. My default streaming pixel quality is 480p but some times I require to stream videos in 360p or below. I know that videoner plugin has a box for passing arguments . How should I use this box to pass my custom arguments. This is my full script.

#!/bin/sh

if [[ -z "$2"]]; then
    p=480
else
    p="$2"
fi

mpv --cache=1024 --no-config --slang=en --ytdl-raw-options=write-auto-sub=,sub-lang=en --ytdl-format='bestvideo[height<=?$p]+bestaudio' $1
ghost commented 6 years ago

That's not for custom arguments, it's for program arguments (mpv arguments) in this case.

ghost commented 6 years ago

so is there any way we can pass custom arguments?

ghost commented 6 years ago

Sorry, what do you mean with custom arguments?

ghost commented 6 years ago

I think videoner plugin if used properly can do some powerful stuff with it. Let say for example if I want to use videoner plugin for both streaming as well as downloading. Currently we have to make two different scripts for streaming and downloading and then needs to load those files in the plugin depending on the use. It will be more efficent if we can do that stuff in a single exectuable file by passing a argument such as --youtube_download boolean

if [argument false|| no arguments]
then
    # Stream youtube videos
    mpv $1
else
   # download video
   youtube-dl $1
fi

This way we can either download or stream videos by passing our custom parameter in videoner plugin. Not only that we should be able to pass additional paramerters --youtube_download boolean --quality 480 or some-other arguments

Sorry english is not my first language and I suppose you understood what I am saying

ghost commented 6 years ago

Sorry english is not my first language and I suppose you understood what I am saying

Ha ha ha, my English is terrible and even i never learned it, so you should not apologize about that. ;-D

So, if you write the script properly, you should can do what you want. You just must do that in single script.

ghost commented 6 years ago

Can you give me some hint?

nowrep commented 6 years ago

You can only set which additional arguments are passed to your program/script before the URL. If you want "custom arguments" as in some placeholders for additional context (like page title, link title, or whatnot) it's not implemented.

ghost commented 6 years ago

"custom arguments" as in some placeholders for additional context (like page title, link title, or whatnot) it's not implemented.

Yeah, that is most important here.

Otherwise, the option like that --youtube_download boolean, you may use without problems . If you want the boolean value or even the whole option to be dynamically changing, you can use some program such like zenity (in the script).