Jump to content
Ketarin forum
shawn

Codeplex template

Recommended Posts

Updated 2012-10-28: fixes several bugs, but still doesn't work due to a filetime parsing issue. Any ideas?

 

Updated 2011-08-25: fixed another version parsing bug.

 

Updated 2010-12-28: fixed version number check for a number of codeplex apps. This still has problem with a few apps (bluetooth radar, iExporter, ilyrics, iringtones, mdownloader, pst view tool, smtp4dev - possibly others).

 

 

Here's a working Codeplex template with variables for the app name, category, slug, title and version preservation. Based on discussion from this thread. The template below was tested successfully with a full dozen apps on Codeplex without any problems. Enjoy!

 

<?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="debb1deb-1024-1975-abcd-000000000004">
   <Name><placeholder name="App name?" value="" /></Name>
   <Category><placeholder name="Application Category?" value="Unassigned" options="Unassigned|Browsers|Capture|Codecs|Converters|Development|Drivers|Editors|Education|Email|IM|Internet|Media|Plugins|Security|Tools|Viewers|VM|Web" /></Category>
   <WebsiteUrl />
   <UserAgent>Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)</UserAgent>
   <UserNotes />
   <IgnoreFileInformation>false</IgnoreFileInformation>
   <DownloadBeta>Default</DownloadBeta>
   <DownloadDate xsi:nil="true" />
   <CheckForUpdatesOnly>false</CheckForUpdatesOnly>
   <VariableChangeIndicator />
   <CanBeShared>true</CanBeShared>
   <ShareApplication>false</ShareApplication>
   <ExclusiveDownload>false</ExclusiveDownload>
   <HttpReferer>{sdownload}</HttpReferer>
   <SetupInstructions />
   <Variables>
  <item>
    <key>
	  <string>slug</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>Textual</VariableType>
	    <Regex />
	    <TextualContent><placeholder name="Codeplex application slug:" value="" /></TextualContent>
	    <Name>slug</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>title</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>Textual</VariableType>
	    <Regex />
	    <TextualContent><placeholder name="Codeplex application title:" value="" /></TextualContent>
	    <Name>title</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>schangelog</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>Textual</VariableType>
	    <Regex />
	    <TextualContent>http://{slug}.codeplex.com/releases/view/{releaseId}</TextualContent>
	    <Name>schangelog</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>swebsite</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>Textual</VariableType>
	    <Regex />
	    <TextualContent>http://{slug}.codeplex.com/</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>releaseId</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>RegularExpression</VariableType>
	    <Regex>href="http://{slug}.codeplex.com/releases/view/(\d+)"</Regex>
	    <Url>http://{slug}.codeplex.com/releases/</Url>
	    <Name>releaseId</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>fileId</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>RegularExpression</VariableType>
	    <Regex>fileId="([\d]+)" [^<>]+></Regex>
	    <Url>http://{slug}.codeplex.com/releases/view/{releaseId}</Url>
	    <Name>fileId</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>buildId</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>RegularExpression</VariableType>
	    <Regex>FileListItem.+?/v(\d+)/.+?".+?{fileId}</Regex>
	    <Url>http://{slug}.codeplex.com/releases/view/{releaseId}</Url>
	    <Name>buildId</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>filetime</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>RegularExpression</VariableType>
	    <Regex>{fileId}".+?smartDate dateOnly" title="([^"]+)"</Regex>
	    <Url>http://{slug}.codeplex.com/releases/view/{releaseId}</Url>
	    <Name>filetime</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>ft</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>RegularExpression</VariableType>
	    <Regex>\[(.+)\]</Regex>
	    <Url>http://12pd.com/filetime.php?t={filetime}</Url>
	    <Name>ft</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>version</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>RegularExpression</VariableType>
	    <Regex>(?:[\S\s][\.\sv])?([\d.]+?)(?:\s-\s[^\d]+?)?(?:\s\(.+?\))?[\r\n]*</title></Regex>
	    <Url>http://{slug}.codeplex.com/releases/view/{releaseId}</Url>
	    <Name>version</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>sdownload</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>Textual</VariableType>
	    <Regex />
	    <TextualContent>http://download.codeplex.com/Download/Release?ProjectName={slug}&DownloadId={fileId}&FileTime={ft}9900000&Build={buildId}</TextualContent>
	    <Name>sdownload</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>spost</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>Textual</VariableType>
	    <Regex />
	    <TextualContent>http://convert-get-proxy.appspot.com/server/?method=POST&url={sdownload:multireplace:,:&,?:%26,%3F}</TextualContent>
	    <Name>spost</Name>
	  </UrlVariable>
    </value>
  </item>
  <item>
    <key>
	  <string>spc</string>
    </key>
    <value>
	  <UrlVariable>
	    <RegexRightToLeft>false</RegexRightToLeft>
	    <VariableType>Textual</VariableType>
	    <Regex />
	    <TextualContent>codeplex</TextualContent>
	    <Name>spc</Name>
	  </UrlVariable>
    </value>
  </item>
   </Variables>
   <ExecuteCommand />
   <ExecutePreCommand />
   <ExecuteCommandType>Batch</ExecuteCommandType>
   <ExecutePreCommandType>Batch</ExecutePreCommandType>
   <SourceType>FixedUrl</SourceType>
   <DeletePreviousFile><placeholder name="Delete Previous Version?" value="true" options="true|false" /></DeletePreviousFile>
   <Enabled>true</Enabled>
   <FileHippoId />
   <TargetPath>.\{category}\{appname:regexreplace:([\s\t\r\n\-\\&\/]+):_}-{version}.{url:ext}</TargetPath>
   <FixedDownloadUrl>{sdownload}</FixedDownloadUrl>
 </ApplicationJob>
</Jobs>

Edited by shawn
Updated to current broken version

Share this post


Link to post
Share on other sites

I think the issue with those codeplex apps that don't work is a cookie handling thing (which should be "Cookie: LicenseAccepted{fileId}=true"). I've submitted a changeset to the proxy app on appengine that this uses and hopefully it'll get implemented soon. If so, cookie handling can be added and this *should* then work for all apps on Codeplex. :)

Share this post


Link to post
Share on other sites

I'm a little new to this, so bear with me as I'm learning. Just tried importing your template, but I'm not sure what to place in the prompted fields for "Codeplex application slug" and "Codeplex application title". I tried using the url for the slug but I just got an error. Any help would be appreciated!

Share this post


Link to post
Share on other sites
I'm a little new to this, so bear with me as I'm learning. Just tried importing your template, but I'm not sure what to place in the prompted fields for "Codeplex application slug" and "Codeplex application title". I tried using the url for the slug but I just got an error. Any help would be appreciated!

slug is the name of the app as it appreas on the address.For example: http://anolis.codeplex.com/ the slug is "anolis"(without quotes).Title is a bit more complex as some apps have title while others do not.Bringing anolis a an example it has a title called "Resourcer" that can be seen at

Share this post


Link to post
Share on other sites

I have a problem with vidcoder.Namely i want the x64 version but x86 is always downloaded.As i understand there is adjusted regex needed for FileId variable.

Perhaps update template so when creating an app user can choose to download reccomended file or other file.Obviously the could be problems if app has more than 2 versions for download so maybe something like: "always download file number 1/2/3 etc"?

 

Link: http://vidcoder.codeplex.com/releases/view/58650

Share this post


Link to post
Share on other sites

Hi Shawn,

 

Sounds like the beginning of the regex for the version must now be changed from

"<Regex>{slug} - Release" 

to

"<Regex>{slug} - Download"

 

HTH

(and thanks for this great template)

Share this post


Link to post
Share on other sites

Actually, there are other changes as well. Sometimes the download/release appear before the slug, and sometimes there is a tag name that appears after the slug (like a brief subtitle). I had been trying to find a consistent method for pulling the info to be able to consistently parse it, but got distracted with that paid work stuff. :)

 

As soon as I have a few hours to dig around with the Codeplex site I'll make it work the way it should.

Share this post


Link to post
Share on other sites

Yes, this template is currently broken. It looks like CodePlex is actively preventing the POST gateway used within the application from operating correctly.

 

There is a URL change as well ({sdownload} should be changed to "

http://{slug}.codeplex.com/releases/captureDownload?fileId={fileId}&allowRedirectToAds=false"), but with this change it should be working fine, and it's not. I don't have time at the moment to investigate further.

Share this post


Link to post
Share on other sites

I finally managed to get around their new deflection method (a filetime value that was near impossible to decipher). I have *one* working download from CodePlex now. I'll reverse engineer the changes and post the updated template (as long as it works reliably) soon.

Share this post


Link to post
Share on other sites

Sadly, no. I can't figure out how they're parsing the exact date and time based on the data they provide thru Codeplex.

 

I'm in the middle of several large jobs right now that are all time-sensitive, but as soon as I have a free moment I'm going to rewrite this using a .net parsing method to post the .net form back to itself (the way a normal browser would operate). This should make it work 100% of the time, but will require me to delve into newer aspects of Ketarin i haven't used much.

 

I have no estimate for when I'll be able to do this - it'll probably be another month or so. :(

Share this post


Link to post
Share on other sites

The most current template is in the first post. The issue I'm facing is that the file references require compiling a 64-bit filetime value from insufficient data (as far as I can tell). I was able to get it working for a couple individual files, but the formula used was invalid on different builds and apps, so it doesn't work reliably. If you have *any* ideas, I'm open to them, or you can just fix the template and share your revision with us. :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • 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.