Agreed.Anyway, the point is that what you type in the box should be passed verbatim and not modified en route.
That is the goal!Anyway, the point is that what you type in the box should be passed verbatim and not modified en route.
I suppose the [] in the format mean that Jim wants to escape the format string but I can't see any way of unescaping it in Jim. I thought that I managed to force the {} out of the command line of theI typed this into the qtube "Process options" box:
-f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4
and what it executed was this, according to the auto processing log:
qtube -f {'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio'} --merge-output-format mp4
This obviously failed, with an unavailable format error. I presume this is the result of some Jim stupidity somewhere.
/mod/bin/youtube
shell script at the last possible moment by hacking the dequeue routine, but that was a mirage.Yes, me too, which is probably why I dislike it.I still find JIM a strange language
That had its own weirdness too.I'm happier using REXX as a scripting language
The problem is the use of single quotes, it works with either double quotes" or braces {}I typed this into the qtube "Process options" box:
-f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4
and what it executed was this, according to the auto processing log:
qtube -f {'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio'} --merge-output-format mp4
This obviously failed, with an unavailable format error. I presume this is the result of some Jim stupidity somewhere.
-f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio" --merge-output-format mp4
or-f {bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio} --merge-output-format mp4
It helps to have some Lisp. I recommend "Structure and Interpretation of Computer Programs", which you can find online and was the basis of an introductory course at MIT (no...I still find JIM a strange language and need time to get my head around things like that lmap command
...
GOSUB 100
stuff for those students). In different ways, Jim aka TCL and JavaScript rework concepts from Lisp.And in fact those changes didn't have a useful effect because the problem is actually that the single-quoted parameter value is being passed to yt-dl inThe problem is the use of single quotes, it works with either double quotes" or braces {}
-f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio" --merge-output-format mp4
or
-f {bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio} --merge-output-format mp4
This works without the need for @/df's changes
...
"$@"
which quotes it again, so its command line has "'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio'"
; the shell strips the double quotes and yt-dl gets the parameter still with quotes, as can be seen by adding the -v option:...
[debug] Command-line args: [u'--config-location', u'/mod/etc/youtube-dl.conf', u'--newline', u'-v', u'-f', u"'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio'", u'--merge-output-format', u'mp4', u'https://www.bbc.co.uk/iplayer/episode/b08b7blz/absolutely-fabulous-the-movie']
...
"
.$@
is a near synonym for $*
; $*
expands to the positional parameters from $1
up; when quoted "$*"
expands to the quoted "$1 ... $n"
, whereas "$@"
expands to the individually quoted positional parameters from "$1"
up, or nothing at all if there are no positional parameters./mod/bin/youtube
, as now, uses "$@"
, the options field needs to use Jim quoting ({}
, ""
, \
) if an option value contains white space;$@
, the options field can use shell quoting instead (but some testing would be good to check \
and "
, which are escapes in both Jim and POSIX shell).qtube is a separate package to youtube-dl, and has to be re-installed separately after an RMA. Had you installed qtube instead of youtube-dl, youtube-dl would have been installed automatically as a dependency. Note you will need to show advanced packages.Any ideas for getting the front end to display?
Thanks.qtube is a separate package to youtube-dl, and has to be re-installed separately after an RMA.
-a /media/My\ Video/temp/DH-test.txt
/mod/webif/plugin/qtube/queue.hook
.#was
# set cmd "youtube --newline {*}$opts $url"
#new
set cmd {youtube --newline}
lappend cmd {*}$opts $url
/mod/webif/plugin/qtube/queue.jim
--- queue.jim.org
+++ queue.jim
@@ -15,7 +15,8 @@
set url [cgi_get url -]
set queue_time [cgi_get queue_time 0]
-set opts [cgi_get opts '']
+set opts [cgi_get opts {}]
#puts "queuing $url $opts"
-exec {*}qtube -start $queue_time {*}$opts $url >@stdout
+lappend opts $url
+exec qtube -start $queue_time {*}$opts >@stdout
-a
as the last parameter in the Options field and name a local batch file in the URL field, like so:14/10/2020 15:31:44 - Completed queued download of /tmp/te st.txt Options -F -a
-a
is used.