From c1c1ca3ad499969bda4742c3ff7ad1c603dff15c Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Wed, 1 Nov 2017 16:09:06 +0100 Subject: [PATCH] Renamed pirate_search to torrent_search --- README.md | 2 +- torrentSearch/api_torznab.py | 13 +++++++++++++ torrentSearch/config.example.ini | 9 +++++++++ torrentSearch/config.example.py | 8 ++++++++ torrentSearch/jackett.py | 13 +++++++++++++ {torznab => torrentSearch}/piratebay.py | 0 {torznab => torrentSearch}/search.py | 0 {torznab => torrentSearch}/utils.py | 0 torznab/api_torznab.py | 0 torznab/config.example.py | 5 ----- 10 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 torrentSearch/api_torznab.py create mode 100644 torrentSearch/config.example.ini create mode 100644 torrentSearch/config.example.py create mode 100644 torrentSearch/jackett.py rename {torznab => torrentSearch}/piratebay.py (100%) rename {torznab => torrentSearch}/search.py (100%) rename {torznab => torrentSearch}/utils.py (100%) delete mode 100644 torznab/api_torznab.py delete mode 100644 torznab/config.example.py diff --git a/README.md b/README.md index f688d24..5619cb7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Pirate Search +# Torrent Search ## Torznab This is one of our ways we index torrents. We use jackett's torznab indexing to seach for multiple indexers at once. diff --git a/torrentSearch/api_torznab.py b/torrentSearch/api_torznab.py new file mode 100644 index 0000000..f3124ff --- /dev/null +++ b/torrentSearch/api_torznab.py @@ -0,0 +1,13 @@ + +def build_api_url(): + base_url = app.config['JACKET_HOST'] + base_port = app.config['JACKET_PORT'] + + +def call_jackett_api(): + base_url = app.config['JACKET_HOST'] + base_port = app.config['JACKET_PORT'] + base_p + +def handle_request_by_args(query, mode=None): + apikey = api: diff --git a/torrentSearch/config.example.ini b/torrentSearch/config.example.ini new file mode 100644 index 0000000..d6fcdc3 --- /dev/null +++ b/torrentSearch/config.example.ini @@ -0,0 +1,9 @@ +[DEFAULT] + + +[JACKETT] +JACKETT_HOST = '10.0.0.41' +JACKETT_PORT = 9117 +JACKETT_MAX_SEARCH_RESULT = 1000 +JACKETT_SSL = False +RESULTS_PER_PAGE = 75 \ No newline at end of file diff --git a/torrentSearch/config.example.py b/torrentSearch/config.example.py new file mode 100644 index 0000000..ea0be32 --- /dev/null +++ b/torrentSearch/config.example.py @@ -0,0 +1,8 @@ +[DEFAULT] + + +[JACKETT] +JACKETT_HOST = '10.0.0.41' +JACKETT_PORT = '9117' +JACKETT_MAX_SEARCH_RESULT = 1000 +RESULTS_PER_PAGE = 75 diff --git a/torrentSearch/jackett.py b/torrentSearch/jackett.py new file mode 100644 index 0000000..3ba76da --- /dev/null +++ b/torrentSearch/jackett.py @@ -0,0 +1,13 @@ + +class Jackett(object): + """docstring for Jackett""" + def __init__(self, url, query, apikey, limit): + super(Jackett, self).__init__() + self.url = url + self.query = query + self.apikey = apikey + self.limit = limit + + @classmethod + def build_search_url(url, query, apikey, limit): + return cls(url, query, apikey, limit) \ No newline at end of file diff --git a/torznab/piratebay.py b/torrentSearch/piratebay.py similarity index 100% rename from torznab/piratebay.py rename to torrentSearch/piratebay.py diff --git a/torznab/search.py b/torrentSearch/search.py similarity index 100% rename from torznab/search.py rename to torrentSearch/search.py diff --git a/torznab/utils.py b/torrentSearch/utils.py similarity index 100% rename from torznab/utils.py rename to torrentSearch/utils.py diff --git a/torznab/api_torznab.py b/torznab/api_torznab.py deleted file mode 100644 index e69de29..0000000 diff --git a/torznab/config.example.py b/torznab/config.example.py deleted file mode 100644 index bd2c30a..0000000 --- a/torznab/config.example.py +++ /dev/null @@ -1,5 +0,0 @@ -RESULTS_PER_PAGE = 75 - -JACKET_HOST = '10.0.0.41' -JACKET_PORT = '9117' -JACKET_MAX_SEARCH_RESULT = 1000