mirror of
https://github.com/vikstrous/pirate-get
synced 2025-01-10 10:04:21 +01:00
replace torcache.net with itorrents.org cache
This commit is contained in:
parent
c0293fce1d
commit
127bf8bdfb
@ -154,7 +154,7 @@ def remote(printer, pages, category, sort, mode, terms, mirror):
|
|||||||
|
|
||||||
|
|
||||||
def get_torrent(info_hash):
|
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),
|
req = request.Request(url.format(info_hash),
|
||||||
headers=pirate.data.default_headers)
|
headers=pirate.data.default_headers)
|
||||||
req.add_header('Accept-encoding', 'gzip')
|
req.add_header('Accept-encoding', 'gzip')
|
||||||
|
@ -116,7 +116,7 @@ class TestTorrent(unittest.TestCase):
|
|||||||
request_obj = MockRequest()
|
request_obj = MockRequest()
|
||||||
with patch('urllib.request.Request', return_value=request_obj) as request:
|
with patch('urllib.request.Request', return_value=request_obj) as request:
|
||||||
pirate.torrent.get_torrent(100000000000000)
|
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)
|
urlopen.assert_called_once_with(request_obj, timeout=pirate.data.default_timeout)
|
||||||
|
|
||||||
def test_remote(self):
|
def test_remote(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user