ketarin help needed.

Discuss Custom Apps used with d7x/dSupportSuite.
Forum rules
1. Try to give more than you take, when possible.
2. When posting for help, include d7x/dSupportSuite version, OS details, and steps to reproduce the issue.
3. Start a new topic for a new problem, don't just post on existing topics that are NOT your EXACT problem.
4. SEARCH THE FORUMS BEFORE STARTING A NEW TOPIC.

ketarin help needed.

Postby rharvey » Mon Sep 01, 2014 11:30 pm

I have ketarin setup by itself and I have it getting the files and putting them on my server for access later.
I have two files that are not downloading could some one please help me with the right info to make them download.
adwcleaner
libreoffice

thank you very much.
Robert Harvey
rharvey
 
Posts: 67
Joined: Wed Nov 13, 2013 1:45 am

Re: ketarin help needed.

Postby EagleTech » Mon Sep 08, 2014 1:41 pm

rharvey wrote:I have ketarin setup by itself and I have it getting the files and putting them on my server for access later.
I have two files that are not downloading could some one please help me with the right info to make them download.
adwcleaner
libreoffice

thank you very much.
Robert Harvey


Here are my messes. Adjust accordingly. HTH

LibreOffice
Code: Select all
<?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="c115e800-dba7-4aa1-81b3-818ff08a7512">
    <WebsiteUrl />
    <UserAgent>Wget/1.10.1</UserAgent>
    <UserNotes />
    <LastFileSize>224940032</LastFileSize>
    <LastFileDate>2014-09-02T17:34:50.4164801</LastFileDate>
    <IgnoreFileInformation>false</IgnoreFileInformation>
    <DownloadBeta>Avoid</DownloadBeta>
    <DownloadDate>2011-03-23T03:21:16</DownloadDate>
    <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
    <VariableChangeIndicator />
    <CanBeShared>false</CanBeShared>
    <ShareApplication>false</ShareApplication>
    <ExclusiveDownload>false</ExclusiveDownload>
    <HttpReferer>http://www.libreoffice.org/download/libreoffice-fresh/</HttpReferer>
    <SetupInstructions />
    <Variables>
      <item>
        <key>
          <string>version</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>StartEnd</VariableType>
            <Regex />
            <Url>https://wiki.documentfoundation.org/Main_Page</Url>
            <StartText>href="http://www.libreoffice.org/download/"&gt;Download LibreOffice </StartText>
            <EndText>&lt;/a</EndText>
            <Name>version</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>dl</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>[^"'=]+\.msi</Regex>
            <Url>{link}</Url>
            <Name>dl</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>link</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>[^"'=]+\.msi</Regex>
            <Url>http://www.libreoffice.org/download/libreoffice-fresh/</Url>
            <Name>link</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand />
    <ExecutePreCommand />
    <ExecuteCommandType>Batch</ExecuteCommandType>
    <ExecutePreCommandType>Batch</ExecutePreCommandType>
    <Category>Office Suites &amp; Tools</Category>
    <SourceType>FixedUrl</SourceType>
    <PreviousLocation>\\192.168.1.10\Support\!Ketarin - Support Update\..\Applications\Common Apps\LibreOffice_4.3.1_Win_x86.msi</PreviousLocation>
    <DeletePreviousFile>true</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId />
    <LastUpdated>2014-09-02T17:34:50.4164801</LastUpdated>
    <TargetPath>..\Applications\Common Apps\</TargetPath>
    <FixedDownloadUrl>{dl}</FixedDownloadUrl>
    <Name>LibreOffice</Name>
  </ApplicationJob>
</Jobs>



LibreOffice Helpfile (US Eng)
Code: Select all
<?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="005b2b3c-6390-4a7b-a3ea-3f96ad290df0">
    <WebsiteUrl>http://www.libreoffice.org</WebsiteUrl>
    <UserAgent>User-Agent:mozilla/5.0 (windows nt 5.1; en-US; rv:11.0) gecko/20100101 firefox/11.0</UserAgent>
    <UserNotes />
    <LastFileSize>5541888</LastFileSize>
    <LastFileDate>2014-09-02T17:34:59.2889876</LastFileDate>
    <IgnoreFileInformation>false</IgnoreFileInformation>
    <DownloadBeta>Default</DownloadBeta>
    <DownloadDate>2014-07-29T17:00:00.7216402</DownloadDate>
    <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
    <VariableChangeIndicator />
    <CanBeShared>false</CanBeShared>
    <ShareApplication>false</ShareApplication>
    <ExclusiveDownload>false</ExclusiveDownload>
    <HttpReferer />
    <SetupInstructions />
    <Variables>
      <item>
        <key>
          <string>appcat</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>{appname:regexreplace: \(.*\):}</TextualContent>
            <Name>appcat</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>appfile</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>{appname:multireplace:|:(|)| :|_|_}</TextualContent>
            <Name>appfile</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>version</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>LibreOffice_([^stable]*)_Win_x86_helppack_en-US.msi</Regex>
            <Url>http://www.libreoffice.org/download</Url>
            <Name>version</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>url</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>(http[^"]*_Win_x86_helppack_en-US.msi)</Regex>
            <Url>http://www.libreoffice.org/download</Url>
            <TextualContent>http://download.documentfoundation.org/libreoffice/stable/{version}/win/x86/LibreOffice_{version}_Win_x86_helppack_en-US.msi
</TextualContent>
            <Name>url</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand />
    <ExecutePreCommand />
    <ExecuteCommandType>Batch</ExecuteCommandType>
    <ExecutePreCommandType>Batch</ExecutePreCommandType>
    <Category>Office</Category>
    <SourceType>FixedUrl</SourceType>
    <PreviousLocation>\\192.168.1.10\Support\!Ketarin - Support Update\..\Applications\Common Apps\LibreOffice_4.3.1_Win_x86_helppack_en-US.msi</PreviousLocation>
    <DeletePreviousFile>true</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId />
    <LastUpdated>2014-09-02T17:34:59.2889876</LastUpdated>
    <TargetPath>..\Applications\Common Apps\</TargetPath>
    <FixedDownloadUrl>{url}</FixedDownloadUrl>
    <Name>LibreOffice (en-US Help Pack)</Name>
  </ApplicationJob>
</Jobs>



ADWCleaner (This one I just got from the online database.)
Code: Select all
<?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="d745e5b3-a30e-47dc-9733-bdc624921044">
    <WebsiteUrl>http://general-changelog-team.fr/en/downloads/viewdownload/20-outils-de-xplode/2-adwcleaner</WebsiteUrl>
    <UserAgent />
    <UserNotes />
    <LastFileSize>1354223</LastFileSize>
    <LastFileDate>2014-07-18T15:03:15.7622732</LastFileDate>
    <IgnoreFileInformation>false</IgnoreFileInformation>
    <DownloadBeta>Default</DownloadBeta>
    <DownloadDate>2014-07-27T21:10:36</DownloadDate>
    <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
    <VariableChangeIndicator />
    <CanBeShared>false</CanBeShared>
    <ShareApplication>true</ShareApplication>
    <ExclusiveDownload>false</ExclusiveDownload>
    <HttpReferer />
    <SetupInstructions />
    <Variables>
      <item>
        <key>
          <string>appcat</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>{appname:regexreplace: \(.*\):}</TextualContent>
            <Name>appcat</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>appfile</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>Textual</VariableType>
            <Regex />
            <TextualContent>{appname:multireplace:|:(|)| :|_|_}</TextualContent>
            <Name>appfile</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>version</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>(?&lt;=AdwCleaner.*?v)[0-9.]{2,}</Regex>
            <Url>https://toolslib.net/downloads/viewdownload/1-adwcleaner/</Url>
            <Name>version</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>url</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>does not begin automatically.*?href='(.+?)'</Regex>
            <Url>http://www.bleepingcomputer.com/download/adwcleaner/dl/125/</Url>
            <TextualContent>http://general-changelog-team.fr/en/downloads/finish/1/</TextualContent>
            <Name>url</Name>
          </UrlVariable>
        </value>
      </item>
      <item>
        <key>
          <string>test</string>
        </key>
        <value>
          <UrlVariable>
            <RegexRightToLeft>false</RegexRightToLeft>
            <VariableType>RegularExpression</VariableType>
            <Regex>(https://toolslib.net/downloads/finish/1/get/[^']*/)</Regex>
            <Url>https://toolslib.net/downloads/finish/1/</Url>
            <Name>test</Name>
          </UrlVariable>
        </value>
      </item>
    </Variables>
    <ExecuteCommand />
    <ExecutePreCommand />
    <ExecuteCommandType>Batch</ExecuteCommandType>
    <ExecutePreCommandType>Batch</ExecutePreCommandType>
    <Category>Security</Category>
    <SourceType>FixedUrl</SourceType>
    <PreviousLocation />
    <DeletePreviousFile>true</DeletePreviousFile>
    <Enabled>true</Enabled>
    <FileHippoId />
    <LastUpdated>2014-07-18T15:03:15.7622732</LastUpdated>
    <TargetPath />
    <FixedDownloadUrl>{url}</FixedDownloadUrl>
    <Name>AdwCleaner (Portable)</Name>
  </ApplicationJob>
</Jobs>
User avatar
EagleTech
 
Posts: 159
Joined: Thu Mar 21, 2013 6:15 pm
Location: IL, USA

Re: ketarin help needed.

Postby EagleTech » Mon Sep 08, 2014 1:48 pm

Here is my Ketarin Cheat Sheet for anyone who wants/needs it. I admit little knowledge of regex. Everything here is either from the Wiki, forums, or trial & error.

Feel free to correct or add to.

Ketarin Cheat Sheet.txt
Code: Select all
{version} (?<=Development Version.*?Version )[0-9.-]*
      Release version (\d+(?:\.\d+)*)

{url} (?<=Development version.*version.*href=").*?(?=")

Really handy user agent for sourceforge & more: Wget/1.10.1

https://ketarin.org/forum/index.php/topic/554-search-for-beautiful-regex-to-help-newbies/
===========================================================================================
Primarily there are only two groups of extensions that windows programs come in.

Binaries - rar/zip/7z (These only require to be unzipped to be installed)
Executables - exe/msineed (These can be either extracted using the program Universal Extractor, installed manually or silently with switches/parameters)
Extras/Addons - Things like greasemonkey userscripts that are .user.js or thunderbird/firefox addons which are .xpi

I use only one regex that works for EVERY app I have. Edited only in two ways for each app. One is I change the last three letters of my regex to the actual file extension I want to find. So from this

[^"'=]+\.zip

if I want to find an exe I just do

[^"'=]+\.exe

The \. is to tell the regex it has to find the period character, if you just put .zip it will find any character before zip which you don't want. So it would only find godilovezip from godilovezip.zip, which will return an error obviously.


To find specific words in URL (Like x32 or x64 builds) all you need to do is add the text after the first + sign. To find multiple just keep adding [^'']+ followed by the keyword. Keep in mind it is sequential.

[^"'=]+64[^"']+\.zip

Keep in mind that if the 64 is directly before the file extension the regex won't match, so just remove a character and you'll be fine. So the above would turn into [^"'=]+6[^"']+\.zip

If your download page lists the latest release from the bottom of the page instead of the top, just enclose your regex with .*( at the beginning and ) at the end. So it would end up looking like

.*([^"'=]+64[^"']+\.zip)

I have yet to find a way to 'exclude' specific words, more specifically words like source or src as sometimes the first match is a source file which I have no use for. I've been asking on a few forums but sometimes I need to be spoonfed then hit on the head.

For those instances where I have run into the source/src problem I just add extra inclusion words that aren't in the found source link.

Anything and everything i've garnished from Regex was from asking the people in this forum, who were kind enough to give me stuff to fiddle with and chew on. I would not say I have a good grasp of regex, just that this 'functions' and it the simplest one i've seen so far and seeing as our primary purpose for regex is to find the download link I believe this fits the bill.


SPECIAL CIRCUMSTANCES

There may be a time where that regex doesn't accurately capture download links that have an equal sign in them. To get that as well you only need to do the following.

[^"'=]+=[^"']+\.zip

Also a helpful hint is that if you find it is capturing some weird part of the page try adding / instead to make it look for something that has a folder structure.

[^"'=]+/[^"']+\.zip
===================================================================================================================


Function examples
------------------

Syntax for functions[/h]

{variable:function:argument1:argument2}


[h]Replace[/h]

version = 9.1.15
{version:replace:.:} = 9115
{version:replace:.:-} = 9-1-15


[h]Trim[/h]
version = " 9.1.15."
{version:trim} = 9.1.15.
{version:trim:.} = " 9.1.15"
{version:trim: .} = 9.1.15


[h]Trimend/Trimstart[/h]
version = 9.1.15.
{version:trimend:.} = 9.1.15
{version:trimstart:9.} = 1.15.


[h]ToUpper/ToLower[/h]
download = http:\\TEST
{download:toupper} = HTTP:\\TEST
{download:tolower} = http:\\test


[h]Split[/h]

version = 9.1.15
{version:split:.:0} = 9
{version:split:.:1} = 1
{version:split:.:2} = 15
{version:split:.:0}-{version:split:.:1} = 9-1


[h]Example #1[/h]

version = 9.0

hxxp://ardownload.adobe.com/pub/adobe/reader/win/{version:split:.:0}.x/{version}/deu/AdbeRdr{version:replace:.:}_de_DE.exe

results in

hxxp://ardownload.adobe.com/pub/adobe/reader/win/9.x/9.0/deu/AdbeRdr90_de_DE.exe


[h]Example #2[/h]

version = 4.2.9

hxxp://download2.asap-utilities.com/ASAPUtilities_setup_{version:replace:.:-}.exe

results in

hxxp://download2.asap-utilities.com/ASAPUtilities_setup_4-2-9.exe


[h]Example #3[/h]

version = 9.1.15 build 963

c:\MyFiles\Applicationname_{version:split: :0}b{version:split: :2}.exe
or
c:\MyFiles\Applicationname_{version:replace: build :b}.exe

results in

c:\MyFiles\Applicationname_9.1.15b963.exe
User avatar
EagleTech
 
Posts: 159
Joined: Thu Mar 21, 2013 6:15 pm
Location: IL, USA


Return to Custom Apps Discussion