Jump to content
Ketarin forum

shawn

Moderators
  • Posts

    1,181
  • Joined

  • Last visited

Everything posted by shawn

  1. We both gave you answers to accomplish your request using advanced options. Perhaps we need to show you the simplest method: Click the "Add new application" button. In the resulting New Application window: 1) Select either "save to file" or "save in folder" as the default behavior. 2) Enter the path or filename ({variables} OK!) 3) Click "Save as default" Every new application you create after this point will use these settings. Any other aspects you assign before clicking "Save as default" will also be assigned to new applications, such as category, new default variables, download source/URL and so on.
  2. There have been several issues with FileHippo support over the years. It would not surprise me at all that FileHippo has changed something and it doesn't work again. I don't use FileHippo anymore since it's been unreliable, so you really have two options: configure your downloads to use a different source, or wait until a new release resolves whatever is going on with FileHippo. @floele ?
  3. I use the following download file pattern for almost all my apps: ..\{category}\{appname:regexreplace:([\s\t\r\n\-\&]+):_}-{version}.{url:ext} This downloads to the directory above where Ketarin is running from, into a folder named for the Category, using the "Application name" field value, sanitizing it for troublesome characters, then a hyphen and the value of the version (automatically generated in FileHippo downloads, manually parsed otherwise), then a dot and the extension of the file. Sometimes these rules are inappropriate, for example if it's a tar.gz file or you want to add more information to it, like bit-type or OS compatible version, or if there isn't really a "version" per se. In these cases you just need to modify the template. For files without versions I use a timestamp instead ({f:yyyy}{f:MM}{f:dd}T{f:HH}{f:mm}{f:ss}). The most important thing is to be consistent. Setting them all up consistently is a heck of a lot easier if you start that way or only have to fix a dozen or two than it is after you have 700+ (speaking from experience).
  4. If you want to keep all downloaded versions, you can do this on the current release version by just UNselecting the option "always delete previously downloaded file" on the Advanced tab and using something like "-v{version}" in the filename you save it as. The new feature allows you to keep the last "x" versions. Instead of simply keeping all downloads or only the current download, the new feature adds the ability to keep the most recent 2, 3, 10 or whatever number of releases you like, and deletes any downloads older than that.
  5. @omid - you can search for apps directly within Ketarin using the chevron beside "Add new application" and selecting "Import from online database...". @floele - has there been a reset to the forum Apps database or an update to the forum that might prevent it from functioning?
  6. this may be a side-effect of a forum update. it's caused this kind of problem in the past.
  7. Documentation is available at the wiki: https://wiki.ketarin.org/index.php/Ketarin_Wiki
  8. Ketarin is not a git client. It does support triggers, so you could configure Ketarin to perform a git clone instead of updating by downloading the zip or whatever. Setup your app in Ketarin with some method to parse for changes (such as version number or the timestamp of the changelog), then use the "before updating" command to call your git clone.
  9. They're probably performing user-agent validation. I just tried the link with a browser, curl, wget, and with curl using a Chrome user-agent. None failed. I even tried using curl with the default Ketarin user-agent ("Mozilla/4.0+(compatible;+Ketarin;++https://ketarin.org/)") and that worked too. You have probably replaced the default user-agent on the Advanced Settings tab with one OneDrive doesn't like. Remove your custom UA or replace it with a standard generic UA and you'll probably be okay. Running as administrator should almost never be necessary. If you're not downloading to a protected directory (ProgramFiles, Windows, certain subfolders under ProgramData), a drive or folder without your user being granted NTFS write permissions, or a network share that has limited availability, then you should not have any need to run elevated. Also, running elevated would make no difference in the OneDrive server response. It is entirely possible that OneDrive was just having problems and the cached redirect worked fine in your browser but did not work in Ketarin since Ketarin re-parses it each time. MS has had several network issues over the last couple months that would account for this problem, though none reported in the last week. It could also be a network issue with your own ISP that would result in the same problem. I have several local clients that can't visit some websites because a local ISP has had backbone connectivity problems for over 2 months now. Repeatedly reporting the problem to them has gone unacknowledged. Using a VPN, these clients have been able to work around their backbone connectivity issues. This might be a solution for you assuming that it's a similar problem. Seeing the actual server response would be a good place to start troubleshooting if changing the UA doesn't help. You can use the "when an application update fails" script to pipe the values to a text file.
  10. About every other time I run 'Update all' in Ketarin (1.8.11) anymore it crashes after about a minute. It wasn't until recently that I realized that it appears to happen while processing the below app. The error message is attached below, too. Any help anyone can provide is welcome. The error message references powershell, and this may have started around the time I updated my post-script collection routine, which makes sense. This script publishes all the update information to my website so I can automate updates on client devices. Here's the new version of that: #### Support function PKV { Param( $svName ) #### identify variable type and collect stored content $svType = $app.variables.$svName.VariableType; if( $svType -eq "Textual" ){ #### stored text content $svContent = $app.variables.$svName.TextualContent; #### process all child variables if( $svContent -like '*{*' ){ $svContent2 = $app.variables.ReplaceAllInString("{$svName}", $sfiletime, $sfilename, $true); if ( $svContent2 -ne '' ){ $svContent = $svContent2; } } }else{ #### other types of variables must be parsed $svContent = $app.variables.ReplaceAllInString("{$svName}", $sfiletime, $sfilename, $true); } #### parse version for psversion if it exists if( $svName -eq "version" ){ if( $app.variables."psversion".TextualContent -ne "" ){ $svContent = $app.variables.ReplaceAllInString("{$svName}", $sfiletime, $sfilename, $true); } } if( $svContent -eq "{$svName}" ){ $svContent = ''; } Write-Information $svName':'$svContent; $svContent } #### #### Parse cached variable values $sname = $($App.Name); $sfilename = $($App.CurrentLocation); write-host 'Filename:'$sfilename; $sappguid = $($App.Guid); write-host 'Guid:'$sappguid; $scategory = $($App.Category); if($scategory -eq "{category}"){$scategory = '';} write-host 'scategory:'$scategory; $sfiletime = [datetime]$( (Get-Item $sfilename).LastWriteTime ); write-host 'Filetime:'$sfiletime; $sversion = PKV ( 'version' ); $svendor = PKV ( 'svendor' ); $sslug = PKV ( 'spc' ); $stag = PKV ( 'stag' ); $smethod = PKV ( 'smethod' ); $spath = PKV ( 'spath' ); $sparams = PKV ( 'sparams' ); $sformat = PKV ( 'sformat' ); $swebsite = PKV ( 'swebsite' ); $schangelog = PKV ( 'schangelog' ); $sdownload = PKV ( 'sdownload' ); $splatform = PKV ( 'splatform' ); $sbits = PKV ( 'sbits' ); $snotes = PKV ( 'snotes' ); #### #### Append current log details Try{ ( "`n$($scategory)`t$($sslug)`t$($sname)`t$($sversion)`t$($snotes)`t$($schangelog)`t$($swebsite)" | Out-File Updates.txt -Append -Encoding "UTF8" ) } Catch { echo 'Can not write to Updates.txt'; echo "`n$($scategory)`t$($sslug)`t$($sname)`t$($sversion)`t$($snotes)`t$($schangelog)`t$($swebsite)"; } #### #### Update ... is.xml Live # POST data echo 'Posting update information to ...'; $postParams = @{ 'key'='...'; 'vendor'=$($svendor); 'name'=$($sname); 'version'=$($sversion); 'slug'=$($sslug); 'tag'=$($stag); 'method'=$($smethod); 'path'=$($spath); 'params'=$($sparams); 'format'=$($sformat); 'category'=$($scategory); 'website'=$($swebsite); 'changelog'=$($schangelog); 'download'=$($sdownload); 'platform'=$($splatform); 'bits'=$($sbits); 'notes'=$($snotes); 'appguid'=$($sappguid); } echo 'Post body:'; $postParams.GetEnumerator() | % { "$($_.Name)=$($_.Value)" }; $postResult = Invoke-WebRequest -Uri "https://example.com/post.php" -Method POST -Body $postParams echo 'Post results'; echo $postResult.Content; #### #### ADD DATE VARIABLE IF NOT EXISTING # Parameters $varnm = "LastUpdate" $vartp = "Textual" #StartEnd or #Textual or #RegularExpression # # Derived access property, ie. app.variables.$varnm.$varcnt $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, ADDING IT ==========" # # Add var to job/app $newvar = New-Object -TypeName Ketarin.UrlVariable -ArgumentList $varnm,$app.variables $newvar.VariableType = $vartp $app.variables.Add($varnm, $newvar) $app.Save() } #Set it to the current date, short format(should be sortable) $app.variables.$varnm.$varcnt = Get-Date -UFormat %Y%m%dT%H%M # #### <?xml version='1.0' encoding='utf-8'?> <Jobs> <ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="5e10ff93-d903-42b4-9364-5660e1ab35e5"> <Category>Development</Category> <WebsiteUrl /> <UserAgent /> <UserNotes /> <LastFileSize>9542280</LastFileSize> <LastFileDate>2020-08-02T11:53:48.0018496</LastFileDate> <IgnoreFileInformation>false</IgnoreFileInformation> <DownloadBeta>Default</DownloadBeta> <DownloadDate xsi:nil="true" /> <CheckForUpdatesOnly>false</CheckForUpdatesOnly> <VariableChangeIndicator>version</VariableChangeIndicator> <HashVariable /> <HashType>None</HashType> <CanBeShared>true</CanBeShared> <ShareApplication>false</ShareApplication> <ExclusiveDownload>false</ExclusiveDownload> <HttpReferer /> <SetupInstructions /> <Variables> <item> <key> <string>schangelog</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>https://developer.android.com/studio/releases/platform-tools</TextualContent> <Name>schangelog</Name> </UrlVariable> </value> </item> <item> <key> <string>swebsite</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>https://developer.android.com/studio/releases/platform-tools</TextualContent> <Name>swebsite</Name> </UrlVariable> </value> </item> <item> <key> <string>snotes</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent /> <Name>snotes</Name> </UrlVariable> </value> </item> <item> <key> <string>spc</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>adblinux</TextualContent> <Name>spc</Name> </UrlVariable> </value> </item> <item> <key> <string>splatform</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>linux</TextualContent> <Name>splatform</Name> </UrlVariable> </value> </item> <item> <key> <string>sbits</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <Name>sbits</Name> </UrlVariable> </value> </item> <item> <key> <string>svendor</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>Google</TextualContent> <Name>svendor</Name> </UrlVariable> </value> </item> <item> <key> <string>version</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>RegularExpression</VariableType> <Regex>([\d\.]+)\s\(</Regex> <Url>https://developer.android.com/studio/releases/platform-tools</Url> <TextualContent /> <Name>version</Name> </UrlVariable> </value> </item> <item> <key> <string>sdownload</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>https://dl.google.com/android/repository/platform-tools-latest-linux.zip</TextualContent> <Name>sdownload</Name> </UrlVariable> </value> </item> <item> <key> <string>LastUpdate</string> </key> <value> <UrlVariable> <RegexRightToLeft>false</RegexRightToLeft> <VariableType>Textual</VariableType> <Regex /> <TextualContent>20200802T1153</TextualContent> <Name>LastUpdate</Name> </UrlVariable> </value> </item> </Variables> <ExecuteCommand /> <ExecutePreCommand /> <ExecuteCommandType>Batch</ExecuteCommandType> <ExecutePreCommandType>Batch</ExecutePreCommandType> <SourceType>FixedUrl</SourceType> <PreviousLocation>K:\_Ketarin\Ketarin\..\Development\ADB_(Linux)-30.0.4.zip</PreviousLocation> <DeletePreviousFile>true</DeletePreviousFile> <Enabled>false</Enabled> <FileHippoId /> <LastUpdated>2020-08-02T11:53:48.0018496</LastUpdated> <TargetPath>..\{category}\{appname:regexreplace:([\s\t\r\n\-\&amp;]+):_}-{version}.{url:ext}</TargetPath> <FixedDownloadUrl>{sdownload}</FixedDownloadUrl> <Name>ADB (Linux)</Name> </ApplicationJob> </Jobs>
  11. Hi, all, I'm seeing some VERY weird behavior with Adobe right now. Up until yesterday every Adobe Reader release was published to their FTP server the night before it was officially announced, and publicly announced via their PSIRT/security page and their release notes almost simultaneously upon release. I've been parsing the version from the release notes and building the download link based on the FTP server path but replacing ftp with https. This week their release was different. It never touched the FTP server. In fact, the current release (20.013.20074) is still not there, but it is downloadable through their ardownload2 server...but I can't automate detection of filenames through their FTP server anymore this way. Grrrr. Bottom line: Does anyone know what they've done with their FTP server? Where can I parse their new FTP data from? Thanks!
  12. Yes, you just use equal signs separating each field/value pair, and ampersands separating each form element. url ? field1 = value1 & field2 = value2 & field3 = value3 Be aware that form elements (fields and values) using certain characters MUST be URL-encoded in order to appear in a GET request (or in the DATA element of a POST request). This includes all percentage signs, white space, quotes, equals, ampersands, and several other characters. URL-encoding is NOT the same thing as HTML-encoding. URL-encoding uses a percentage sign then the two hexadecimal values of the ASCII table for the character. HTML encoding uses an ampersand then either a named value or a numeric value followed by a semicolon. None of this applied to the specific form in this instance. The RFCs that explain all of this are a great read if you want to understand the how and why of all this crap. If you get bored you should just read them all. Really.
  13. I assume you have actually downloaded wget? You may have to fake the user-agent involved, as some servers don't play well with Wget. That's the "--user-agent" switch. The one below is the most generic current user-agent. To use the value from a variable in the filename just use that in the command: wget -N --user-agent=Mozilla/5.0 --output-document="{file:directory}\{film}.jpg" "{imagebook}" To troubleshoot this you can look in the log (View, Show Log) to see what the replacement values are, or you can just echo the command to a text file then try the same command from the text file in a command prompt to see how the server is responding: echo.wget -N --user-agent=Mozilla/5.0 --output-document="{file:directory}\{film}.jpg" "{imagebook}">>{startuppath}\test.txt Then open "{startuppath}\test.txt".
  14. This is another one of those situations where you *could* go to all the effort of recreating the form, or you could just convert it to a GET request instead of a POST request and it works fine. I've tried that link in several browsers without session ties and it works fine in all of them. You might need to change the user-agent for the app profile, but it should work fine once it's using that GET-form URL. The site might change various field values at some point, and you could easily map them out using variable assignments instead. I doubt it will happen often enough to make it worthwhile to parse the page, though. There are only two fields and the structure looks to be very simplistic.
  15. Kinda. You can either create a second app profile for the other resource, or you can use a post-download script and download it using an external downloader, such as Wget or cURL. For these I usually use wget: wget -N --output-document="{file:directory}\{imagebook:filename}" "{imagebook}"
  16. When including screenshots it's best to also include the specific regex patterns or other data as text so it's easier to read. Your problem is in the second parentheses group. It should either have the parentheses removed or have "?:" included to make it a non-capturing group. Note in my example that I only attempted to capture the final group. If you capture previous text regex will stop processing there.
  17. One issue with this method is that it can not determine the real extensions of the selected files, so you MUST know these before hand or use another parsing method to determine the selected file extensions. Assuming they're all AVI is likely going to be a problem.
  18. Assuming you're using aria2c 1.32 or later, you can use a syntax like the one I use for Tails: aria2c --bt-require-crypto=true --seed-time=0 --dir="{file:directory}" --torrent-file="{file}" --select-file=1-2 --index-out=1="{appname:regexreplace:([\s\t\r\n\-\\&\/]+):_}-{version}.iso" --index-out=2="{appname:regexreplace:([\s\t\r\n\-\\&\/]+):_}-{version}.sig" This command is used in the "after update command", and the "download" is the torrent file. In this example, the --select-file switch enables grabbing the first and second files from the torrent. The --index-out switch renames the output files to the same massaged format I use in my previous comment. Note the syntax of --index-out switch includes =#= where # represents the index of the output file, and the second portion of the parameter is the output filename.
  19. You'll need to look at the source of the site and see what it's actually doing. It could be doing anything and without the source it's impossible to know.
  20. By the way, it's much easier to help troubleshoot and demonstrate fixes if you share an application XML profile. Do this by selecting it within the list of applications in Ketarin, then use CTRL+C to copy. This will copy the application XML profile to the clipboard. Then either paste that into a new text file and attach it, or include it in a code block on the forum. You can also copy & paste the application XML profile directly back into Ketarin to duplicate it or to copy one from the site.
  21. Ah, I think I understand what you're having trouble with. If you want/need the file to be named something specific you need to use the "save-to-file" option instead of the "save-in-folder" option. This field allows you to use variables to store relevant information within it, and if you want to vastly simplify an otherwise ugly filename you can do that as well. Here's a couple examples, again, from my FFmpeg profile. This pattern ("..\{category}\{appname:regexreplace:([\s\t\r\n\-\&]+):_}-{version}.{url:ext}") stores the downloaded file in a folder named "Converters" one folder ABOVE where Ketarin.exe is stored. The new file was named "..\Converters\FFmpeg-N-99959-g09f1d15ae8.zip" for today's file, since it is the AppName ("FFmpeg" - from the first line from this window) with various character sequences replaced with underscores (a safety precaution for some of my other apps), a dash, the version number (N-99959-g09f1d15ae8), then a dot (".") and the extension that would otherwise be applied from the URL (zip). This one - the only change is the download location, to "ffmpeg.{url:ext}". This one will store the file beside Ketarin.exe, named "ffmpeg.zip". You can use these patterns, or any other variable you've composed, in the "download location" as long as the save-to-file option is selected. You can also just use a static string like "president.zip" or whatever else might suit your purposes best.
  22. This is by design. RegEx is an explicit language and the syntax is intended to be consistent. If you want to select the second or third instance just include the regex twice (for the second instance) or three times (for the third instance), and so on, with ".+?" connectors. Here's an example for selecting the newest and two other recent versions of FFmpeg from here. First instance: (/[^'"<>]+win64-gpl.zip) Second instance: /[^'"<>]+win64-gpl.zip.+?(/[^'"<>]+win64-gpl.zip) Third instance: /[^'"<>]+win64-gpl.zip.+?/[^'"<>]+win64-gpl.zip.+?(/[^'"<>]+win64-gpl.zip)
  23. {myvar:replace:é:e} If that doesn't work (likely because the characters aren't actually "é", just represented that way in your language), you can use an exclusive form of regexreplace: {myvar:regexreplace:([^a-z0-9\.\s]+):e} You'll have to know and include all legitimate and likely characters from the value of {myvar} into the exclusion block to make sure legitimate characters are not replaced.
  24. Two issues I see. 1) I think you're confusing the Ketarin term "global variable" with PowerShell variables. 2) PowerShell scripts are self-contained - they don't exist outside of themselves and any values you want to use within a script need to be extracted within the script itself. However, to address your problem I recommend just adding the folder your 7zip executable is in (or the folder Ketarin resides within) to the PATH variable so you can avoid the problem completely. We've had similar issues like this in the past and I know many of us have added our Ketarin folders to the PATH and we just put our utilities in the same folder as Ketarin.
×
×
  • 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.