You are not logged in.

#1 2012-05-09 03:33:38

josephg
Member
From: Brazil
Registered: 2009-09-28
Posts: 88

[SOLVED] Source's URL contains dynamic field - now what?

Hi there.

I recently adopted counter-strike-2d and I notice that Unreal Software's source URLs depends on a connection identification, which can be seen in the download link available in, for example, this file's download page. So, the real URL for me to the file would be

http://www.unrealsoftware.de/get.php?ge … 9355692755

But, of course, this 'cid' is not static, therefore is incorrect to have it in sources array in PKGBUILD.

Does anyone know how can I beat this issue in my PKGBUILD?

Thanks in advance!

Last edited by josephg (2012-05-09 12:04:33)

Offline

#2 2012-05-09 06:28:33

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,837

Re: [SOLVED] Source's URL contains dynamic field - now what?

Explain what you are doing to the developers, and ask them to consider providing a saner download setup.

If they say no, find something more productive to waste your time on. smile

Offline

#3 2012-05-09 07:49:21

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 6,815

Re: [SOLVED] Source's URL contains dynamic field - now what?

Or put a note explaining that the user must download the source themselves (with a link to the download page). Won't work with helpers like yaourt, but that's no big loss smile


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2012-05-09 09:11:51

xduugu
Member
Registered: 2008-10-16
Posts: 282

Re: [SOLVED] Source's URL contains dynamic field - now what?

Or parse the website to generate the source link. E.g.

$ pkgver=0.1.2.0; echo "http://www.unrealsoftware.de/$(curl -Ss "http://www.unrealsoftware.de/get.php?get=cs2d_${pkgver//./}_win.zip&p=1" \
| grep -o '"get.php[^"]\+"' | cut -d'"' -f2 | sed 's/&/\&/g')"

Last edited by xduugu (2012-05-09 09:12:54)

Offline

#5 2012-05-09 12:04:11

josephg
Member
From: Brazil
Registered: 2009-09-28
Posts: 88

Re: [SOLVED] Source's URL contains dynamic field - now what?

I asked in Unreal Software for a static URL and today got 'sorry' as reply by the admin...
Anyway, xduugu's script works. I just had to make it in a function, to hide it from the AUR interface. Otherwise, AUR would print a lot of sources for the end-user, as the web interface doesn't parse well this black magic.

grabcid() {
  local file=cs2d_${_ver}_linux.zip
  echo "$(curl -Ss "http://www.unrealsoftware.de/get.php?get=${file}&p=1" | 
            grep -o '"get.php[^"]\+"' | cut -d'"' -f2 | sed 's/&/\&/g')"
}
_cid=$(grabcid)

Problem solved! Thanks guys!

Offline

Board footer

Powered by FluxBB