Skip to content

Instantly share code, notes, and snippets.

@tanelpuhu
Created January 26, 2011 10:09
Show Gist options
  • Select an option

  • Save tanelpuhu/796505 to your computer and use it in GitHub Desktop.

Select an option

Save tanelpuhu/796505 to your computer and use it in GitHub Desktop.
limit_arguments = {
'peer-limit': int(config.get('peer-limit', 30)),
'uploadLimit': int(config.get('uploadLimit', 25)),
'uploadLimited': [False,True][int(config.get('uploadLimit', 25)) > 0],
'seedRatioLimit':float(config.get('seedRatioLimit', 1.5)),
'seedRatioMode':[0,1][float(config.get('seedRatioLimit', 1.5)) > 0],
'seedRatioLimited':[False,True][float(config.get('seedRatioLimit', 1.5)) > 0],
'ids':[]
}
...
limit_arguments['ids'] = ids
...
postData = json.dumps({
'arguments':limit_arguments,
'method':'torrent-set'
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment