Jump to content
Ketarin forum


  • Posts

  • Joined

  • Last visited

Everything posted by Ambimind

  1. Ketarin exploits regular expression capture groups to return characters isolated from a larger matched set(example and explanation). A problem arises when one requires the use of capture groups for one of their original intended uses - "back references". The animation below demonstrates the problem and solution : Wrap the whole expression in parenthesis and increment any back references by 1.
  2. @shawn For now I've implemented the following solution: Using post-variables(see image below), each Ketarin-job-variable specifies a "redirection-delay", measured in seconds. Kuppet will wait for this duration after the initial page load, during which it is supposed that any landing-page-timers have completed and the actual page has begun to load, after which kuppet will wait till the page has finished loading(absence of network requests for 500ms).
  3. Got it - I can reproduce the behavior at will, now. Pardon my confusion; it was clearly stated in your original post.
  4. I'm unable to reproduce the behaviors you've described. I've attached the job I created to test it : It works fine with or without kuppet. cleantalk-spam-protect.xml
  5. Nice catch, thank you; I think it should be fixed now. If '-L' is used, it implies '-l', in which case, while '-L' is set, setting\unsetting '-l' has no effect. I've added a note about this in the help. To prove it to yourself, remove '-L', and set '-l', this should remove all log lines starting with "===:" and retain all those starting with "---:". Both can be excluded, in which case no logging occurs. I wasn't able to reproduce this. In order to avoid any possible confusion the '-V'(capitalized v) option is removed from the cmd-interface. If a request is served from cache, chrome is not launched. I found this may give the impression of inconsistency, when it is by design. I've updated the config file with the relevant key 'chromeVisible'; I suggest using 'true'/'false'(without quotes) in place of '0'/'1'. Usage Note When setting command line options within Ketarin global variables, the options must be quoted and separated by spaces, as shown below: if(!(PS kuppet -ea 0)) {START -win hidden BIN\kuppet '-v --port=9000'}
  6. @shawn Thanks for your feedback, many of the changes in the new version were motivated by it. Your questions and further feedback are welcome. @jusseppe Could you please try the latest version.
  7. Thanks for clearly reporting your problem, jusseppe. Please try the new version I've uploaded(see original post); I think I've found the cause of the error - entirely my fault. Also, see the working example I've uploaded. An alternative resolution : If your firewall is not blocking chrome and\or kuppet, you can try changing kuppets default working port : Tip : If you remove "-WindowStyle hidden" from the command line, kuppet will tell you a short story
  8. Download Link 17 April 2022 Update - In summary, kuppet now has a proper command-line interface, can be used standalone and also handles the shadow DOM. - All dependencies have been updated to their latest versions. - Documentation is now improved, please make use of -h or --help options to access it. 18 April 2022 Update - Fixed bug preventing application of user agent string - Removed "-V" options - Updated config file 21 April 2022 Update - Implemented request specific options through post data - Added post data option : redirection-delay - Improved readability of standard logs, "-l" Logitech_Options.xml
  9. The URL shown in solution A is taken from AIMP's windows download page. While it includes no obvious reference to an executable, when followed, their web server will always redirect to the latest version of AIMP's exe. When a Ketarin variable is provided a URL which does not refer to a file containing searchable textual content, it returns the file's HTTP headers instead; this feature is used to determine the latest version+build number, in solution A. When regular expressions employ "capturing groups"(eg. G1 & G2), only the first capturing group(G1) match, backed by red, is returned. This is true even when another, valid capturing group(G2) is matched(not marked by Ketarin). In this scenario blue backed text indicates the rest of the text matched by the regex - not returned. When capturing groups are absent from a regex, blue backed text indicates the match that will be returned as the variable value. Note : I've deliberately shortened the original regex to improve readability.
  10. I understand your ultimate goal to be : Retrieve AIMP's current version number, including build number, in the following format : [versionNumber].[build] Below I present two possible solutions using Ketarin. Solution A retrieves HTTP headers for the file, then extracts the version and build info from the file name - all within a single variable. Solution B uses two dependent variables : First the version+build string is extracted from the webpage in versionstr, then the ", build " text is removed using a replace function in version(note that version's contents is set to "Textual content").
  11. Please consult the following image to achieve your intended regex-goal.
  12. Please see image below for a complete description of the method : This is not a new feature; however it is very useful and sufficiently obscure that I was not aware of it, after several years of extensive Ketarin use.
  13. @Sydnelson What I do atm : 1. Create separate Ketarin jobs for each version. 2. During installation run both, but ... 3. Each job checks for the windows version and architecture appropriate for the program. 4. Installation occurs only when conditions are met. In case you need to download additional files, use Powershell's wget\Invoke-WebRequest, or GNU wget, stored next to the Ketarin executable, eg. "{startuppath}\BIN\wget.exe". If you're new to Ketarin I can provide a more detailed step-by-step answer if you like?
  14. @Etz What errors does Ketarin log show? Tried the script with slight modifications, to account for assumption not met by my system, without issue. Functional modifications : Finds executables in current app dir, rather than dir specified in "portable". Tested as an app\job specific script, not global. Global variable shortcuts = C:\ $PortableAppsPath = (Get-Item $app.CurrentLocation).DirectoryName $WShell = New-Object -ComObject WScript.Shell $Executables = Get-ChildItem (Get-Item $app.CurrentLocation).DirectoryName -Filter '*.exe' -Recurse if ($Executables.Count -gt 1) { $ShortCutPath = Join-Path $globalvars.'shortcuts'.CachedContent $app.Name if (-Not(Test-Path $ShortCutPath -PathType Container)) { New-Item $ShortCutPath -ItemType Directory -Force } } else { $ShortCutPath = Join-Path $globalvars.'shortcuts'.CachedContent $app.Name } foreach ($Executable in $Executables) { $ShortCut = $WShell.CreateShortcut("$ShortCutPath\$($Executable.BaseName).lnk") $Shortcut.TargetPath = $Executable.FullName $Shortcut.WorkingDirectory = (Join-Path $PortableAppsPath $App.Name) $Shortcut.IconLocation = $Executable.FullName $Shortcut.Save() }
  15. Thank you! ----- Download link : https://ketarin.org/download
  16. Thanks for the feedback. I've identified the number of download segments as cause for the difference between our results. In my original post the value is set to 1, resulting in an extended delay of 2-4 minutes - not present with segments set to 2 or more(your case). Seems to apply only to the first job run; after the file is downloaded successive job runs are not delayed in either case. I wrongly assumed failure because of this extended delay and lack of valid download indicator.
  17. Google Drive direct links not downloading, with unusual behavior Context Have written a Powershell script to get direct download URL of Google Drive stored files. The URL produced can be used in any web-browser to download the file directly, but not in Ketarin(depending on file type). To reproduce Import gdrive_test.xml into Ketarin. Update the job. Expected outcome Qualifications This behavior depends on the file-type : .zip and .mp4 files will fail, while .jpg and .doc files will download. Different files may be tested by changing the "gid" variable to a valid Google Drive file id(the included refers to a zip file). The derived url being used is logged under "====== GOOGLE DRIVE URL ======". Thanks for taking a look
  18. Thank you. It was a silly user(my) error, pardon me.
  19. After attempting to update to beta 4(thanks), I get the following - Ketarin does not start:
  20. Possible issue with multi-segment downloads To reproduce: 1. Set download options to : 2. Import and run attached job file : glasswire.xml Observed problem: 1. On update, Ketarine first presents the following error: 2. And then :
  21. I've attached a working job file which you can import into Ketarin(1.8.7) : File > Import. You will notice that no special settings are required to get it working. I believe Ketarin can handle simple file redirects of this kind without issue; however problems do arise when one is redirected to a website which requires running of javascript to generate the url. Please note that you must change the download directory according to your setup. Edit : On the next day the job stopped working, I've made the required changes and re-uploaded. FreeFileSync.xml
  22. Beta 3 : Impressions after a week of use : The new features are extremely useful, but they should be used sparingly. Specifically the use of url-variables-as-scripts, in custom columns : This means each job has a variable which holds a script; this variable is referenced and run to produce the value of a custom column. The script being run, in my case, compares the creation date of each file and calculates the days since update : (New-TimeSpan (GI $app.CurrentLocation).LastWriteTime (Date)).Days Issues were myriad and some intermittent : 5-10s startup times(~100 jobs) crash on start crash during update cycle unresponsive/flickering interface during update cycle app update checks timing out("connection timeout": 30) much slower over-all update cycle("parallel downloads":6) I also had a global (pre-download) script running, which added this 'script-variable' to jobs automatically(another new feature): #### ADD DATE VARIABLE IF NOT EXISTING # Parameters $varnm = "SinceUpdate" $vartp = "Textual" #StartEnd #Textual #RegularExpression # # Derived access property $varcnt = if($vartp -eq "Textual"){"TextualContent"}Else{"CachedContent"} # If it doesn't exist, then create a new one if(-Not $app.variables.$varnm){ ECHO "========== $varnm NOT FOUND ==========" $newvar = New-Object -TypeName Ketarin.UrlVariable -ArgumentList $varnm,$app.variables $newvar.VariableType = $vartp $app.variables.Add($varnm, $newvar) $app.Save() } #Set newly created variable $app.variables.$varnm.$varcnt = '(New-TimeSpan (GI $app.CurrentLocation).LastWriteTime (Date)).Days' #### I've had no issues with multi-segment downloads(using 4 segments). I'm not classing these behaviors as 'bugs', just something to keep in mind when using these features.
  • 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.