# Buggy code
def __init__(self):
    """Initialize the class."""
    super(self.__class__, self).__init__("LimeTorrents")

    # Credentials
    self.public = True

    # URLs
    self.url = "https://www.limetorrents.cc/"
    self.urls = {
        "index": self.url,
        "update": urljoin(self.url, "/post/updatestats.php"),
        "search": urljoin(self.url, "/search/tv/{query}/"),
        "rss": urljoin(self.url, "/browse-torrents/TV-shows/date/{page}/"),
    }

    # Proper Strings
    self.proper_strings = ["PROPER", "REPACK", "REAL"]

    # Miscellaneous Options
    self.confirmed = False

    # Torrent Stats
    self.minseed = None
    self.minleech = None

    # Cache
    self.cache = tv_cache.TVCache(self, min_time=10)


# Traceback (IndexError)
2016-11-26 00:56:40 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [DOGnzb] :: [617ad17] Creating UNIQUE URL index for dognzb
2016-11-26 00:56:42 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [DOGnzb] :: [617ad17] GET URL: https://api.dognzb.cr/api?apikey=**********&t=caps [Status: 200]
2016-11-26 00:56:44 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [DOGnzb] :: [617ad17] Search mode: Episode
2016-11-26 00:56:44 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [DOGnzb] :: [617ad17] Search show using search string: indexer_id: {u'tvdbid': 279271}
2016-11-26 00:56:45 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [DOGnzb] :: [617ad17] GET URL: https://api.dognzb.cr/api?apikey=**********&tvdbid=279271&season=2&maxage=3000&cat=5000%2C5020%2C5030%2C5040%2C5045%2C5050%2C5060%2C5080&limit=100&t=tvsearch&offset=0&ep=10 [Status: 200]
2016-11-26 00:56:45 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [DOGnzb] :: [617ad17] Search mode: Episode
2016-11-26 00:56:45 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [DOGnzb] :: [617ad17] Search show using search string: Cordon S02E10
2016-11-26 00:56:45 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [DOGnzb] :: [617ad17] GET URL: https://api.dognzb.cr/api?apikey=**********&maxage=3000&cat=5000%2C5020%2C5030%2C5040%2C5045%2C5050%2C5060%2C5080&q=Cordon+S02E10&limit=100&t=search&offset=0 [Status: 200]
2016-11-26 00:56:45 INFO     SEARCHQUEUE-BACKLOG-279271 :: [Pretome] :: [617ad17] Performing episode search for Cordon
2016-11-26 00:56:45 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Pretome] :: [617ad17] Creating UNIQUE URL index for pretome
2016-11-26 00:56:46 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Pretome] :: [617ad17] POST URL: https://pretome.info/takelogin.php [Status: 302]
2016-11-26 00:56:46 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Pretome] :: [617ad17] With post data: username=**********&password=**********&login_pin=**********
2016-11-26 00:56:47 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Pretome] :: [617ad17] GET URL: https://pretome.info/index.php [Status: 200]
2016-11-26 00:56:47 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Pretome] :: [617ad17] Search mode: Episode
2016-11-26 00:56:47 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Pretome] :: [617ad17] Search string: Cordon S02E10
2016-11-26 00:56:48 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Pretome] :: [617ad17] GET URL: https://pretome.info/browse.php?search=Cordon+S02E10&cat%5B%5D=7&st=1 [Status: 200]
2016-11-26 00:56:49 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Pretome] :: [617ad17] Data returned from provider does not contain any torrents
2016-11-26 00:56:49 INFO     SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] Performing episode search for Cordon
2016-11-26 00:56:49 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] Creating UNIQUE URL index for t411
2016-11-26 00:56:49 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] POST URL: https://api.t411.li/auth [Status: 200]
2016-11-26 00:56:49 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] With post data: username=**********&password=**********
2016-11-26 00:56:49 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] Search mode: Episode
2016-11-26 00:56:49 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] Search string: Cordon S02E10
2016-11-26 00:56:49 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] GET URL: https://api.t411.li/torrents/search/Cordon%20S02E10*?cid=433&limit=100 [Status: 200]
2016-11-26 00:56:49 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] Data returned from provider does not contain any torrents
2016-11-26 00:56:50 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] GET URL: https://api.t411.li/torrents/search/Cordon%20S02E10*?cid=637&limit=100 [Status: 200]
2016-11-26 00:56:50 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] Data returned from provider does not contain any torrents
2016-11-26 00:56:50 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] GET URL: https://api.t411.li/torrents/search/Cordon%20S02E10*?cid=455&limit=100 [Status: 200]
2016-11-26 00:56:50 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] Data returned from provider does not contain any torrents
2016-11-26 00:56:50 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] GET URL: https://api.t411.li/torrents/search/Cordon%20S02E10*?cid=639&limit=100 [Status: 200]
2016-11-26 00:56:50 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] Data returned from provider does not contain any torrents
2016-11-26 00:56:50 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] Fallback season pack search initiate
2016-11-26 00:56:50 INFO     SEARCHQUEUE-BACKLOG-279271 :: [T411] :: [617ad17] Performing season pack search for Cordon
2016-11-26 00:56:50 INFO     SEARCHQUEUE-BACKLOG-279271 :: [TransmitTheNet] :: [617ad17] Performing episode search for Cordon
2016-11-26 00:56:50 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TransmitTheNet] :: [617ad17] Creating UNIQUE URL index for transmitthenet
2016-11-26 00:56:51 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TransmitTheNet] :: [617ad17] POST URL: https://transmithe.net/login.php [Status: 302]
2016-11-26 00:56:51 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TransmitTheNet] :: [617ad17] With post data: username=**********&login=Login&password=**********&keeplogged=on
2016-11-26 00:56:51 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TransmitTheNet] :: [617ad17] GET URL: https://transmithe.net/index.php [Status: 200]
2016-11-26 00:56:51 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TransmitTheNet] :: [617ad17] Search mode: Episode
2016-11-26 00:56:51 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TransmitTheNet] :: [617ad17] Search string: Cordon S02E10
2016-11-26 00:56:51 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TransmitTheNet] :: [617ad17] GET URL: https://transmithe.net/torrents.php?filter_freeleech=0&searchtext=Cordon+S02E10&order_by=seeders&order_way=desc [Status: 200]
2016-11-26 00:56:53 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TransmitTheNet] :: [617ad17] Data returned from provider does not contain any torrents
2016-11-26 00:56:53 INFO     SEARCHQUEUE-BACKLOG-279271 :: [Usenet-Crawler] :: [617ad17] Performing episode search for Cordon
2016-11-26 00:56:53 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Usenet-Crawler] :: [617ad17] Creating UNIQUE URL index for usenet_crawler
2016-11-26 00:56:53 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Usenet-Crawler] :: [617ad17] GET URL: https://www.usenet-crawler.com/api?apikey=**********&t=caps [Status: 200]
2016-11-26 00:56:56 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Usenet-Crawler] :: [617ad17] Search mode: Episode
2016-11-26 00:56:56 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Usenet-Crawler] :: [617ad17] Search show using search string: indexer_id: {u'tvdbid': 279271}
2016-11-26 00:56:56 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Usenet-Crawler] :: [617ad17] GET URL: https://www.usenet-crawler.com/api?apikey=**********&tvdbid=279271&season=2&maxage=3000&cat=5000%2C5080%2C5020%2C5040%2C5050%2C5030%2C5060&limit=100&t=tvsearch&offset=0&ep=10 [Status: 200]
2016-11-26 00:56:56 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Usenet-Crawler] :: [617ad17] Search mode: Episode
2016-11-26 00:56:56 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Usenet-Crawler] :: [617ad17] Search show using search string: Cordon S02E10
2016-11-26 00:56:56 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Usenet-Crawler] :: [617ad17] GET URL: https://www.usenet-crawler.com/api?apikey=**********&maxage=3000&cat=5000%2C5080%2C5020%2C5040%2C5050%2C5030%2C5060&q=Cordon+S02E10&limit=100&t=search&offset=0 [Status: 200]
2016-11-26 00:56:56 INFO     SEARCHQUEUE-BACKLOG-279271 :: [Speedcd] :: [617ad17] Performing episode search for Cordon
2016-11-26 00:56:56 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Speedcd] :: [617ad17] Creating UNIQUE URL index for speedcd
2016-11-26 00:56:59 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Speedcd] :: [617ad17] POST URL: https://speed.cd/takeElogin.php [Status: 302]
2016-11-26 00:56:59 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Speedcd] :: [617ad17] With post data: username=**********&password=**********
2016-11-26 00:57:00 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Speedcd] :: [617ad17] GET URL: https://speed.cd/ [Status: 200]
2016-11-26 00:57:00 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Speedcd] :: [617ad17] Search mode: Episode
2016-11-26 00:57:00 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Speedcd] :: [617ad17] Search string: Cordon S02E10
2016-11-26 00:57:05 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Speedcd] :: [617ad17] GET URL: https://speed.cd/browse.php?c55=1&c52=1&search=Cordon+S02E10&c41=1&c50=1&c2=1&c30=1&c49=1 [Status: 200]
2016-11-26 00:57:06 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [Speedcd] :: [617ad17] Data returned from provider does not contain any torrents
2016-11-26 00:57:07 INFO     SEARCHQUEUE-BACKLOG-279271 :: [TorrentLeech] :: [617ad17] Performing episode search for Cordon
2016-11-26 00:57:07 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TorrentLeech] :: [617ad17] Creating UNIQUE URL index for torrentleech
2016-11-26 00:57:07 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TorrentLeech] :: [617ad17] POST URL: https://torrentleech.org/user/account/login/ [Status: 302]
2016-11-26 00:57:07 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TorrentLeech] :: [617ad17] With post data: username=**********&remember_me=on&login=submit&password=**********
2016-11-26 00:57:07 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TorrentLeech] :: [617ad17] GET URL: https://torrentleech.org/ [Status: 200]
2016-11-26 00:57:07 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TorrentLeech] :: [617ad17] Search mode: Episode
2016-11-26 00:57:07 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TorrentLeech] :: [617ad17] Search string: Cordon S02E10
2016-11-26 00:57:08 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TorrentLeech] :: [617ad17] GET URL: https://torrentleech.org/torrents/browse?query=Cordon+S02E10&categories=2%2C7%2C35%2C26%2C32 [Status: 200]
2016-11-26 00:57:08 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [TorrentLeech] :: [617ad17] Data returned from provider does not contain any torrents
2016-11-26 00:57:08 INFO     SEARCHQUEUE-BACKLOG-279271 :: [LimeTorrents] :: [617ad17] Performing episode search for Cordon
2016-11-26 00:57:08 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [LimeTorrents] :: [617ad17] Creating UNIQUE URL index for limetorrents
2016-11-26 00:57:08 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [LimeTorrents] :: [617ad17] Search mode: Episode
2016-11-26 00:57:08 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [LimeTorrents] :: [617ad17] Search string: Cordon S02E10
2016-11-26 00:57:09 DEBUG    SEARCHQUEUE-BACKLOG-279271 :: [LimeTorrents] :: [617ad17] GET URL: https://www.limetorrents.cc/search/tv/Cordon%20S02E10/ [Status: 200]
2016-11-26 00:57:09 ERROR    SEARCHQUEUE-BACKLOG-279271 :: [LimeTorrents] :: [617ad17] Unknown exception while searching LimeTorrents. Error: 'list index out of range'
Traceback (most recent call last):
  File "/home/home/SickRage/**********/search/core.py", line 560, in searchProviders
    down_cur_quality, manual_search, manual_search_type)
  File "/home/home/SickRage/**********/providers/generic_provider.py", line 193, in find_search_results
    items_list += self.search(search_string, ep_obj=episode)
  File "/home/home/SickRage/**********/providers/torrent/html/limetorrents.py", line 98, in search
    results += self.parse(response.text, mode)
  File "/home/home/SickRage/**********/providers/torrent/html/limetorrents.py", line 121, in parse
    torrent_table = torrent_table[0 if mode == 'RSS' else 1]
IndexError: list index out of range

# Fixed code
def __init__(self):
    """Initialize the class."""
    super(self.__class__, self).__init__("LimeTorrents")

    # Credentials
    self.public = True

    # URLs
    self.url = "https://www.limetorrents.cc"
    self.urls = {
        "update": urljoin(self.url, "/post/updatestats.php"),
        "search": urljoin(self.url, "/search/tv/{query}/"),
        "rss": urljoin(self.url, "/browse-torrents/TV-shows/date/{page}/"),
    }

    # Proper Strings
    self.proper_strings = ["PROPER", "REPACK", "REAL"]

    # Miscellaneous Options
    self.confirmed = False

    # Torrent Stats
    self.minseed = None
    self.minleech = None

    # Cache
    self.cache = tv_cache.TVCache(self, min_time=10)