Jump to content
Ketarin forum

{url:basefile} not working


illwill
 Share

Recommended Posts

the variable doesnt seem to work anymore :/

needed it to get the filename of the .rar I was downloading so I could rename the folder

"DrvBK2_1.rar" is the file name so i just want "DrvBK2_1"

 

 

log is this

E:\Repair>ren E:\Repair\Backup\{url:basefile} DriverBackup2

The filename, directory name, or volume label syntax is incorrect.

 

 

 

also new beta version doesn't resize the "execute the following commands after downloading" editbox when you drag the corner to resize the window, the top window "execute the following commands before downloading" works though

Edited by illwill
Link to comment
Share on other sites

  • 1 year later...

One option for that is to capture {url:basefile} to your own custom variable, then utilize that variable within your command.

 

Thank you for temporary solution. Now I'm just renaming app and using {appname} instead.

 

I'll add a "filenameWithoutExtension" function to the next version of Ketarin.

 

Thank you. It would be great.

Link to comment
Share on other sites

  • 8 months later...

I got an issue using {url:basefile} in my custom variables and "Save in Folder".

 

I would like to use part of the downloaded file name into the "Save in folder" field using part of url basefile (because the filename or the url basefile is the only location where the application version is, none web page displays it (for information the application is CopyTrans Manager)

 

So here are my custom variables:

url : http://fr.copytrans....php?program=CTM

ddl_basefile : {url:basefile}

version : {ddl_basefile:regexreplace:.*(\d+(?:\.\d+)+)\.\w+$:$1}

 

And "Save in folder" is :

..\Download\{name}\{version}\

 

But this not works, the folder name remains ..\Download\CopyTransManager

 

Help would be appreciated, Thanks !

Link to comment
Share on other sites

{url:basefile} is what you want, but I don't think you can assign it to a variable since the {url} variable depends on the other variables already being processed. Instead of using {ddl_basefile:regexreplace:.*(\d+(?:\.\d+)+)\.\w+$:$1} - have you tried with just {url:basefile} in the foldername?

Link to comment
Share on other sites

Problem is that I need to get version number from filename in order to save it into a dedicated folder (which include the version number) and the issue is that the version number is displayed nowhere on the website, only in the downloaded filename.

Link to comment
Share on other sites

Not a direct solution (download to a folder named the version number which isn't exposed until you download it), but you could use a post-download script to effect the same thing. For example, pass the {url:basefile} into batch, which would then do something like this (trial and error will be necessary to get it right):

SET fOLD={url:basefile}
SET fNEW=%FOLD:CopyTransManagerFRv=%
pushd "..\Download\{name}\"
mv "%fOLD%" "%fNEW%"

 

I don't recall if batch is now processed sequentially or not (it's been a while), but you can execute this all as one command with:

SET fOLD={url:basefile}&& SET fNEW=%FOLD:CopyTransManagerFRv=%&& pushd "..\Download\{name}\"&& mv "%fOLD%" "%fNEW%"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.