DIR : /home/kozerus/public_html/go/eidogo/tourney/req.py

/home/kozerus/public_html/go/eidogo/tourney

#! /usr/bin/python

import requests
import sys

id = sys.argv[1]
ofile="{}.sgf".format(id)
url="http://eidogo.com/backend/download.php?id={}".format(id);
print( "id={} ofile={} url={}".format(id,ofile,url))

headers = {'cache-control': 'no-cache'}
try:
    r = requests.request("GET", url, headers=headers)
    print( "r.status={}".format( r.status_code ))
    #sys.exit(1)
except requests.exceptions.RequestException as e:
    print( "e={}".format( e ))
    sys.exit(1)

if not r.text:
    print("Response Empty")
    print( "Response_Empty: id={} ofile={} url={}".format(id,ofile,url))
else:
    print(r.text.encode('utf-8')) # changes
    print(ofile,"w").write(r.text.encode('utf-8'))

//


koh5_pano



Your browser does not support the HTML5 canvas element.


Drag mouse to navigate.

Navigation





17.Aug.2010, Martin Wengenmayer