Jump to content
Ketarin forum

Easy solution to SourceForge downloads.


Tomorrow
 Share

Recommended Posts

For a while now i've been using a simple yet reliable method of making SF apps the easy way.Now it's about time i share how exactly i do it.Before i start i will point out the good and bad things of my approach compared to other SF methods already posted here.

 

+ No need for User Agent.All downloads work without it.

+ No need to know regex.

+ Faster then other methods.

+ Ability to choose specific mirror geographically closest to you.

+ Making an new app is fast.

 

- Potetially less reliable since single predefined mirror is used.

- Potetially less reliable if regex is not used(this is users choiche tho).

- Could break if the specific mirror goes offline or webpage content changes so much that start/end variables no longer work.

- Sometimes the version number can't be captured correctly with start/end.

 

-----------------------------------------------------------------------

 

1.Find the app and specific package(some apps have beta,x86 and other versions separately):

 

For this tutorial i specificly choosed an app i have not used before - Filezilla

Filezilla seems to have 3 packages: Unstable,Client and Server.Say that i want the Client package in EXE format for Win32.First i always open the /files subpage of the specific app.So now i choose the latest package which seems to be FileZilla_3.3.5.1_win32-setup.exe .I initiate download via browser(I use Firefox).

 

2.Identify URL of the download:

 

Now that i have downloaded the package i select Copy Download Link from Firefox download manages.All modern browsers should support similar functionality.So the download seems to have come from

http://ovh.dl.sourceforge.net/project/filezilla/FileZilla_Client/3.3.5.1/FileZilla_3.3.5.1_win32-setup.exe

 

3.Capture the version number:

Seems that the download link is very simple and only parts that need to be replaced by variable are the version numbers.

Now i could capture the version number from the official page i just downloaded the package but the page takes time to load.What i will do instead is capture the version number from the mirror download directory.As it's text only it loads very fast and it's more reliable in terms of start/end variables not breaking than the official page.

There are a few mirrors i always tend to use but generally Netcologne is the best as it's one of the biggest(meaning it should have majority of the files available) and it offers good speeds to European users.If you live elsewhere and want to try mirror that's closer to you you can see them in here: SF Mirror List .The name you want is the short name in the second column.So in my case

http://ovh.dl.sourceforge.net/project/filezilla/FileZilla_Client/

becomes

http://netcologne.dl.sourceforge.net/project/filezilla/FileZilla_Client/

This is also the url i will extract the version number from.Notice that you need:

http://<mirror short name>.dl.sourceforge.net/project/<project name>/<project package subfolder>/

 

Capturing the correct version generally requires to sort the directory by package names.This is always not starightforward as the newest package is not always placed at the top.Also this sorting places

?C=N;O=D

at the end of the URl so it looks like this:

http://netcologne.dl.sourceforge.net/project/filezilla/FileZilla_Client/?C=N;O=D

Now i capture the version.As you can see from the picture and as i mentioned at the start of this tutorial you can't always capture the newest version correctly(i can capture 3.3.5.1 yes but it will break when update comes because part of the start variable captures 3.3.5 package date and since this changes with next release the....well you understand).In this case i would need 3.3.5.1 but no sorting method can put this at the top or bottom.As an example i capture 3.3.5 then:

74634079.jpg

 

4.Download URL in Ketarin:

 

Now i enter

http://netcologne.dl.sourceforge.net/project/filezilla/FileZilla_Client/{version}/FileZilla_{version}_win32-setup.exe

as the download URL.Assuming you didn't have problems capturing the latest version number you should now have a working and fast app from SF ;)

Link to comment
Share on other sites

  • 11 months later...

Nice! But really need use regex, because look at this:

http://mesh.dl.sourceforge.net/project/crengine/CoolReader3/cr3-3.0.48/

cr3.0.48-3-win32-20110720.zip — Epic Fail :)

 

sample:

e69c74a7e3dc167bf66597190316b6c4.png

http://mesh.dl.sourceforge.net/project/crengine/CoolReader3/{version}/{filename}

 

PS: Better regex:

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

Link to comment
Share on other sites

and other strange thing:

look at

http://mesh.dl.sourceforge.net/project/akelpad/AkelPad%204/?C=M;O=D

latest version is: 4.6.3 13-Jul-2011 19:49

and look at this:

https://sourceforge.net/projects/akelpad/files/AkelPad%204/

latest version is: 4.7.2 2011-12-15

Link to comment
Share on other sites

sample template for get latest files:

<?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="99a223e4-5a83-4268-9e22-53795eb9ac7a">
<WebsiteUrl />
<UserAgent>Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2</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>http://sourceforge.net/</HttpReferer>
<SetupInstructions />
<Variables>
  <item>
	<key>
	  <string>getfile</string>
	</key>
	<value>
	  <UrlVariable>
		<RegexRightToLeft>false</RegexRightToLeft>
		<VariableType>RegularExpression</VariableType>
		<Regex>project/{sftag}/[^"'=]+\.{fileext}</Regex>
		<Url>http://sourceforge.net/projects/{sftag}/files/latest/download</Url>
		<Name>getfile</Name>
	  </UrlVariable>
	</value>
  </item>
  <item>
	<key>
	  <string>sftag</string>
	</key>
	<value>
	  <UrlVariable>
		<RegexRightToLeft>false</RegexRightToLeft>
		<VariableType>Textual</VariableType>
		<Regex />
		<TextualContent><placeholder name="What is the SF application tag?" value="" /></TextualContent>
		<Name>sftag</Name>
	  </UrlVariable>
	</value>
  </item>
  <item>
	<key>
	  <string>fileext</string>
	</key>
	<value>
	  <UrlVariable>
		<RegexRightToLeft>false</RegexRightToLeft>
		<VariableType>Textual</VariableType>
		<Regex />
		<TextualContent><placeholder name="Which is file extension, e.g. zip?" value="zip" /></TextualContent>
		<Name>fileext</Name>
	  </UrlVariable>
	</value>
  </item>
</Variables>
<ExecuteCommand />
<ExecutePreCommand />
<ExecuteCommandType>Batch</ExecuteCommandType>
<ExecutePreCommandType>Batch</ExecutePreCommandType>
<Category><placeholder name="Application Category?" value="sourceforge" options="{categories}" /></Category>
<SourceType>FixedUrl</SourceType>
<DeletePreviousFile><placeholder name="Delete Previous Version?" value="true" options="true|false" /></DeletePreviousFile>
<Enabled>true</Enabled>
<FileHippoId />
<TargetPath><placeholder name="Which is TargetPath?" value=".\{category}\{appname:regexreplace:([\s\t\r\n\-\\&]+):_}-{version}.{url:ext}" /></TargetPath>
<FixedDownloadUrl>http://jaist.dl.sourceforge.net/{getfile}</FixedDownloadUrl>
<Name><placeholder name="Application Name?" value="" /></Name>
 </ApplicationJob>
</Jobs>

Link to comment
Share on other sites

  • 1 month later...

As Mesh mirror went offline (permanently i think) i replaced it with Ignum.

First post updated to reflect this change!

 

Just configured my 8 SourceForge app profiles to work with Ignum and they're working nicely.

 

EDIT 05.05.2012:

Mirrors dropping like flys. Replaced ignum with netcologne as ignum went offline.

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.