Exemplo n.º 1
0
 def __init__(self):
     NZBProvider.__init__(self, "Womble's Index")
     self.public = True
     self.cache = WombleCache(self)
     self.urls = {'base_url': 'http://newshost.co.za/'}
     self.url = self.urls['base_url']
     self.supports_backlog = False
Exemplo n.º 2
0
 def __init__(self):
     NZBProvider.__init__(self, "Womble's Index")
     self.public = True
     self.cache = WombleCache(self)
     self.urls = {'base_url': 'http://newshost.co.za/'}
     self.url = self.urls['base_url']
     self.supports_backlog = False
Exemplo n.º 3
0
    def __init__(self, name, url, key='0', catIDs='5030,5040', search_mode='eponly',
                 search_fallback=False, enable_daily=True, enable_backlog=False):

        NZBProvider.__init__(self, name)

        self.url = url
        self.key = key

        self.search_mode = search_mode
        self.search_fallback = search_fallback
        self.enable_daily = enable_daily
        self.enable_backlog = enable_backlog

        # 0 in the key spot indicates that no key is needed
        self.needs_auth = self.key != '0'
        self.public = not self.needs_auth

        self.catIDs = catIDs if catIDs else '5030,5040'

        self.default = False

        self._caps = False
        self.use_tv_search = None
        self.cap_tv_search = None
        # self.cap_search = None
        # self.cap_movie_search = None
        # self.cap_audio_search = None

        self.cache = tvcache.TVCache(self, min_time=30)  # only poll newznab providers every 30 minutes max
Exemplo n.º 4
0
    def __init__(self, name, url, key='0', catIDs='5030,5040', search_mode='eponly',
                 search_fallback=False, enable_daily=True, enable_backlog=False):

        NZBProvider.__init__(self, name)

        # self.headers.update({'User-Agent': USER_AGENT})

        self.urls = {'base_url': url}
        self.url = self.urls['base_url']

        self.key = key

        self.search_mode = search_mode
        self.search_fallback = search_fallback
        self.enable_daily = enable_daily
        self.enable_backlog = enable_backlog

        # 0 in the key spot indicates that no key is needed
        self.needs_auth = self.key != '0'
        self.public = not self.needs_auth

        self.catIDs = catIDs if catIDs else '5030,5040'

        self.default = False

        self.cache = NewznabCache(self)
Exemplo n.º 5
0
    def __init__(self):

        # Provider Init
        NZBProvider.__init__(self, 'Anizb')

        # Credentials
        self.public = True

        # URLs
        self.url = 'https://anizb.org/'
        self.urls = {
            'rss': self.url,
            'api': urljoin(self.url, 'api/?q=')
        }

        # Proper Strings

        # Miscellaneous Options
        self.supports_absolute_numbering = True
        self.anime_only = True

        # Torrent Stats

        # Cache
        self.cache = tvcache.TVCache(self)
Exemplo n.º 6
0
    def __init__(
        self,
        name,
        url,
        key="0",
        catIDs="5030,5040",
        search_mode="eponly",
        search_fallback=False,
        enable_daily=True,
        enable_backlog=False,
    ):

        NZBProvider.__init__(self, name)

        self.urls = {"base_url": url}
        self.url = self.urls["base_url"]

        self.key = key

        self.search_mode = search_mode
        self.search_fallback = search_fallback
        self.enable_daily = enable_daily
        self.enable_backlog = enable_backlog

        # 0 in the key spot indicates that no key is needed
        self.needs_auth = self.key != "0"
        self.public = not self.needs_auth

        self.catIDs = catIDs if catIDs else "5030,5040"

        self.default = False

        self.cache = NewznabCache(self)
Exemplo n.º 7
0
    def __init__(self, name, url, key='0', catIDs='5030,5040', search_mode='eponly',
                 search_fallback=False, enable_daily=True, enable_backlog=False):

        NZBProvider.__init__(self, name)

        self.url = url
        self.key = key

        self.search_mode = search_mode
        self.search_fallback = search_fallback
        self.enable_daily = enable_daily
        self.enable_backlog = enable_backlog

        # 0 in the key spot indicates that no key is needed
        self.needs_auth = self.key != '0'
        self.public = not self.needs_auth

        self.catIDs = catIDs if catIDs else '5030,5040'

        self.default = False

        self._caps = False
        self.use_tv_search = None
        self.cap_tv_search = None
        # self.cap_search = None
        # self.cap_movie_search = None
        # self.cap_audio_search = None

        self.cache = tvcache.TVCache(self, min_time=30)  # only poll newznab providers every 30 minutes max
Exemplo n.º 8
0
    def __init__(self,
                 name,
                 url,
                 key='0',
                 catIDs='5030,5040',
                 search_mode='eponly',
                 search_fallback=False,
                 enable_daily=True,
                 enable_backlog=False):

        NZBProvider.__init__(self, name)

        # self.headers.update({'User-Agent': USER_AGENT})

        self.urls = {'base_url': url}
        self.url = self.urls['base_url']

        self.key = key

        self.search_mode = search_mode
        self.search_fallback = search_fallback
        self.enable_daily = enable_daily
        self.enable_backlog = enable_backlog

        # 0 in the key spot indicates that no key is needed
        self.needs_auth = self.key != '0'
        self.public = not self.needs_auth

        self.catIDs = catIDs if catIDs else '5030,5040'

        self.default = False

        self.cache = NewznabCache(self)
Exemplo n.º 9
0
    def __init__(self):
        NZBProvider.__init__(self, "BinSearch")

        self.public = True
        self.cache = BinSearchCache(self)
        self.urls = {'base_url': 'https://www.binsearch.info/'}
        self.url = self.urls['base_url']
        self.supports_backlog = False
Exemplo n.º 10
0
    def test__get_size(self):
        """
        Test _get_size
        """
        items_list = [
            None, {}, {'links': None}, {'links': []}, {'links': [{}]},
            {'links': [{'length': 1}, {'length': None}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': ''}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': '0'}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': '123'}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': '12.3'}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': '-123'}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': '-12.3'}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': 0}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': 123}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': 12.3}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': -123}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': -12.3}, {'length': 3}]},
        ]
        results_list = [
            -1, -1, -1, -1, -1, -1, -1, 0, 123, -1, -123, -1, 0, 123, 12, -123, -12
        ]

        unicode_items_list = [
            {'links': None}, {'links': []}, {'links': [{}]},
            {'links': [{'length': 1}, {'length': None}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': ''}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': '0'}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': '123'}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': '12.3'}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': '-123'}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': '-12.3'}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': 0}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': 123}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': 12.3}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': -123}, {'length': 3}]},
            {'links': [{'length': 1}, {'length': -12.3}, {'length': 3}]},
        ]
        unicode_results_list = [
            -1, -1, -1, -1, -1, 0, 123, -1, -123, -1, 0, 123, 12, -123, -12
        ]

        self.assertEqual(
            len(items_list), len(results_list),
            'Number of parameters ({0:d}) and results ({1:d}) does not match'.format(len(items_list), len(results_list))
        )

        self.assertEqual(
            len(unicode_items_list), len(unicode_results_list),
            'Number of parameters ({0:d}) and results ({1:d}) does not match'.format(
                len(unicode_items_list), len(unicode_results_list))
        )

        for (index, item) in enumerate(items_list):
            self.assertEqual(NZBProvider('Test Provider')._get_size(item), results_list[index])

        for (index, item) in enumerate(unicode_items_list):
            self.assertEqual(NZBProvider('Test Provider')._get_size(item), unicode_results_list[index])
Exemplo n.º 11
0
    def __init__(self):

        NZBProvider.__init__(self, "BinSearch")

        self.public = True
        self.cache = BinSearchCache(self, min_time=30)  # only poll Binsearch every 30 minutes max
        self.urls = {'base_url': 'https://www.binsearch.info/'}
        self.url = self.urls['base_url']
        self.supports_backlog = False
Exemplo n.º 12
0
    def __init__(self):

        NZBProvider.__init__(self, "Womble's Index")

        self.public = True
        self.cache = WombleCache(self, min_time=15)  # only poll Womble's Index every 15 minutes max
        self.urls = {'base_url': 'http://newshost.co.za/'}
        self.url = self.urls['base_url']
        self.supports_backlog = False
Exemplo n.º 13
0
    def __init__(self):
        NZBProvider.__init__(self, "omgwtfnzbs")

        self.username = None
        self.api_key = None
        self.cache = OmgwtfnzbsCache(self)

        self.urls = {'base_url': 'https://omgwtfnzbs.org/'}
        self.url = self.urls['base_url']
Exemplo n.º 14
0
    def __init__(self):
        NZBProvider.__init__(self, "omgwtfnzbs")

        self.username = None
        self.api_key = None
        self.cache = OmgwtfnzbsCache(self)

        self.urls = {'base_url': 'https://omgwtfnzbs.org/'}
        self.url = self.urls['base_url']
Exemplo n.º 15
0
    def __init__(self):

        NZBProvider.__init__(self, 'Womble\'s Index')

        self.public = True

        self.url = 'http://newshost.co.za'
        self.urls = {'rss': urljoin(self.url, 'rss')}
        self.supports_backlog = False

        self.cache = WombleCache(self, min_time=20)
Exemplo n.º 16
0
    def __init__(self):

        NZBProvider.__init__(self, "Womble's Index")

        self.public = True

        self.url = "http://newshost.co.za"
        self.urls = {"rss": urljoin(self.url, "rss")}
        self.supports_backlog = False

        self.cache = WombleCache(self, min_time=20)
Exemplo n.º 17
0
    def __init__(self):

        NZBProvider.__init__(self, 'BinSearch')

        self.url = 'https://www.binsearch.info'
        self.urls = {'rss': urljoin(self.url, 'rss.php')}

        self.public = True
        self.supports_backlog = False

        self.cache = BinSearchCache(self, min_time=30)  # only poll Binsearch every 30 minutes max
Exemplo n.º 18
0
    def __init__(self):

        NZBProvider.__init__(self, "BinSearch")

        self.url = "https://www.binsearch.info"
        self.urls = {"rss": urljoin(self.url, "rss.php")}

        self.public = True
        self.supports_backlog = False

        self.cache = BinSearchCache(self, min_time=30)  # only poll Binsearch every 30 minutes max
Exemplo n.º 19
0
    def __init__(self):

        NZBProvider.__init__(self, 'Womble\'s Index')

        self.public = True

        self.url = 'http://newshost.co.za'
        self.urls = {'rss': urljoin(self.url, 'rss')}
        self.supports_backlog = False

        self.cache = WombleCache(self, min_time=20)
Exemplo n.º 20
0
    def __init__(self):
        NZBProvider.__init__(self, "OMGWTFNZBs")

        self.username = None
        self.api_key = None

        self.cache = OmgwtfnzbsCache(self)

        self.url = "https://omgwtfnzbs.me/"
        self.urls = {"rss": "https://rss.omgwtfnzbs.me/rss-download.php", "api": "https://api.omgwtfnzbs.me/json/"}

        self.proper_strings = [".PROPER.", ".REPACK."]
Exemplo n.º 21
0
    def __init__(self):

        NZBProvider.__init__(self, "BinSearch")

        self.url = "https://www.binsearch.info"
        self.urls = {"rss": urljoin(self.url, "rss.php")}

        self.public = True
        self.supports_backlog = False

        self.cache = BinSearchCache(
            self, min_time=30)  # only poll Binsearch every 30 minutes max
Exemplo n.º 22
0
    def __init__(self):
        NZBProvider.__init__(self, "omgwtfnzbs")

        self.username = None
        self.api_key = None
        self.cache = OmgwtfnzbsCache(self)

        self.url = 'https://omgwtfnzbs.org/'
        self.urls = {
            'rss': 'https://rss.omgwtfnzbs.org/rss-download.php',
            'api': 'https://api.omgwtfnzbs.org/json/'
        }
Exemplo n.º 23
0
    def __init__(self):

        NZBProvider.__init__(self, "AnimeNZB")

        self.supports_backlog = False
        self.public = True
        self.supports_absolute_numbering = True
        self.anime_only = True

        self.urls = {'base_url': 'http://animenzb.com/'}
        self.url = self.urls['base_url']

        self.cache = animenzbCache(self)
Exemplo n.º 24
0
    def __init__(self):
        NZBProvider.__init__(self, "omgwtfnzbs")

        self.username = None
        self.api_key = None
        self.cache = OmgwtfnzbsCache(self)

        self.url = 'https://omgwtfnzbs.org/'
        self.urls = {
            'rss': 'https://rss.omgwtfnzbs.org/rss-download.php',
            'api': 'https://api.omgwtfnzbs.org/json/'
        }

        self.proper_strings = ['.PROPER.', '.REPACK.']
Exemplo n.º 25
0
    def __init__(self):
        NZBProvider.__init__(self, 'OMGWTFNZBs')

        self.username = None
        self.api_key = None

        self.cache = OmgwtfnzbsCache(self)

        self.url = 'https://omgwtfnzbs.me/'
        self.urls = {
            'rss': 'https://rss.omgwtfnzbs.me/rss-download.php',
            'api': 'https://api.omgwtfnzbs.me/json/'
        }

        self.proper_strings = ['.PROPER.', '.REPACK.']
Exemplo n.º 26
0
    def __init__(self):

        # Provider Init
        NZBProvider.__init__(self, "Womble's Index")

        # Credentials
        self.public = True

        # URLs
        self.url = 'http://newshost.co.za'
        self.urls = {
            'rss': urljoin(self.url, 'rss'),
        }

        # Proper Strings

        # Miscellaneous Options
        self.supports_backlog = False

        # Cache
        self.cache = WombleCache(self, min_time=20)
Exemplo n.º 27
0
    def __init__(self):

        # Provider Init
        NZBProvider.__init__(self, 'BinSearch')

        # Credentials
        self.public = True
        self.supports_backlog = False

        # URLs
        self.url = 'https://www.binsearch.info'
        self.urls = {
            'rss': urljoin(self.url, 'rss.php')
        }

        # Proper Strings

        # Miscellaneous Options

        # Cache
        self.cache = BinSearchCache(self, min_time=30)  # only poll Binsearch every 30 minutes max
Exemplo n.º 28
0
    def test__get_storage_dir(self):
        """
        Test _get_storage_dir
        """
        test_cases = [
            None, 123, 12.3, '', os.path.join('some', 'path', 'to', 'folder')
        ]

        for nzb_dir in test_cases:
            sickbeard.NZB_DIR = nzb_dir

            self.assertEqual(NZBProvider('Test Provider')._get_storage_dir(), nzb_dir)
Exemplo n.º 29
0
    def test_is_active(self):
        """
        Test is_active
        """
        test_cases = {
            (False, False): False,
            (False, None): False,
            (False, True): False,
            (None, False): False,
            (None, None): False,
            (None, True): False,
            (True, False): False,
            (True, None): False,
            (True, True): True,
        }

        for ((use_nzb, enabled), result) in iteritems(test_cases):
            sickbeard.USE_NZBS = use_nzb

            provider = NZBProvider('Test Provider')
            provider.enabled = enabled

            self.assertEqual(provider.is_active(), result)
    def test_is_active(self):
        """
        Test is_active
        """
        test_cases = {
            (False, False): False,
            (False, None): False,
            (False, True): False,
            (None, False): False,
            (None, None): False,
            (None, True): False,
            (True, False): False,
            (True, None): False,
            (True, True): True,
        }

        for ((use_nzb, enabled), result) in six.iteritems(test_cases):
            sickbeard.USE_NZBS = use_nzb

            provider = NZBProvider('Test Provider')
            provider.enabled = enabled

            self.assertEqual(provider.is_active(), result)
Exemplo n.º 31
0
 def __init__(self):
     NZBProvider.__init__(self, "BinnewZ")
 def test___init__(self):
     """
     Test __init__
     """
     self.assertEqual(
         NZBProvider('Test Provider').provider_type, GenericProvider.NZB)
Exemplo n.º 33
0
 def __init__(self):
     NZBProvider.__init__(self, "BinnewZ")