Help and Support
Ask a question, report a problem, request a feature...
<<  Back To Forum

v2.32a2 - Shell command on completion working much better

by Bugmagnet on 2016/01/30 03:02:28 AM    
New for alpha 2:
-file completion shell commands support additional placeholders $path $basepath $name $ext

example of a simple command to convert an incoming video file in .avi format to .mp4 format:

.avi:ffmpeg -i %1 M:\avi2mp4\$name+avi2.mp4

The %1 variable is expanded to the full path of the file where Tixati has saved it on download.

ffmpeg sees the desired output format by the extension mp4 and automatically chooses the appropriate codecs (unless user sets other codecs to be used with additional parameters).

The converted file is saved with the original filename (expanded from the $name variable) with "+avi2" appended in whatever folder is defined in the command line.

Now short and sweet.
by Bugmagnet on 2016/01/31 08:33:56 AM    
*   )                   )    
` )  /( (      )    )  ( /( (  
( )(_)))\  ( /( ( /(  )\()))\  
(_(_())((_) )\()))(_))(_))/((_)
|_   _| (_)((_)\((_)_ | |_  (_)
 | |   | |\ \ // _` ||  _| | |
 |_|   |_|/_\_\\__,_| \__| |_|
                               

(                                                              ____
)\ )           (       )    )           (                     |   /
(()/(   (    (  )\   ( /( ( /(    (    ( )\    (   (           |  /  
/(_)) ))\  ))\((_)  )\()))\())  ))\   )((_)  ))\  )(    (     | /  
(_))_|/((_)/((_)_   (_))/((_)\  /((_) ((_)_  /((_)(()\   )\ )  |/    
| |_ (_)) (_)) | |  | |_ | |(_)(_))    | _ )(_))   ((_) _(_/( (      
| __|/ -_)/ -_)| |  |  _|| ' \ / -_)   | _ \/ -_) | '_|| ' \)))\    
|_|  \___|\___||_|   \__||_||_|\___|   |___/\___| |_|  |_||_|((_)    
                                                                   

(monospaced font - you know the drill :)
by Bugmagnet on 2016/02/01 11:33:21 PM    
the command line I posted earlier:

.avi:ffmpeg -i %1 M:\avi2mp4\$name+avi2.mp4

...is not reliable when used on the current alpha.

As of v2.32 alpha 2, while %1 is internally quoted by Tixati on output to the ffmpeg command line, the $name variable is not. As long as the filename has no spaces it will work ok, but if it has spaces, this scripted line fails.

For now, when referencing the additional variables $path $basepath or $name, they should be within quotes so as to mask any spaces they might contain, thus preventing a break on space.

The revised command adding double quotes to the output target, as:

.avi:ffmpeg -i %1 "M:\avi2mp4\$name+avi2.mp4"

seems to work for me and will protect any spaces that might exist in your output target path or the expanded $name variable.
by jezloki on 2016/02/02 01:25:15 PM    
can this be used to run a batch script on completion or filebot?
by Bugmagnet on 2016/02/03 05:31:59 AM    
yes. Before this was fixed in v2.32 alpha 2, only one variable was available for output, the full path/filename as %1.

In my trivial use, I needed to extract the filename from that path but Tixati couldn't do that. So I had to call a batch file that had a single line in it, part of which was to assign 1% as the source to input and then imbedded %~n1 in my code which the shell expanded to the existing filename for use in the output.

before alpha 2, I did this:

.avi:convert.bat %1

and convert.bat contained this command line:

ffmpeg -i %1 M:\avi2mp4\%~n1-avi2.mp4

As of alpha 2, since several path parameters are definable, this can be done in Taxati without needing to call the external batch file:

.avi:ffmpeg -i %1 "M:\avi2mp4\$name+avi2.mp4"

The basics are at http://support.tixati.com/file%20completion%20shell%20commands  but this sparse info has not yet been updated to reflect the new options available, per the change log:

-file completion shell commands support additional placeholders $path $basepath $name $ext
-multiple file completion shell commands for same extension/type now supported
-other minor fixes to prevent file completion shell commands from running when checking or moving

Tixati enables this function to trigger when the entire torrent xfer is completed, when any file is completed or when a file of a specific type/ext is completed. You are free to work your script magic from there.  and if you want to join, there is a new channel on Tixati focused on just this:  Scripts Я Us  

dsc:r4fn2qiat7eaqj7y64kj2zmjqmxnyshq43sr6g73op6hogaza4tq?dn=%E2%96%82%E2%96%83%E2%96%85%E2%96%86%E2%96%87%E2%96%93%E2%96%91%E2%96%BA%20Scripts%20%D0%AF%20Us%20%E2%97%84%E2%96%91%E2%96%93%E2%96%87%E2%96%86%E2%96%85%E2%96%83%E2%96%82




This web site is powered by Super Simple Server