Commits

Erik Svensson committed 8a3770a

Update unittests.
Added testcases for new methods.
Added testcase for get_torrent hash id handling.
Added testcase for get_torrents hash id handling.
Added testcase for get_torrents id range handling.

  • Participants
  • Parent commits 3546a38

Comments (0)

Files changed (7)

File test/__init__.py

 # Licensed under the MIT license.
 
 import unittest
-from . import client, torrent, utils
+from . import top, client, torrent, utils
 
 def test():
-    tests = unittest.TestSuite([utils.suite(), torrent.suite(), client.suite()])
+    tests = unittest.TestSuite([top.suite(), utils.suite(), torrent.suite(), client.suite()])
     result = unittest.TestResult()
     tests.run(result)
     for e in result.errors:

File test/client.py

         self.assertEqual(tc.timeout, 100.1)
         self.failUnlessRaises(ValueError, tc._set_timeout, '10 years')
             
-    def testAdd(self):
+    def testAddOld(self):
         tc = createClient(test_name='add')
         data = 'data'
         
         
         self.failUnlessRaises(ValueError, tc.add, data, peer_limit='apa')
 
-    def testAddUri(self):
+    def testAddUriOld(self):
         data_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
         tc = createClient(test_name='adduri')
 
         self.assertEqual(r.hashString, 'A001')
         self.assertEqual(r.name, 'testtransfer1')
 
-    def testAddUri2(self):
+    def testAddTorrent(self):
         data_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data')
         tc = createClient(test_name='adduri')
 
         self.assertEqual(r.hashString, 'A001')
         self.assertEqual(r.name, 'testtransfer1')
 
-    def testRemove(self):
+    def testRemoveOld(self):
         tc = createClient(test_name='remove')
         
         tc.remove(['b000', 2, 3])
         tc.remove(1, delete_data=True)
         tc.remove('b002', delete_data=False)
 
-    def testStart(self):
+    def testRemoveTorrent(self):
+        tc = createClient(test_name='remove')
+        
+        tc.remove_torrent(['b000', 2, 3])
+        tc.remove_torrent(1, delete_data=True)
+        tc.remove_torrent('b002', delete_data=False)
+
+    def testStartOld(self):
         tc = createClient(test_name='start')
         
         tc.start(['abcdef', 20, 30])
         tc.start(1)
         tc.start('a0123456789')
 
-    def testStop(self):
+    def testStartTorrent(self):
+        tc = createClient(test_name='start')
+        
+        tc.start_torrent(['abcdef', 20, 30])
+        tc.start_torrent(1)
+        tc.start_torrent('a0123456789')
+
+    def testStopOld(self):
         tc = createClient(test_name='stop')
         
         tc.stop(2)
         tc.stop('bad')
         tc.stop(['bad', 'ba5', '30', 20])
 
-    def testVerify(self):
+    def testStopTorrent(self):
+        tc = createClient(test_name='stop')
+        
+        tc.stop(2)
+        tc.stop('bad')
+        tc.stop(['bad', 'ba5', '30', 20])
+
+    def testVerifyOld(self):
         tc = createClient(test_name='verify')
         
         tc.verify(10000)
         tc.verify('d')
         tc.verify(['a', 'b', 'c'])
 
+    def testVerifyTorrent(self):
+        tc = createClient(test_name='verify')
+        
+        tc.verify_torrent(10000)
+        tc.verify_torrent('d')
+        tc.verify_torrent(['a', 'b', 'c'])
+
     def testInfo(self):
         tc = createClient(test_name='info')
         
         self.assertEqual(t.name, 'ubuntu-10.04-server-amd64.iso')
         self.assertEqual(t.hashString, 'ab8ea951c022d4745a9b06ab8020b952a52b71ca')
 
+    def testGetTorrent(self):
+        tc = createClient(test_name='get_torrent')
+        torrent = tc.get_torrent(2)
+        self.assertEqual(torrent.id, 2)
+        self.assertEqual(torrent.name, 'ubuntu-10.04-server-amd64.iso')
+        self.assertEqual(torrent.hashString, 'ab8ea951c022d4745a9b06ab8020b952a52b71ca')
+
+        tc = createClient(test_name='get_torrent_hash')
+        torrent = tc.get_torrent('ab8ea951c022d4745a9b06ab8020b952a52b71ca')
+        self.assertEqual(torrent.id, 2)
+        self.assertEqual(torrent.name, 'ubuntu-10.04-server-amd64.iso')
+        self.assertEqual(torrent.hashString, 'ab8ea951c022d4745a9b06ab8020b952a52b71ca')
+
+    def testGetTorrents(self):
+        tc = createClient(test_name='info')
+        r = tc.get_torrents()
+        for torrent in r:
+            if torrent.id == 2:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-server-amd64.iso')
+                self.assertEqual(torrent.hashString, 'ab8ea951c022d4745a9b06ab8020b952a52b71ca')
+            elif torrent.id == 3:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-alternate-i386.iso')
+                self.assertEqual(torrent.hashString, 'a33e98826003515e46ef5075fcbf4914b307abe2')
+            else:
+                self.fail("Unknown torrent")
+
+    def testGetTorrentsRange(self):
+        tc = createClient(test_name='get_torrents_2to3')        
+        r = tc.get_torrents([2,3])
+        for torrent in r:
+            if torrent.id == 2:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-server-amd64.iso')
+                self.assertEqual(torrent.hashString, 'ab8ea951c022d4745a9b06ab8020b952a52b71ca')
+            elif torrent.id == 3:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-alternate-i386.iso')
+                self.assertEqual(torrent.hashString, 'a33e98826003515e46ef5075fcbf4914b307abe2')
+            else:
+                self.fail("Unknown torrent")
+        
+        tc = createClient(test_name='get_torrents_2to3')        
+        r = tc.get_torrents("2:3")
+        for torrent in r:
+            if torrent.id == 2:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-server-amd64.iso')
+                self.assertEqual(torrent.hashString, 'ab8ea951c022d4745a9b06ab8020b952a52b71ca')
+            elif torrent.id == 3:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-alternate-i386.iso')
+                self.assertEqual(torrent.hashString, 'a33e98826003515e46ef5075fcbf4914b307abe2')
+            else:
+                self.fail("Unknown torrent")
+        
+        tc = createClient(test_name='get_torrents_2to3')
+        r = tc.get_torrents("2,3")
+        for torrent in r:
+            if torrent.id == 2:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-server-amd64.iso')
+                self.assertEqual(torrent.hashString, 'ab8ea951c022d4745a9b06ab8020b952a52b71ca')
+            elif torrent.id == 3:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-alternate-i386.iso')
+                self.assertEqual(torrent.hashString, 'a33e98826003515e46ef5075fcbf4914b307abe2')
+            else:
+                self.fail("Unknown torrent")
+        
+        tc = createClient(test_name='get_torrents_2to3')
+        r = tc.get_torrents("2 3")
+        for torrent in r:
+            if torrent.id == 2:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-server-amd64.iso')
+                self.assertEqual(torrent.hashString, 'ab8ea951c022d4745a9b06ab8020b952a52b71ca')
+            elif torrent.id == 3:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-alternate-i386.iso')
+                self.assertEqual(torrent.hashString, 'a33e98826003515e46ef5075fcbf4914b307abe2')
+            else:
+                self.fail("Unknown torrent")
+        
+    def testGetTorrentsHashes(self):
+        tc = createClient(test_name='get_torrents_hashes')        
+        r = tc.get_torrents(["ab8ea951c022d4745a9b06ab8020b952a52b71ca", "a33e98826003515e46ef5075fcbf4914b307abe2"])
+        for torrent in r:
+            if torrent.id == 2:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-server-amd64.iso')
+                self.assertEqual(torrent.hashString, 'ab8ea951c022d4745a9b06ab8020b952a52b71ca')
+            elif torrent.id == 3:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-alternate-i386.iso')
+                self.assertEqual(torrent.hashString, 'a33e98826003515e46ef5075fcbf4914b307abe2')
+            else:
+                self.fail("Unknown torrent")
+        
+        tc = createClient(test_name='get_torrents_hashes')        
+        r = tc.get_torrents("ab8ea951c022d4745a9b06ab8020b952a52b71ca,a33e98826003515e46ef5075fcbf4914b307abe2")
+        for torrent in r:
+            if torrent.id == 2:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-server-amd64.iso')
+                self.assertEqual(torrent.hashString, 'ab8ea951c022d4745a9b06ab8020b952a52b71ca')
+            elif torrent.id == 3:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-alternate-i386.iso')
+                self.assertEqual(torrent.hashString, 'a33e98826003515e46ef5075fcbf4914b307abe2')
+            else:
+                self.fail("Unknown torrent")
+
+        tc = createClient(test_name='get_torrents_hashes')        
+        r = tc.get_torrents("ab8ea951c022d4745a9b06ab8020b952a52b71ca a33e98826003515e46ef5075fcbf4914b307abe2")
+        for torrent in r:
+            if torrent.id == 2:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-server-amd64.iso')
+                self.assertEqual(torrent.hashString, 'ab8ea951c022d4745a9b06ab8020b952a52b71ca')
+            elif torrent.id == 3:
+                self.assertEqual(torrent.name, 'ubuntu-10.04-alternate-i386.iso')
+                self.assertEqual(torrent.hashString, 'a33e98826003515e46ef5075fcbf4914b307abe2')
+            else:
+                self.fail("Unknown torrent")
+
 def suite():
     suite = unittest.TestLoader().loadTestsFromTestCase(ClientTest)
     return suite

File test/data/get_torrent.json

+{
+"test sequence":
+    [
+        {
+            "request": {"tag": 0, "method": "session-get", "arguments": {}},
+            "response": {
+                "tag": 0, 
+                "arguments": {
+                    "alt-speed-time-end": 1020, 
+                    "alt-speed-time-begin": 540, 
+                    "speed-limit-up-enabled": true, 
+                    "rename-partial-files": true, 
+                    "seedRatioLimited": true, 
+                    "peer-limit-per-torrent": 60, 
+                    "incomplete-dir": "/var/incomplete", 
+                    "rpc-version": 8, 
+                    "blocklist-enabled": false, 
+                    "speed-limit-down-enabled": true, 
+                    "seedRatioLimit": 1.0, 
+                    "encryption": "preferred", 
+                    "alt-speed-down": 50, 
+                    "download-dir": "/var/torrents", 
+                    "alt-speed-enabled": false, 
+                    "version": "1.92", 
+                    "blocklist-size": 0, 
+                    "dht-enabled": true, 
+                    "peer-limit-global": 240, 
+                    "alt-speed-time-day": 127, 
+                    "alt-speed-up": 50, 
+                    "peer-port-random-on-start": 0, 
+                    "rpc-version-minimum": 1, 
+                    "peer-port": 51413, 
+                    "port-forwarding-enabled": true, 
+                    "speed-limit-up": 500, 
+                    "speed-limit-down": 500, 
+                    "alt-speed-time-enabled": false, 
+                    "config-dir": "/etc/transmission-daemon", 
+                    "incomplete-dir-enabled": false, 
+                    "pex-enabled": true
+                }, 
+                "result": "success"
+            }
+        },
+        {
+            "request": {
+                "tag": 1,
+                "method": "torrent-get",
+                "arguments": {
+                    "fields": [
+                        "comment", "priorities", "uploadRatio", "downloadedEver", "pieces", "fileStats", "activityDate", "peer-limit", "id", "seedRatioMode", "recheckProgress", "doneDate", "peersFrom", "downloadDir", "rateUpload", "totalSize", "creator", "downloadLimit", "uploadLimited", "honorsSessionLimits", "torrentFile", "maxConnectedPeers", "magnetLink", "manualAnnounceTime", "isPrivate", "downloadLimited", "addedDate", "files", "haveValid", "uploadLimit", "percentDone", "errorString", "pieceSize", "rateDownload", "peersKnown", "dateCreated", "seedRatioLimit", "webseeds", "wanted", "peersSendingToUs", "desiredAvailable", "metadataPercentComplete", "webseedsSendingToUs", "trackerStats", "peers", "trackers", "corruptEver", "name", "bandwidthPriority", "sizeWhenDone", "hashString", "peersGettingFromUs", "uploadedEver", "pieceCount", "eta", "status", "peersConnected", "error", "leftUntilDone", "startDate", "haveUnchecked"
+                    ],
+                    "ids": [2]
+                }
+            },
+            "response": {
+                "tag": 1, 
+                "arguments": {
+                "torrents": [
+                  {
+                    "comment": "Ubuntu CD releases.ubuntu.com", 
+                    "startDate": 1272813123, 
+                    "creator": "", 
+                    "uploadRatio": 0.064600000000000005, 
+                    "downloadedEver": 714920851, 
+                    "pieces": "////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n//////////////////////////////////A=\n", 
+                    "priorities": [
+                      0
+                    ], 
+                    "fileStats": [
+                      {
+                        "priority": 0, 
+                        "bytesCompleted": 710412288, 
+                        "wanted": true
+                      }
+                    ], 
+                    "activityDate": 1272815697, 
+                    "peer-limit": 60, 
+                    "id": 2, 
+                    "sizeWhenDone": 710412288, 
+                    "seedRatioMode": 0, 
+                    "recheckProgress": 0, 
+                    "doneDate": 1272788233, 
+                    "uploadLimited": false, 
+                    "downloadDir": "/home/erik/downloads/torrents", 
+                    "rateUpload": 0, 
+                    "totalSize": 710412288, 
+                    "downloadLimit": 100, 
+                    "honorsSessionLimits": true, 
+                    "maxConnectedPeers": 60, 
+                    "magnetLink": "magnet:?xt=urn:btih:ab8ea951c022d4745a9b06ab8020b952a52b71ca&dn=ubuntu-10.04-server-amd64.iso&tr=http%3A%2F%2Ftorrent.ubuntu.com%3A6969%2Fannounce&tr=http%3A%2F%2Fipv6.torrent.ubuntu.com%3A6969%2Fannounce", 
+                    "manualAnnounceTime": -1, 
+                    "isPrivate": false, 
+                    "downloadLimited": false, 
+                    "webseedsSendingToUs": 0, 
+                    "addedDate": 1272787269, 
+                    "peersConnected": 3, 
+                    "files": [
+                      {
+                        "bytesCompleted": 710412288, 
+                        "length": 710412288, 
+                        "name": "ubuntu-10.04-server-amd64.iso"
+                      }
+                    ], 
+                    "haveValid": 710412288, 
+                    "percentDone": 1.0, 
+                    "errorString": "", 
+                    "pieceSize": 524288, 
+                    "rateDownload": 0, 
+                    "uploadLimit": 100, 
+                    "peersKnown": 199, 
+                    "dateCreated": 1272558141, 
+                    "seedRatioLimit": 1.0, 
+                    "webseeds": [], 
+                    "wanted": [
+                      1
+                    ], 
+                    "peersSendingToUs": 0, 
+                    "desiredAvailable": 0, 
+                    "metadataPercentComplete": 1.0, 
+                    "torrentFile": "/home/erik/.config/transmission-daemon/torrents/ubuntu-10.04-server-amd64.iso.ab8ea951c022d474.torrent", 
+                    "trackerStats": [
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "Success", 
+                        "lastAnnounceStartTime": 1272814924, 
+                        "id": 0, 
+                        "announceState": 1, 
+                        "leecherCount": 89, 
+                        "hasScraped": true, 
+                        "announce": "http://torrent.ubuntu.com:6969/announce", 
+                        "seederCount": 1302, 
+                        "lastAnnounceTime": 1272814925, 
+                        "lastAnnouncePeerCount": 50, 
+                        "lastScrapeStartTime": 0, 
+                        "nextAnnounceTime": 1272816725, 
+                        "lastAnnounceTimedOut": false, 
+                        "host": "torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": true, 
+                        "lastScrapeTime": 1272814925, 
+                        "tier": 0, 
+                        "lastScrapeResult": "", 
+                        "lastAnnounceSucceeded": true, 
+                        "lastScrapeTimedOut": 0, 
+                        "nextScrapeTime": 1272816725, 
+                        "downloadCount": -1, 
+                        "isBackup": false
+                      }, 
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "tracker did not respond", 
+                        "lastAnnounceStartTime": 0, 
+                        "id": 1, 
+                        "announceState": 1, 
+                        "leecherCount": -1, 
+                        "hasScraped": true, 
+                        "announce": "http://ipv6.torrent.ubuntu.com:6969/announce", 
+                        "seederCount": -1, 
+                        "lastAnnounceTime": 1272815148, 
+                        "lastAnnouncePeerCount": 0, 
+                        "lastScrapeStartTime": 0, 
+                        "nextAnnounceTime": 1272817162, 
+                        "lastAnnounceTimedOut": true, 
+                        "host": "ipv6.torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": false, 
+                        "lastScrapeTime": 1272814999, 
+                        "tier": 1, 
+                        "lastScrapeResult": "tracker did not respond", 
+                        "lastAnnounceSucceeded": false, 
+                        "lastScrapeTimedOut": 1, 
+                        "nextScrapeTime": 1272817024, 
+                        "downloadCount": -1, 
+                        "isBackup": false
+                      }
+                    ], 
+                    "peers": [
+                      {
+                        "flagStr": "UX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "74.0.163.137", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": false, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.98819999999999997, 
+                        "port": 49905, 
+                        "clientName": "KTorrent 3.3.4"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "95.32.241.9", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.13489999999999999, 
+                        "port": 10001, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "201.0.124.127", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.81630000000000003, 
+                        "port": 61508, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }
+                    ], 
+                    "corruptEver": 0, 
+                    "name": "ubuntu-10.04-server-amd64.iso", 
+                    "bandwidthPriority": 0, 
+                    "trackers": [
+                      {
+                        "tier": 0, 
+                        "announce": "http://torrent.ubuntu.com:6969/announce", 
+                        "id": 0, 
+                        "scrape": "http://torrent.ubuntu.com:6969/scrape"
+                      }, 
+                      {
+                        "tier": 1, 
+                        "announce": "http://ipv6.torrent.ubuntu.com:6969/announce", 
+                        "id": 1, 
+                        "scrape": "http://ipv6.torrent.ubuntu.com:6969/scrape"
+                      }
+                    ], 
+                    "hashString": "ab8ea951c022d4745a9b06ab8020b952a52b71ca", 
+                    "peersGettingFromUs": 3, 
+                    "uploadedEver": 46225560, 
+                    "peersFrom": {
+                      "fromIncoming": 0, 
+                      "fromPex": 3, 
+                      "fromLtep": 0, 
+                      "fromCache": 0, 
+                      "fromDht": 0, 
+                      "fromTracker": 0
+                    }, 
+                    "pieceCount": 1356, 
+                    "eta": -2, 
+                    "status": 8, 
+                    "error": 0, 
+                    "leftUntilDone": 0, 
+                    "haveUnchecked": 0
+                  }
+                ]
+                }, 
+                "result": "success"
+          }
+        }
+    ]
+}

File test/data/get_torrent_hash.json

+{
+"test sequence":
+    [
+        {
+            "request": {"tag": 0, "method": "session-get", "arguments": {}},
+            "response": {
+                "tag": 0, 
+                "arguments": {
+                    "alt-speed-time-end": 1020, 
+                    "alt-speed-time-begin": 540, 
+                    "speed-limit-up-enabled": true, 
+                    "rename-partial-files": true, 
+                    "seedRatioLimited": true, 
+                    "peer-limit-per-torrent": 60, 
+                    "incomplete-dir": "/var/incomplete", 
+                    "rpc-version": 8, 
+                    "blocklist-enabled": false, 
+                    "speed-limit-down-enabled": true, 
+                    "seedRatioLimit": 1.0, 
+                    "encryption": "preferred", 
+                    "alt-speed-down": 50, 
+                    "download-dir": "/var/torrents", 
+                    "alt-speed-enabled": false, 
+                    "version": "1.92", 
+                    "blocklist-size": 0, 
+                    "dht-enabled": true, 
+                    "peer-limit-global": 240, 
+                    "alt-speed-time-day": 127, 
+                    "alt-speed-up": 50, 
+                    "peer-port-random-on-start": 0, 
+                    "rpc-version-minimum": 1, 
+                    "peer-port": 51413, 
+                    "port-forwarding-enabled": true, 
+                    "speed-limit-up": 500, 
+                    "speed-limit-down": 500, 
+                    "alt-speed-time-enabled": false, 
+                    "config-dir": "/etc/transmission-daemon", 
+                    "incomplete-dir-enabled": false, 
+                    "pex-enabled": true
+                }, 
+                "result": "success"
+            }
+        },
+        {
+            "request": {
+                "tag": 1,
+                "method": "torrent-get",
+                "arguments": {
+                    "fields": [
+                        "comment", "priorities", "uploadRatio", "downloadedEver", "pieces", "fileStats", "activityDate", "peer-limit", "id", "seedRatioMode", "recheckProgress", "doneDate", "peersFrom", "downloadDir", "rateUpload", "totalSize", "creator", "downloadLimit", "uploadLimited", "honorsSessionLimits", "torrentFile", "maxConnectedPeers", "magnetLink", "manualAnnounceTime", "isPrivate", "downloadLimited", "addedDate", "files", "haveValid", "uploadLimit", "percentDone", "errorString", "pieceSize", "rateDownload", "peersKnown", "dateCreated", "seedRatioLimit", "webseeds", "wanted", "peersSendingToUs", "desiredAvailable", "metadataPercentComplete", "webseedsSendingToUs", "trackerStats", "peers", "trackers", "corruptEver", "name", "bandwidthPriority", "sizeWhenDone", "hashString", "peersGettingFromUs", "uploadedEver", "pieceCount", "eta", "status", "peersConnected", "error", "leftUntilDone", "startDate", "haveUnchecked"
+                    ],
+                    "ids": ["ab8ea951c022d4745a9b06ab8020b952a52b71ca"]
+                }
+            },
+            "response": {
+                "tag": 1, 
+                "arguments": {
+                "torrents": [
+                  {
+                    "comment": "Ubuntu CD releases.ubuntu.com", 
+                    "startDate": 1272813123, 
+                    "creator": "", 
+                    "uploadRatio": 0.064600000000000005, 
+                    "downloadedEver": 714920851, 
+                    "pieces": "////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n//////////////////////////////////A=\n", 
+                    "priorities": [
+                      0
+                    ], 
+                    "fileStats": [
+                      {
+                        "priority": 0, 
+                        "bytesCompleted": 710412288, 
+                        "wanted": true
+                      }
+                    ], 
+                    "activityDate": 1272815697, 
+                    "peer-limit": 60, 
+                    "id": 2, 
+                    "sizeWhenDone": 710412288, 
+                    "seedRatioMode": 0, 
+                    "recheckProgress": 0, 
+                    "doneDate": 1272788233, 
+                    "uploadLimited": false, 
+                    "downloadDir": "/home/erik/downloads/torrents", 
+                    "rateUpload": 0, 
+                    "totalSize": 710412288, 
+                    "downloadLimit": 100, 
+                    "honorsSessionLimits": true, 
+                    "maxConnectedPeers": 60, 
+                    "magnetLink": "magnet:?xt=urn:btih:ab8ea951c022d4745a9b06ab8020b952a52b71ca&dn=ubuntu-10.04-server-amd64.iso&tr=http%3A%2F%2Ftorrent.ubuntu.com%3A6969%2Fannounce&tr=http%3A%2F%2Fipv6.torrent.ubuntu.com%3A6969%2Fannounce", 
+                    "manualAnnounceTime": -1, 
+                    "isPrivate": false, 
+                    "downloadLimited": false, 
+                    "webseedsSendingToUs": 0, 
+                    "addedDate": 1272787269, 
+                    "peersConnected": 3, 
+                    "files": [
+                      {
+                        "bytesCompleted": 710412288, 
+                        "length": 710412288, 
+                        "name": "ubuntu-10.04-server-amd64.iso"
+                      }
+                    ], 
+                    "haveValid": 710412288, 
+                    "percentDone": 1.0, 
+                    "errorString": "", 
+                    "pieceSize": 524288, 
+                    "rateDownload": 0, 
+                    "uploadLimit": 100, 
+                    "peersKnown": 199, 
+                    "dateCreated": 1272558141, 
+                    "seedRatioLimit": 1.0, 
+                    "webseeds": [], 
+                    "wanted": [
+                      1
+                    ], 
+                    "peersSendingToUs": 0, 
+                    "desiredAvailable": 0, 
+                    "metadataPercentComplete": 1.0, 
+                    "torrentFile": "/home/erik/.config/transmission-daemon/torrents/ubuntu-10.04-server-amd64.iso.ab8ea951c022d474.torrent", 
+                    "trackerStats": [
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "Success", 
+                        "lastAnnounceStartTime": 1272814924, 
+                        "id": 0, 
+                        "announceState": 1, 
+                        "leecherCount": 89, 
+                        "hasScraped": true, 
+                        "announce": "http://torrent.ubuntu.com:6969/announce", 
+                        "seederCount": 1302, 
+                        "lastAnnounceTime": 1272814925, 
+                        "lastAnnouncePeerCount": 50, 
+                        "lastScrapeStartTime": 0, 
+                        "nextAnnounceTime": 1272816725, 
+                        "lastAnnounceTimedOut": false, 
+                        "host": "torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": true, 
+                        "lastScrapeTime": 1272814925, 
+                        "tier": 0, 
+                        "lastScrapeResult": "", 
+                        "lastAnnounceSucceeded": true, 
+                        "lastScrapeTimedOut": 0, 
+                        "nextScrapeTime": 1272816725, 
+                        "downloadCount": -1, 
+                        "isBackup": false
+                      }, 
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "tracker did not respond", 
+                        "lastAnnounceStartTime": 0, 
+                        "id": 1, 
+                        "announceState": 1, 
+                        "leecherCount": -1, 
+                        "hasScraped": true, 
+                        "announce": "http://ipv6.torrent.ubuntu.com:6969/announce", 
+                        "seederCount": -1, 
+                        "lastAnnounceTime": 1272815148, 
+                        "lastAnnouncePeerCount": 0, 
+                        "lastScrapeStartTime": 0, 
+                        "nextAnnounceTime": 1272817162, 
+                        "lastAnnounceTimedOut": true, 
+                        "host": "ipv6.torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": false, 
+                        "lastScrapeTime": 1272814999, 
+                        "tier": 1, 
+                        "lastScrapeResult": "tracker did not respond", 
+                        "lastAnnounceSucceeded": false, 
+                        "lastScrapeTimedOut": 1, 
+                        "nextScrapeTime": 1272817024, 
+                        "downloadCount": -1, 
+                        "isBackup": false
+                      }
+                    ], 
+                    "peers": [
+                      {
+                        "flagStr": "UX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "74.0.163.137", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": false, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.98819999999999997, 
+                        "port": 49905, 
+                        "clientName": "KTorrent 3.3.4"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "95.32.241.9", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.13489999999999999, 
+                        "port": 10001, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "201.0.124.127", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.81630000000000003, 
+                        "port": 61508, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }
+                    ], 
+                    "corruptEver": 0, 
+                    "name": "ubuntu-10.04-server-amd64.iso", 
+                    "bandwidthPriority": 0, 
+                    "trackers": [
+                      {
+                        "tier": 0, 
+                        "announce": "http://torrent.ubuntu.com:6969/announce", 
+                        "id": 0, 
+                        "scrape": "http://torrent.ubuntu.com:6969/scrape"
+                      }, 
+                      {
+                        "tier": 1, 
+                        "announce": "http://ipv6.torrent.ubuntu.com:6969/announce", 
+                        "id": 1, 
+                        "scrape": "http://ipv6.torrent.ubuntu.com:6969/scrape"
+                      }
+                    ], 
+                    "hashString": "ab8ea951c022d4745a9b06ab8020b952a52b71ca", 
+                    "peersGettingFromUs": 3, 
+                    "uploadedEver": 46225560, 
+                    "peersFrom": {
+                      "fromIncoming": 0, 
+                      "fromPex": 3, 
+                      "fromLtep": 0, 
+                      "fromCache": 0, 
+                      "fromDht": 0, 
+                      "fromTracker": 0
+                    }, 
+                    "pieceCount": 1356, 
+                    "eta": -2, 
+                    "status": 8, 
+                    "error": 0, 
+                    "leftUntilDone": 0, 
+                    "haveUnchecked": 0
+                  }
+                ]
+                }, 
+                "result": "success"
+          }
+        }
+    ]
+}

File test/data/get_torrents_2to3.json

+{
+"test sequence":
+    [
+        {
+            "request": {"tag": 0, "method": "session-get", "arguments": {}},
+            "response": {
+                "tag": 0, 
+                "arguments": {
+                    "alt-speed-time-end": 1020, 
+                    "alt-speed-time-begin": 540, 
+                    "speed-limit-up-enabled": true, 
+                    "rename-partial-files": true, 
+                    "seedRatioLimited": true, 
+                    "peer-limit-per-torrent": 60, 
+                    "incomplete-dir": "/var/incomplete", 
+                    "rpc-version": 8, 
+                    "blocklist-enabled": false, 
+                    "speed-limit-down-enabled": true, 
+                    "seedRatioLimit": 1.0, 
+                    "encryption": "preferred", 
+                    "alt-speed-down": 50, 
+                    "download-dir": "/var/torrents", 
+                    "alt-speed-enabled": false, 
+                    "version": "1.92", 
+                    "blocklist-size": 0, 
+                    "dht-enabled": true, 
+                    "peer-limit-global": 240, 
+                    "alt-speed-time-day": 127, 
+                    "alt-speed-up": 50, 
+                    "peer-port-random-on-start": 0, 
+                    "rpc-version-minimum": 1, 
+                    "peer-port": 51413, 
+                    "port-forwarding-enabled": true, 
+                    "speed-limit-up": 500, 
+                    "speed-limit-down": 500, 
+                    "alt-speed-time-enabled": false, 
+                    "config-dir": "/etc/transmission-daemon", 
+                    "incomplete-dir-enabled": false, 
+                    "pex-enabled": true
+                }, 
+                "result": "success"
+            }
+        },
+        {
+            "request": {
+                "tag": 1,
+                "method": "torrent-get",
+                "arguments": {
+                    "fields": [
+                        "comment", "priorities", "uploadRatio", "downloadedEver", "pieces", "fileStats", "activityDate", "peer-limit", "id", "seedRatioMode", "recheckProgress", "doneDate", "peersFrom", "downloadDir", "rateUpload", "totalSize", "creator", "downloadLimit", "uploadLimited", "honorsSessionLimits", "torrentFile", "maxConnectedPeers", "magnetLink", "manualAnnounceTime", "isPrivate", "downloadLimited", "addedDate", "files", "haveValid", "uploadLimit", "percentDone", "errorString", "pieceSize", "rateDownload", "peersKnown", "dateCreated", "seedRatioLimit", "webseeds", "wanted", "peersSendingToUs", "desiredAvailable", "metadataPercentComplete", "webseedsSendingToUs", "trackerStats", "peers", "trackers", "corruptEver", "name", "bandwidthPriority", "sizeWhenDone", "hashString", "peersGettingFromUs", "uploadedEver", "pieceCount", "eta", "status", "peersConnected", "error", "leftUntilDone", "startDate", "haveUnchecked"
+                    ],
+                    "ids": [2,3]
+                }
+            },
+            "response": {
+                "tag": 1, 
+                "arguments": {
+                "torrents": [
+                  {
+                    "comment": "Ubuntu CD releases.ubuntu.com", 
+                    "startDate": 1272813123, 
+                    "creator": "", 
+                    "uploadRatio": 0.064600000000000005, 
+                    "downloadedEver": 714920851, 
+                    "pieces": "////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n//////////////////////////////////A=\n", 
+                    "priorities": [
+                      0
+                    ], 
+                    "fileStats": [
+                      {
+                        "priority": 0, 
+                        "bytesCompleted": 710412288, 
+                        "wanted": true
+                      }
+                    ], 
+                    "activityDate": 1272815697, 
+                    "peer-limit": 60, 
+                    "id": 2, 
+                    "sizeWhenDone": 710412288, 
+                    "seedRatioMode": 0, 
+                    "recheckProgress": 0, 
+                    "doneDate": 1272788233, 
+                    "uploadLimited": false, 
+                    "downloadDir": "/home/erik/downloads/torrents", 
+                    "rateUpload": 0, 
+                    "totalSize": 710412288, 
+                    "downloadLimit": 100, 
+                    "honorsSessionLimits": true, 
+                    "maxConnectedPeers": 60, 
+                    "magnetLink": "magnet:?xt=urn:btih:ab8ea951c022d4745a9b06ab8020b952a52b71ca&dn=ubuntu-10.04-server-amd64.iso&tr=http%3A%2F%2Ftorrent.ubuntu.com%3A6969%2Fannounce&tr=http%3A%2F%2Fipv6.torrent.ubuntu.com%3A6969%2Fannounce", 
+                    "manualAnnounceTime": -1, 
+                    "isPrivate": false, 
+                    "downloadLimited": false, 
+                    "webseedsSendingToUs": 0, 
+                    "addedDate": 1272787269, 
+                    "peersConnected": 3, 
+                    "files": [
+                      {
+                        "bytesCompleted": 710412288, 
+                        "length": 710412288, 
+                        "name": "ubuntu-10.04-server-amd64.iso"
+                      }
+                    ], 
+                    "haveValid": 710412288, 
+                    "percentDone": 1.0, 
+                    "errorString": "", 
+                    "pieceSize": 524288, 
+                    "rateDownload": 0, 
+                    "uploadLimit": 100, 
+                    "peersKnown": 199, 
+                    "dateCreated": 1272558141, 
+                    "seedRatioLimit": 1.0, 
+                    "webseeds": [], 
+                    "wanted": [
+                      1
+                    ], 
+                    "peersSendingToUs": 0, 
+                    "desiredAvailable": 0, 
+                    "metadataPercentComplete": 1.0, 
+                    "torrentFile": "/home/erik/.config/transmission-daemon/torrents/ubuntu-10.04-server-amd64.iso.ab8ea951c022d474.torrent", 
+                    "trackerStats": [
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "Success", 
+                        "lastAnnounceStartTime": 1272814924, 
+                        "id": 0, 
+                        "announceState": 1, 
+                        "leecherCount": 89, 
+                        "hasScraped": true, 
+                        "announce": "http://torrent.ubuntu.com:6969/announce", 
+                        "seederCount": 1302, 
+                        "lastAnnounceTime": 1272814925, 
+                        "lastAnnouncePeerCount": 50, 
+                        "lastScrapeStartTime": 0, 
+                        "nextAnnounceTime": 1272816725, 
+                        "lastAnnounceTimedOut": false, 
+                        "host": "torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": true, 
+                        "lastScrapeTime": 1272814925, 
+                        "tier": 0, 
+                        "lastScrapeResult": "", 
+                        "lastAnnounceSucceeded": true, 
+                        "lastScrapeTimedOut": 0, 
+                        "nextScrapeTime": 1272816725, 
+                        "downloadCount": -1, 
+                        "isBackup": false
+                      }, 
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "tracker did not respond", 
+                        "lastAnnounceStartTime": 0, 
+                        "id": 1, 
+                        "announceState": 1, 
+                        "leecherCount": -1, 
+                        "hasScraped": true, 
+                        "announce": "http://ipv6.torrent.ubuntu.com:6969/announce", 
+                        "seederCount": -1, 
+                        "lastAnnounceTime": 1272815148, 
+                        "lastAnnouncePeerCount": 0, 
+                        "lastScrapeStartTime": 0, 
+                        "nextAnnounceTime": 1272817162, 
+                        "lastAnnounceTimedOut": true, 
+                        "host": "ipv6.torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": false, 
+                        "lastScrapeTime": 1272814999, 
+                        "tier": 1, 
+                        "lastScrapeResult": "tracker did not respond", 
+                        "lastAnnounceSucceeded": false, 
+                        "lastScrapeTimedOut": 1, 
+                        "nextScrapeTime": 1272817024, 
+                        "downloadCount": -1, 
+                        "isBackup": false
+                      }
+                    ], 
+                    "peers": [
+                      {
+                        "flagStr": "UX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "74.0.163.137", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": false, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.98819999999999997, 
+                        "port": 49905, 
+                        "clientName": "KTorrent 3.3.4"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "95.32.241.9", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.13489999999999999, 
+                        "port": 10001, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "201.0.124.127", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.81630000000000003, 
+                        "port": 61508, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }
+                    ], 
+                    "corruptEver": 0, 
+                    "name": "ubuntu-10.04-server-amd64.iso", 
+                    "bandwidthPriority": 0, 
+                    "trackers": [
+                      {
+                        "tier": 0, 
+                        "announce": "http://torrent.ubuntu.com:6969/announce", 
+                        "id": 0, 
+                        "scrape": "http://torrent.ubuntu.com:6969/scrape"
+                      }, 
+                      {
+                        "tier": 1, 
+                        "announce": "http://ipv6.torrent.ubuntu.com:6969/announce", 
+                        "id": 1, 
+                        "scrape": "http://ipv6.torrent.ubuntu.com:6969/scrape"
+                      }
+                    ], 
+                    "hashString": "ab8ea951c022d4745a9b06ab8020b952a52b71ca", 
+                    "peersGettingFromUs": 3, 
+                    "uploadedEver": 46225560, 
+                    "peersFrom": {
+                      "fromIncoming": 0, 
+                      "fromPex": 3, 
+                      "fromLtep": 0, 
+                      "fromCache": 0, 
+                      "fromDht": 0, 
+                      "fromTracker": 0
+                    }, 
+                    "pieceCount": 1356, 
+                    "eta": -2, 
+                    "status": 8, 
+                    "error": 0, 
+                    "leftUntilDone": 0, 
+                    "haveUnchecked": 0
+                  }, 
+                  {
+                    "comment": "Ubuntu CD releases.ubuntu.com", 
+                    "startDate": 1272808923, 
+                    "creator": "", 
+                    "uploadRatio": 0.1173, 
+                    "downloadedEver": 725912475, 
+                    "pieces": "////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n/////////////////////////////////////+A=\n", 
+                    "priorities": [
+                      0
+                    ], 
+                    "fileStats": [
+                      {
+                        "priority": 0, 
+                        "bytesCompleted": 722683904, 
+                        "wanted": true
+                      }
+                    ], 
+                    "activityDate": 1272815699, 
+                    "peer-limit": 60, 
+                    "id": 3, 
+                    "sizeWhenDone": 722683904, 
+                    "seedRatioMode": 0, 
+                    "recheckProgress": 0, 
+                    "doneDate": 1272810355, 
+                    "uploadLimited": false, 
+                    "downloadDir": "/home/erik/downloads/torrents", 
+                    "rateUpload": 7092, 
+                    "totalSize": 722683904, 
+                    "downloadLimit": 500, 
+                    "honorsSessionLimits": true, 
+                    "maxConnectedPeers": 60, 
+                    "magnetLink": "magnet:?xt=urn:btih:a33e98826003515e46ef5075fcbf4914b307abe2&dn=ubuntu-10.04-alternate-i386.iso&tr=http%3A%2F%2Ftorrent.ubuntu.com%3A6969%2Fannounce&tr=http%3A%2F%2Fipv6.torrent.ubuntu.com%3A6969%2Fannounce", 
+                    "manualAnnounceTime": -1, 
+                    "isPrivate": false, 
+                    "downloadLimited": false, 
+                    "webseedsSendingToUs": 0, 
+                    "addedDate": 1272808923, 
+                    "peersConnected": 13, 
+                    "files": [
+                      {
+                        "bytesCompleted": 722683904, 
+                        "length": 722683904, 
+                        "name": "ubuntu-10.04-alternate-i386.iso"
+                      }
+                    ], 
+                    "haveValid": 722683904, 
+                    "percentDone": 1.0, 
+                    "errorString": "", 
+                    "pieceSize": 524288, 
+                    "rateDownload": 0, 
+                    "uploadLimit": 500, 
+                    "peersKnown": 275, 
+                    "dateCreated": 1272557451, 
+                    "seedRatioLimit": 1.0, 
+                    "webseeds": [], 
+                    "wanted": [
+                      1
+                    ], 
+                    "peersSendingToUs": 0, 
+                    "desiredAvailable": 0, 
+                    "metadataPercentComplete": 1.0, 
+                    "torrentFile": "/home/erik/.config/transmission-daemon/torrents/ubuntu-10.04-alternate-i386.iso.a33e98826003515e.torrent", 
+                    "trackerStats": [
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "Success", 
+                        "lastAnnounceStartTime": 1272813957, 
+                        "id": 0, 
+                        "announceState": 1, 
+                        "leecherCount": 153, 
+                        "hasScraped": true, 
+                        "announce": "http://torrent.ubuntu.com:6969/announce", 
+                        "seederCount": 1062, 
+                        "lastAnnounceTime": 1272813958, 
+                        "lastAnnouncePeerCount": 50, 
+                        "lastScrapeStartTime": 1272812157, 
+                        "nextAnnounceTime": 1272815758, 
+                        "lastAnnounceTimedOut": false, 
+                        "host": "torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": true, 
+                        "lastScrapeTime": 1272813958, 
+                        "tier": 0, 
+                        "lastScrapeResult": "Success", 
+                        "lastAnnounceSucceeded": true, 
+                        "lastScrapeTimedOut": 0, 
+                        "nextScrapeTime": 1272815758, 
+                        "downloadCount": 80, 
+                        "isBackup": false
+                      }, 
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "tracker did not respond", 
+                        "lastAnnounceStartTime": 0, 
+                        "id": 1, 
+                        "announceState": 1, 
+                        "leecherCount": -1, 
+                        "hasScraped": true, 
+                        "announce": "http://ipv6.torrent.ubuntu.com:6969/announce", 
+                        "seederCount": -1, 
+                        "lastAnnounceTime": 1272814373, 
+                        "lastAnnouncePeerCount": 0, 
+                        "lastScrapeStartTime": 1272814887, 
+                        "nextAnnounceTime": 1272816408, 
+                        "lastAnnounceTimedOut": true, 
+                        "host": "ipv6.torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": false, 
+                        "lastScrapeTime": 1272814888, 
+                        "tier": 1, 
+                        "lastScrapeResult": "tracker did not respond", 
+                        "lastAnnounceSucceeded": false, 
+                        "lastScrapeTimedOut": 1, 
+                        "nextScrapeTime": 1272816915, 
+                        "downloadCount": -1, 
+                        "isBackup": false
+                      }
+                    ], 
+                    "peers": [
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "24.215.220.104", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.224, 
+                        "port": 32204, 
+                        "clientName": "BitTorrent 6.1.2"
+                      }, 
+                      {
+                        "flagStr": "UX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "60.48.255.128", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": false, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.044900000000000002, 
+                        "port": 51413, 
+                        "clientName": "Transmission 1.92"
+                      }, 
+                      {
+                        "flagStr": "EX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": false, 
+                        "peerIsChoked": true, 
+                        "peerIsInterested": false, 
+                        "address": "76.8.107.202", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 1.0, 
+                        "port": 51413, 
+                        "clientName": "Transmission 1.92"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 2048, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "87.207.115.180", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.63739999999999997, 
+                        "port": 18723, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }, 
+                      {
+                        "flagStr": "UKEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "89.150.134.195", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": false, 
+                        "progress": 0.81499999999999995, 
+                        "port": 10002, 
+                        "clientName": "BitTornado 0.3.18"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "92.196.118.210", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.99629999999999996, 
+                        "port": 51413, 
+                        "clientName": "Transmission 1.75"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "94.179.8.178", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.88170000000000004, 
+                        "port": 41929, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }, 
+                      {
+                        "flagStr": "EX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": false, 
+                        "peerIsChoked": true, 
+                        "peerIsInterested": false, 
+                        "address": "96.233.96.35", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 1.0, 
+                        "port": 51413, 
+                        "clientName": "Transmission 1.92"
+                      }, 
+                      {
+                        "flagStr": "UEH", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "115.108.13.28", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.77300000000000002, 
+                        "port": 53981, 
+                        "clientName": "Deluge 1.1.9.0"
+                      }, 
+                      {
+                        "flagStr": "UH", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "151.48.184.171", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": false, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.40310000000000001, 
+                        "port": 51413, 
+                        "clientName": "Transmission 1.75"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 724, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "189.54.193.254", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.73960000000000004, 
+                        "port": 6881, 
+                        "clientName": "libtorrent (Rasterbar) 0.14.0"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 4320, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "190.173.104.49", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.41909999999999997, 
+                        "port": 50298, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "217.85.171.222", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.86219999999999997, 
+                        "port": 49209, 
+                        "clientName": "BitTornado 0.3.18"
+                      }
+                    ], 
+                    "corruptEver": 0, 
+                    "name": "ubuntu-10.04-alternate-i386.iso", 
+                    "bandwidthPriority": 0, 
+                    "trackers": [
+                      {
+                        "tier": 0, 
+                        "announce": "http://torrent.ubuntu.com:6969/announce", 
+                        "id": 0, 
+                        "scrape": "http://torrent.ubuntu.com:6969/scrape"
+                      }, 
+                      {
+                        "tier": 1, 
+                        "announce": "http://ipv6.torrent.ubuntu.com:6969/announce", 
+                        "id": 1, 
+                        "scrape": "http://ipv6.torrent.ubuntu.com:6969/scrape"
+                      }
+                    ], 
+                    "hashString": "a33e98826003515e46ef5075fcbf4914b307abe2", 
+                    "peersGettingFromUs": 11, 
+                    "uploadedEver": 85200997, 
+                    "peersFrom": {
+                      "fromIncoming": 0, 
+                      "fromPex": 11, 
+                      "fromLtep": 0, 
+                      "fromCache": 0, 
+                      "fromDht": 2, 
+                      "fromTracker": 0
+                    }, 
+                    "pieceCount": 1379, 
+                    "eta": 90342, 
+                    "status": 8, 
+                    "error": 0, 
+                    "leftUntilDone": 0, 
+                    "haveUnchecked": 0
+                  }
+                ]
+                }, 
+                "result": "success"
+          }
+        }
+    ]
+}

File test/data/get_torrents_hashes.json

+{
+"test sequence":
+    [
+        {
+            "request": {"tag": 0, "method": "session-get", "arguments": {}},
+            "response": {
+                "tag": 0, 
+                "arguments": {
+                    "alt-speed-time-end": 1020, 
+                    "alt-speed-time-begin": 540, 
+                    "speed-limit-up-enabled": true, 
+                    "rename-partial-files": true, 
+                    "seedRatioLimited": true, 
+                    "peer-limit-per-torrent": 60, 
+                    "incomplete-dir": "/var/incomplete", 
+                    "rpc-version": 8, 
+                    "blocklist-enabled": false, 
+                    "speed-limit-down-enabled": true, 
+                    "seedRatioLimit": 1.0, 
+                    "encryption": "preferred", 
+                    "alt-speed-down": 50, 
+                    "download-dir": "/var/torrents", 
+                    "alt-speed-enabled": false, 
+                    "version": "1.92", 
+                    "blocklist-size": 0, 
+                    "dht-enabled": true, 
+                    "peer-limit-global": 240, 
+                    "alt-speed-time-day": 127, 
+                    "alt-speed-up": 50, 
+                    "peer-port-random-on-start": 0, 
+                    "rpc-version-minimum": 1, 
+                    "peer-port": 51413, 
+                    "port-forwarding-enabled": true, 
+                    "speed-limit-up": 500, 
+                    "speed-limit-down": 500, 
+                    "alt-speed-time-enabled": false, 
+                    "config-dir": "/etc/transmission-daemon", 
+                    "incomplete-dir-enabled": false, 
+                    "pex-enabled": true
+                }, 
+                "result": "success"
+            }
+        },
+        {
+            "request": {
+                "tag": 1,
+                "method": "torrent-get",
+                "arguments": {
+                    "fields": [
+                        "comment", "priorities", "uploadRatio", "downloadedEver", "pieces", "fileStats", "activityDate", "peer-limit", "id", "seedRatioMode", "recheckProgress", "doneDate", "peersFrom", "downloadDir", "rateUpload", "totalSize", "creator", "downloadLimit", "uploadLimited", "honorsSessionLimits", "torrentFile", "maxConnectedPeers", "magnetLink", "manualAnnounceTime", "isPrivate", "downloadLimited", "addedDate", "files", "haveValid", "uploadLimit", "percentDone", "errorString", "pieceSize", "rateDownload", "peersKnown", "dateCreated", "seedRatioLimit", "webseeds", "wanted", "peersSendingToUs", "desiredAvailable", "metadataPercentComplete", "webseedsSendingToUs", "trackerStats", "peers", "trackers", "corruptEver", "name", "bandwidthPriority", "sizeWhenDone", "hashString", "peersGettingFromUs", "uploadedEver", "pieceCount", "eta", "status", "peersConnected", "error", "leftUntilDone", "startDate", "haveUnchecked"
+                    ],
+                    "ids": ["ab8ea951c022d4745a9b06ab8020b952a52b71ca", "a33e98826003515e46ef5075fcbf4914b307abe2"]
+                }
+            },
+            "response": {
+                "tag": 1, 
+                "arguments": {
+                "torrents": [
+                  {
+                    "comment": "Ubuntu CD releases.ubuntu.com", 
+                    "startDate": 1272813123, 
+                    "creator": "", 
+                    "uploadRatio": 0.064600000000000005, 
+                    "downloadedEver": 714920851, 
+                    "pieces": "////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n//////////////////////////////////A=\n", 
+                    "priorities": [
+                      0
+                    ], 
+                    "fileStats": [
+                      {
+                        "priority": 0, 
+                        "bytesCompleted": 710412288, 
+                        "wanted": true
+                      }
+                    ], 
+                    "activityDate": 1272815697, 
+                    "peer-limit": 60, 
+                    "id": 2, 
+                    "sizeWhenDone": 710412288, 
+                    "seedRatioMode": 0, 
+                    "recheckProgress": 0, 
+                    "doneDate": 1272788233, 
+                    "uploadLimited": false, 
+                    "downloadDir": "/home/erik/downloads/torrents", 
+                    "rateUpload": 0, 
+                    "totalSize": 710412288, 
+                    "downloadLimit": 100, 
+                    "honorsSessionLimits": true, 
+                    "maxConnectedPeers": 60, 
+                    "magnetLink": "magnet:?xt=urn:btih:ab8ea951c022d4745a9b06ab8020b952a52b71ca&dn=ubuntu-10.04-server-amd64.iso&tr=http%3A%2F%2Ftorrent.ubuntu.com%3A6969%2Fannounce&tr=http%3A%2F%2Fipv6.torrent.ubuntu.com%3A6969%2Fannounce", 
+                    "manualAnnounceTime": -1, 
+                    "isPrivate": false, 
+                    "downloadLimited": false, 
+                    "webseedsSendingToUs": 0, 
+                    "addedDate": 1272787269, 
+                    "peersConnected": 3, 
+                    "files": [
+                      {
+                        "bytesCompleted": 710412288, 
+                        "length": 710412288, 
+                        "name": "ubuntu-10.04-server-amd64.iso"
+                      }
+                    ], 
+                    "haveValid": 710412288, 
+                    "percentDone": 1.0, 
+                    "errorString": "", 
+                    "pieceSize": 524288, 
+                    "rateDownload": 0, 
+                    "uploadLimit": 100, 
+                    "peersKnown": 199, 
+                    "dateCreated": 1272558141, 
+                    "seedRatioLimit": 1.0, 
+                    "webseeds": [], 
+                    "wanted": [
+                      1
+                    ], 
+                    "peersSendingToUs": 0, 
+                    "desiredAvailable": 0, 
+                    "metadataPercentComplete": 1.0, 
+                    "torrentFile": "/home/erik/.config/transmission-daemon/torrents/ubuntu-10.04-server-amd64.iso.ab8ea951c022d474.torrent", 
+                    "trackerStats": [
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "Success", 
+                        "lastAnnounceStartTime": 1272814924, 
+                        "id": 0, 
+                        "announceState": 1, 
+                        "leecherCount": 89, 
+                        "hasScraped": true, 
+                        "announce": "http://torrent.ubuntu.com:6969/announce", 
+                        "seederCount": 1302, 
+                        "lastAnnounceTime": 1272814925, 
+                        "lastAnnouncePeerCount": 50, 
+                        "lastScrapeStartTime": 0, 
+                        "nextAnnounceTime": 1272816725, 
+                        "lastAnnounceTimedOut": false, 
+                        "host": "torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": true, 
+                        "lastScrapeTime": 1272814925, 
+                        "tier": 0, 
+                        "lastScrapeResult": "", 
+                        "lastAnnounceSucceeded": true, 
+                        "lastScrapeTimedOut": 0, 
+                        "nextScrapeTime": 1272816725, 
+                        "downloadCount": -1, 
+                        "isBackup": false
+                      }, 
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "tracker did not respond", 
+                        "lastAnnounceStartTime": 0, 
+                        "id": 1, 
+                        "announceState": 1, 
+                        "leecherCount": -1, 
+                        "hasScraped": true, 
+                        "announce": "http://ipv6.torrent.ubuntu.com:6969/announce", 
+                        "seederCount": -1, 
+                        "lastAnnounceTime": 1272815148, 
+                        "lastAnnouncePeerCount": 0, 
+                        "lastScrapeStartTime": 0, 
+                        "nextAnnounceTime": 1272817162, 
+                        "lastAnnounceTimedOut": true, 
+                        "host": "ipv6.torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": false, 
+                        "lastScrapeTime": 1272814999, 
+                        "tier": 1, 
+                        "lastScrapeResult": "tracker did not respond", 
+                        "lastAnnounceSucceeded": false, 
+                        "lastScrapeTimedOut": 1, 
+                        "nextScrapeTime": 1272817024, 
+                        "downloadCount": -1, 
+                        "isBackup": false
+                      }
+                    ], 
+                    "peers": [
+                      {
+                        "flagStr": "UX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "74.0.163.137", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": false, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.98819999999999997, 
+                        "port": 49905, 
+                        "clientName": "KTorrent 3.3.4"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "95.32.241.9", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.13489999999999999, 
+                        "port": 10001, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "201.0.124.127", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.81630000000000003, 
+                        "port": 61508, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }
+                    ], 
+                    "corruptEver": 0, 
+                    "name": "ubuntu-10.04-server-amd64.iso", 
+                    "bandwidthPriority": 0, 
+                    "trackers": [
+                      {
+                        "tier": 0, 
+                        "announce": "http://torrent.ubuntu.com:6969/announce", 
+                        "id": 0, 
+                        "scrape": "http://torrent.ubuntu.com:6969/scrape"
+                      }, 
+                      {
+                        "tier": 1, 
+                        "announce": "http://ipv6.torrent.ubuntu.com:6969/announce", 
+                        "id": 1, 
+                        "scrape": "http://ipv6.torrent.ubuntu.com:6969/scrape"
+                      }
+                    ], 
+                    "hashString": "ab8ea951c022d4745a9b06ab8020b952a52b71ca", 
+                    "peersGettingFromUs": 3, 
+                    "uploadedEver": 46225560, 
+                    "peersFrom": {
+                      "fromIncoming": 0, 
+                      "fromPex": 3, 
+                      "fromLtep": 0, 
+                      "fromCache": 0, 
+                      "fromDht": 0, 
+                      "fromTracker": 0
+                    }, 
+                    "pieceCount": 1356, 
+                    "eta": -2, 
+                    "status": 8, 
+                    "error": 0, 
+                    "leftUntilDone": 0, 
+                    "haveUnchecked": 0
+                  }, 
+                  {
+                    "comment": "Ubuntu CD releases.ubuntu.com", 
+                    "startDate": 1272808923, 
+                    "creator": "", 
+                    "uploadRatio": 0.1173, 
+                    "downloadedEver": 725912475, 
+                    "pieces": "////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n////////////////////////////////////////////////////////////////\n/////////////////////////////////////+A=\n", 
+                    "priorities": [
+                      0
+                    ], 
+                    "fileStats": [
+                      {
+                        "priority": 0, 
+                        "bytesCompleted": 722683904, 
+                        "wanted": true
+                      }
+                    ], 
+                    "activityDate": 1272815699, 
+                    "peer-limit": 60, 
+                    "id": 3, 
+                    "sizeWhenDone": 722683904, 
+                    "seedRatioMode": 0, 
+                    "recheckProgress": 0, 
+                    "doneDate": 1272810355, 
+                    "uploadLimited": false, 
+                    "downloadDir": "/home/erik/downloads/torrents", 
+                    "rateUpload": 7092, 
+                    "totalSize": 722683904, 
+                    "downloadLimit": 500, 
+                    "honorsSessionLimits": true, 
+                    "maxConnectedPeers": 60, 
+                    "magnetLink": "magnet:?xt=urn:btih:a33e98826003515e46ef5075fcbf4914b307abe2&dn=ubuntu-10.04-alternate-i386.iso&tr=http%3A%2F%2Ftorrent.ubuntu.com%3A6969%2Fannounce&tr=http%3A%2F%2Fipv6.torrent.ubuntu.com%3A6969%2Fannounce", 
+                    "manualAnnounceTime": -1, 
+                    "isPrivate": false, 
+                    "downloadLimited": false, 
+                    "webseedsSendingToUs": 0, 
+                    "addedDate": 1272808923, 
+                    "peersConnected": 13, 
+                    "files": [
+                      {
+                        "bytesCompleted": 722683904, 
+                        "length": 722683904, 
+                        "name": "ubuntu-10.04-alternate-i386.iso"
+                      }
+                    ], 
+                    "haveValid": 722683904, 
+                    "percentDone": 1.0, 
+                    "errorString": "", 
+                    "pieceSize": 524288, 
+                    "rateDownload": 0, 
+                    "uploadLimit": 500, 
+                    "peersKnown": 275, 
+                    "dateCreated": 1272557451, 
+                    "seedRatioLimit": 1.0, 
+                    "webseeds": [], 
+                    "wanted": [
+                      1
+                    ], 
+                    "peersSendingToUs": 0, 
+                    "desiredAvailable": 0, 
+                    "metadataPercentComplete": 1.0, 
+                    "torrentFile": "/home/erik/.config/transmission-daemon/torrents/ubuntu-10.04-alternate-i386.iso.a33e98826003515e.torrent", 
+                    "trackerStats": [
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "Success", 
+                        "lastAnnounceStartTime": 1272813957, 
+                        "id": 0, 
+                        "announceState": 1, 
+                        "leecherCount": 153, 
+                        "hasScraped": true, 
+                        "announce": "http://torrent.ubuntu.com:6969/announce", 
+                        "seederCount": 1062, 
+                        "lastAnnounceTime": 1272813958, 
+                        "lastAnnouncePeerCount": 50, 
+                        "lastScrapeStartTime": 1272812157, 
+                        "nextAnnounceTime": 1272815758, 
+                        "lastAnnounceTimedOut": false, 
+                        "host": "torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": true, 
+                        "lastScrapeTime": 1272813958, 
+                        "tier": 0, 
+                        "lastScrapeResult": "Success", 
+                        "lastAnnounceSucceeded": true, 
+                        "lastScrapeTimedOut": 0, 
+                        "nextScrapeTime": 1272815758, 
+                        "downloadCount": 80, 
+                        "isBackup": false
+                      }, 
+                      {
+                        "scrapeState": 1, 
+                        "lastAnnounceResult": "tracker did not respond", 
+                        "lastAnnounceStartTime": 0, 
+                        "id": 1, 
+                        "announceState": 1, 
+                        "leecherCount": -1, 
+                        "hasScraped": true, 
+                        "announce": "http://ipv6.torrent.ubuntu.com:6969/announce", 
+                        "seederCount": -1, 
+                        "lastAnnounceTime": 1272814373, 
+                        "lastAnnouncePeerCount": 0, 
+                        "lastScrapeStartTime": 1272814887, 
+                        "nextAnnounceTime": 1272816408, 
+                        "lastAnnounceTimedOut": true, 
+                        "host": "ipv6.torrent.ubuntu.com:6969", 
+                        "hasAnnounced": true, 
+                        "lastScrapeSucceeded": false, 
+                        "lastScrapeTime": 1272814888, 
+                        "tier": 1, 
+                        "lastScrapeResult": "tracker did not respond", 
+                        "lastAnnounceSucceeded": false, 
+                        "lastScrapeTimedOut": 1, 
+                        "nextScrapeTime": 1272816915, 
+                        "downloadCount": -1, 
+                        "isBackup": false
+                      }
+                    ], 
+                    "peers": [
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "24.215.220.104", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.224, 
+                        "port": 32204, 
+                        "clientName": "BitTorrent 6.1.2"
+                      }, 
+                      {
+                        "flagStr": "UX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "60.48.255.128", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": false, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.044900000000000002, 
+                        "port": 51413, 
+                        "clientName": "Transmission 1.92"
+                      }, 
+                      {
+                        "flagStr": "EX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": false, 
+                        "peerIsChoked": true, 
+                        "peerIsInterested": false, 
+                        "address": "76.8.107.202", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 1.0, 
+                        "port": 51413, 
+                        "clientName": "Transmission 1.92"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 2048, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "87.207.115.180", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.63739999999999997, 
+                        "port": 18723, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }, 
+                      {
+                        "flagStr": "UKEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "89.150.134.195", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": false, 
+                        "progress": 0.81499999999999995, 
+                        "port": 10002, 
+                        "clientName": "BitTornado 0.3.18"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "92.196.118.210", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.99629999999999996, 
+                        "port": 51413, 
+                        "clientName": "Transmission 1.75"
+                      }, 
+                      {
+                        "flagStr": "UEX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "94.179.8.178", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.88170000000000004, 
+                        "port": 41929, 
+                        "clientName": "\u00b5Torrent 2.0.1"
+                      }, 
+                      {
+                        "flagStr": "EX", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": false, 
+                        "peerIsChoked": true, 
+                        "peerIsInterested": false, 
+                        "address": "96.233.96.35", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 1.0, 
+                        "port": 51413, 
+                        "clientName": "Transmission 1.92"
+                      }, 
+                      {
+                        "flagStr": "UEH", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "115.108.13.28", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": true, 
+                        "rateToClient": 0, 
+                        "clientIsInterested": false, 
+                        "clientIsChoked": true, 
+                        "progress": 0.77300000000000002, 
+                        "port": 53981, 
+                        "clientName": "Deluge 1.1.9.0"
+                      }, 
+                      {
+                        "flagStr": "UH", 
+                        "rateToPeer": 0, 
+                        "isUploadingTo": true, 
+                        "peerIsChoked": false, 
+                        "peerIsInterested": true, 
+                        "address": "151.48.184.171", 
+                        "isIncoming": false, 
+                        "isDownloadingFrom": false, 
+                        "isEncrypted": false, 
+                        "rateToClient": 0,