Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Querying DFFD for file information  (Read 738 times)

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Querying DFFD for file information
« on: April 28, 2016, 12:53:07 pm »

With version 8 Rubble now supports automatic update for addon packs. Currently this works via the simple expedient of requiring addon packs that want auto-update to provide a URL where the current version may be found. I would prefer to allow packs to provide a DFFD file ID instead of the URL, as that would be nicer in various ways.

My current problems are as follows:

* How do you go from an ID to a download URL? It seems you need the filename, is there a way to get that?
* Is it possible to query the version number given to DFFD?
* Is it possible to get a checksum for the current file, or failing that, the file size without needing to make a HEAD request?

Any help would be greatly apreciated.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Querying DFFD for file information
« Reply #1 on: April 28, 2016, 01:59:43 pm »

As far as I can tell, you need an ID# and a file name to download.  To get the version, you can use this not-particularly-elegant regex on the HTML

<td class="row" colspan="2" style="border-bottom:1px solid \#BBBBBB;">File version:</td>\r\n    <td class="row" colspan="2" style="border-bottom:1px solid \#BBBBBB;">(.*?)</td>
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Querying DFFD for file information
« Reply #2 on: April 28, 2016, 02:20:58 pm »

Surely there is a way to query meta-data for an ID?

The way I have works, but it inflates the download counter...
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Querying DFFD for file information
« Reply #3 on: April 28, 2016, 03:22:42 pm »

Surely there is a way to query meta-data for an ID?

The way I have works, but it inflates the download counter...
Ah, that is something to be avoided...
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Querying DFFD for file information
« Reply #4 on: April 28, 2016, 03:56:56 pm »

Ah, that is something to be avoided...

My thoughts exactly...

I have some plans to make a Rubble content server (that holds just meta-data, actual files would go elsewhere), but it's not ready yet, and even if it was I have no place to host it... So for now I want to try to use DFFD, but without needing to make a HEAD request every time I need info.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS