mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-21 08:24:00 +01:00
+ Added support for PassTheHeadphones.me
% Removed hardcoding for What.CD in pygazelle API, making it easy to add other Gazelle-based trackers + Added URL parameter for What.CD and PTH, in case they come back under a new domain name
This commit is contained in:
@@ -42,7 +42,7 @@ class GazelleAPI(object):
|
||||
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.3'}
|
||||
|
||||
|
||||
def __init__(self, username=None, password=None):
|
||||
def __init__(self, username=None, password=None, url=None):
|
||||
self.session = requests.session()
|
||||
self.session.headers = self.default_headers
|
||||
self.username = username
|
||||
@@ -59,7 +59,7 @@ class GazelleAPI(object):
|
||||
self.cached_torrents = {}
|
||||
self.cached_requests = {}
|
||||
self.cached_categories = {}
|
||||
self.site = "https://what.cd/"
|
||||
self.site = url + "/"
|
||||
self.past_request_timestamps = []
|
||||
|
||||
def wait_for_rate_limit(self):
|
||||
@@ -95,7 +95,7 @@ class GazelleAPI(object):
|
||||
|
||||
self.wait_for_rate_limit()
|
||||
|
||||
loginpage = 'https://what.cd/login.php'
|
||||
loginpage = self.site + 'login.php'
|
||||
data = {'username': self.username,
|
||||
'password': self.password,
|
||||
'keeplogged': '1'}
|
||||
@@ -122,7 +122,7 @@ class GazelleAPI(object):
|
||||
Pass an action and relevant arguments for that action.
|
||||
"""
|
||||
def make_request(action, **kwargs):
|
||||
ajaxpage = 'ajax.php'
|
||||
ajaxpage = '/ajax.php'
|
||||
content = self.unparsed_request(ajaxpage, action, **kwargs)
|
||||
try:
|
||||
if not isinstance(content, text_type):
|
||||
|
||||
Reference in New Issue
Block a user