Pelicanux

Just A Few Random Words

How to Get the 4€99 Kimsufi Dedicated Server

It’s such a long time I want to get the 4€99 dedicated kimsufi server from OVH. The problem is, only a few servers are made available at this price each day, and if you miss the 20 seconds shift to register when they get available, you’re good to wait for the next shift.

Here is a script I wrote to get notified when an availability occurs:

Some tips

  • Reading the HTML source code doesn’t help much. You would better launch the developers tools included with chromium or firefox to get the list of URLs requested, and re-play these requests to reach the JSON file used to display the kimsufi availability web page.

  • Once you get this list of URLs, parse it searching fot the reference of the desired server. It’s the one associated with the last server delivered time. For this purpose, I launch this script and grep for the last sold server time:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python

import json
import pprint
import datetime
import requests
import dateutil.relativedelta

DOMAIN   = 'https://ws.ovh.com/dedicated/r2/ws.dispatcher/'
URL      = 'getAvailability2?callback=Request.JSONP.request_map.request_0'

def get_url_time(ref):
   return DOMAIN+'getElapsedTimeSinceLastDelivery?callback=Request.JSONP.request_map.request_1&params={"gamme":"'+str(ref)+'"}'

raw_content = requests.get(DOMAIN+URL).content

data = json.loads(raw_content.split('(')[1].split(')')[0])

for bloc in range(0,len(data['answer']['availability'])):
   reference = data['answer']['availability'][bloc]['reference']
   time_content = requests.get(get_url_time(reference)).content
   try:
      time_json = json.loads(time_content.split('(')[1].split(')')[0])
      if time_json['error'] != 'null':
         if time_json['answer']:
            last  = dateutil.relativedelta.relativedelta(seconds=int(time_json['answer']))
            now   = datetime.datetime.now()
            print reference+' '+str(now-last)
   except ValueError,e:
      print reference,str(e)
  • This way I can find this reference. Pay attention to the fact your IP address will be temporarilly banned if you exceed 900 requests by hour.

  • Then, you only need to adapt this script to only periodically request the URL associated with this reference. Get ready when the availability time changes!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
DOMAIN  = 'https://ws.ovh.com/dedicated/r2/ws.dispatcher/'
URL        = 'getElapsedTimeSinceLastDelivery?callback=Request.JSONP.request_map.request_1&params={"gamme":"150sk10"}'

last_date = '2014-12-27 17:32:4'

while True:
  
  raw_content = requests.get(DOMAIN+URL).content
  
  data     = json.loads(raw_content.split('(')[1].split(')')[0])
  answer   = data['answer']
  
  last = dateutil.relativedelta.relativedelta(seconds=int(data['answer']))
  now  = datetime.datetime.now()
  
  current_last_date = str(now-last)[:18]

  if last_date != current_last_date:
      print 'AVAILABLE'
  else:
      print current_last_date
      time.sleep(5)