1
0
mirror of https://github.com/vikstrous/pirate-get synced 2025-01-09 09:59:51 +01:00

replace torcache.net with itorrents.org cache

This commit is contained in:
Michele Guerini Rocco 2017-09-06 19:27:00 +02:00
parent c0293fce1d
commit 127bf8bdfb
Signed by: rnhmjoj
GPG Key ID: 91BE884FBA4B591A
2 changed files with 2 additions and 2 deletions

View File

@ -154,7 +154,7 @@ def remote(printer, pages, category, sort, mode, terms, mirror):
def get_torrent(info_hash):
url = 'http://torcache.net/torrent/{:X}.torrent'
url = 'http://itorrents.org/torrent/{:X}.torrent'
req = request.Request(url.format(info_hash),
headers=pirate.data.default_headers)
req.add_header('Accept-encoding', 'gzip')

View File

@ -116,7 +116,7 @@ class TestTorrent(unittest.TestCase):
request_obj = MockRequest()
with patch('urllib.request.Request', return_value=request_obj) as request:
pirate.torrent.get_torrent(100000000000000)
request.assert_called_once_with('http://torcache.net/torrent/5AF3107A4000.torrent', headers=pirate.data.default_headers)
request.assert_called_once_with('http://itorrents.org/torrent/5AF3107A4000.torrent', headers=pirate.data.default_headers)
urlopen.assert_called_once_with(request_obj, timeout=pirate.data.default_timeout)
def test_remote(self):