# Buggy code
def login(self):
    """Login method used for logging in before doing search and torrent downloads."""
    if dict_from_cookiejar(self.session.cookies).get("uid") and dict_from_cookiejar(
        self.session.cookies
    ).get("pass"):
        return True

    if self.cookies:
        self.add_cookies_from_ui()
    else:
        logger.log(
            "Failed to login, you must add your cookies in the provider settings",
            logger.WARNING,
        )
        return False

    login_params = {
        "username": self.username,
        "password": self.password,
        "submit.x": 0,
        "submit.y": 0,
    }

    response = self.get_url(
        self.urls["login"], post_data=login_params, returns="response"
    )
    if not (response.content and response.status_code == 200):
        logger.log("Unable to connect to provider", logger.WARNING)
        return False

    if re.search("You tried too often", response.text):
        logger.log("Too many login access attempts", logger.WARNING)
        return False

    if (
        dict_from_cookiejar(self.session.cookies).get("uid")
        and dict_from_cookiejar(self.session.cookies).get("uid") in response.text
    ):
        return True
    else:
        logger.log("Failed to login, check your cookies", logger.WARNING)
        self.session.cookies.clear()
        return False


# Traceback (AttributeError)
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E08 status untouched: 'DOWNLOADED (720P HDTV)'
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E09 has absolute number: 9 
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E09 has status 'DOWNLOADED (720P HDTV)' and location /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e09 - The Past.mkv
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E09 status untouched: 'DOWNLOADED (720P HDTV)'
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E09 has absolute number: 9 
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E09 has status 'DOWNLOADED (720P HDTV)' and location /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e09 - The Past.mkv
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E09 status untouched: 'DOWNLOADED (720P HDTV)'
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E10 has absolute number: 10 
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E10 has status 'DOWNLOADED (720P HDTV)' and location /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - S01E10 - 010 - Letter of Challenge.mkv
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E10 status untouched: 'DOWNLOADED (720P HDTV)'
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E10 has absolute number: 10 
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E10 has status 'DOWNLOADED (720P HDTV)' and location /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - S01E10 - 010 - Letter of Challenge.mkv
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E10 status untouched: 'DOWNLOADED (720P HDTV)'
2016-09-06 17:45:59 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E11 has absolute number: 11 
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E11 airs in the future or has no airdate, marking it 'UNAIRED'
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E11 has absolute number: 11 
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E11 airs in the future or has no airdate, marking it 'UNAIRED'
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E12 has absolute number: 12 
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E12 airs in the future or has no airdate, marking it 'UNAIRED'
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E12 has absolute number: 12 
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Taboo Tattoo S01E12 airs in the future or has no airdate, marking it 'UNAIRED'
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] Transaction with 12 queries executed
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Saving indexer changes to database
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Saving to database: Taboo Tattoo
2016-09-06 17:46:00 INFO     SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Saving all updated show info to database
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Saving to database: Taboo Tattoo
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Finished update of Taboo Tattoo
2016-09-06 17:46:00 DEBUG    SHOWQUEUE-FORCE-UPDATE :: [43a7a2d] 311537: Queueing show refresh for Taboo Tattoo
2016-09-06 17:46:01 INFO     SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Performing refresh on Taboo Tattoo
2016-09-06 17:46:01 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Loading all episodes from the show directory: /mnt/user/Media/Anime/Taboo Tattoo
2016-09-06 17:46:01 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Found files: [u'/mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.mkv', u'/mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.mkv', u'/mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.mkv', u'/mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e04 - Distance.mkv', u'/mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e05 - Rescue.mkv', u'/mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e06 - Reunion.mkv', u'/mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e07 - Storm.mkv', u'/mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e08 - Creator.mkv', u'/mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e09 - The Past.mkv', u'/mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - S01E10 - 010 - Letter of Challenge.mkv']
2016-09-06 17:46:01 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Creating episode from: /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.mkv
2016-09-06 17:46:01 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Creating episode object from /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.mkv
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Found absolute number 1 for show Taboo Tattoo S01E01
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Scene anime show Taboo Tattoo using indexer with absolute 1: S1E1
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Parsed /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.mkv into title: Taboo Tattoo, season: 1, episode: [1], episode_title: Tattoo, container: mkv, type: episode, absolute_episode: [1], quality: 720p HDTV
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.mkv parsed to Taboo Tattoo S01E01
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Setter sets location to /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.mkv
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.nfo exists: True
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo-thumb.jpg exists: True
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.nfo exists: True
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.tbn exists: True
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Transaction with 1 queries executed
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.nfo exists: True
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.nfo exists: True
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo-thumb.jpg exists: True
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.tbn exists: True
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.nfo exists: True
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo-thumb.jpg exists: True
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.nfo exists: True
2016-09-06 17:46:02 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e01 - Tattoo.tbn exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Found absolute number 1 for show Taboo Tattoo S01E01
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Scene anime show Taboo Tattoo using indexer with absolute 1: S1E1
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Parsed Taboo Tattoo - s01e01 - Tattoo into title: Taboo Tattoo, season: 1, episode: [1], episode_title: Tattoo, type: episode, absolute_episode: [1], quality: Unknown
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Creating episode from: /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.mkv
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Creating episode object from /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.mkv
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Found absolute number 2 for show Taboo Tattoo S01E02
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Scene anime show Taboo Tattoo using indexer with absolute 2: S1E2
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Parsed /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.mkv into title: Taboo Tattoo, season: 1, episode: [2], episode_title: Surprise Attack, container: mkv, type: episode, absolute_episode: [2], quality: 720p HDTV
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.mkv parsed to Taboo Tattoo S01E02
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Setter sets location to /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.mkv
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.nfo exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack-thumb.jpg exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.nfo exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.tbn exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Transaction with 1 queries executed
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.nfo exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.nfo exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack-thumb.jpg exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.tbn exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.nfo exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack-thumb.jpg exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.nfo exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e02 - Surprise Attack.tbn exists: True
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Found absolute number 2 for show Taboo Tattoo S01E02
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Scene anime show Taboo Tattoo using indexer with absolute 2: S1E2
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Parsed Taboo Tattoo - s01e02 - Surprise Attack into title: Taboo Tattoo, season: 1, episode: [2], episode_title: Surprise Attack, type: episode, absolute_episode: [2], quality: Unknown
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Creating episode from: /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.mkv
2016-09-06 17:46:03 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Creating episode object from /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.mkv
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Found absolute number 3 for show Taboo Tattoo S01E03
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Scene anime show Taboo Tattoo using indexer with absolute 3: S1E3
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Parsed /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.mkv into title: Taboo Tattoo, season: 1, episode: [3], episode_title: Company mkv, type: episode, absolute_episode: [3], quality: 720p HDTV
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.mkv parsed to Taboo Tattoo S01E03
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Setter sets location to /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.mkv
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.nfo exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company-thumb.jpg exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.nfo exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.tbn exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Transaction with 1 queries executed
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.nfo exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.nfo exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company-thumb.jpg exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.tbn exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.nfo exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company-thumb.jpg exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.nfo exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Checking if /mnt/user/Media/Anime/Taboo Tattoo/Season 01/Taboo Tattoo - s01e03 - Misery Loves Company.tbn exists: True
2016-09-06 17:46:04 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Trying to find company on theTVDB
2016-09-06 17:46:05 DEBUG    SHOWQUEUE-REFRESH :: [43a7a2d] Found absolute number 3 for show Taboo Tattoo S01E03
2016-09-06 17:46:05 ERROR    SHOWQUEUE-REFRESH :: [43a7a2d] 311537: Error while refreshing show Taboo Tattoo. Error: 'NoneType' object has no attribute 'name'
Traceback (most recent call last):
  File "/usr/local/Sickrage/sickbeard/show_queue.py", line 578, in run
    self.show.refresh_dir()
  File "/usr/local/Sickrage/sickbeard/tv.py", line 1256, in refresh_dir
    self.load_episodes_from_dir()
  File "/usr/local/Sickrage/sickbeard/tv.py", line 598, in load_episodes_from_dir
    parse_result = NameParser(show=self, try_indexers=True).parse(ep_file_name)
  File "/usr/local/Sickrage/sickbeard/name_parser/parser.py", line 235, in parse
    result = self._parse_string(name)
  File "/usr/local/Sickrage/sickbeard/name_parser/parser.py", line 178, in _parse_string
    name=show.name, absolute=a, season=s, episodes=e)
AttributeError: 'NoneType' object has no attribute 'name'

# Fixed code
def login(self):
    """Login method used for logging in before doing search and torrent downloads."""
    if dict_from_cookiejar(self.session.cookies).get("uid") and dict_from_cookiejar(
        self.session.cookies
    ).get("pass"):
        return True

    if self.cookies:
        self.add_cookies_from_ui()
    else:
        logger.log(
            "Failed to login, you must add your cookies in the provider settings",
            logger.WARNING,
        )
        return False

    login_params = {
        "username": self.username,
        "password": self.password,
        "submit.x": 0,
        "submit.y": 0,
    }

    response = self.get_url(
        self.urls["login"], post_data=login_params, returns="response"
    )
    if not response or not (response.content and response.status_code == 200):
        logger.log("Unable to connect to provider", logger.WARNING)
        return False

    if re.search("You tried too often", response.text):
        logger.log("Too many login access attempts", logger.WARNING)
        return False

    if (
        dict_from_cookiejar(self.session.cookies).get("uid")
        and dict_from_cookiejar(self.session.cookies).get("uid") in response.text
    ):
        return True
    else:
        logger.log("Failed to login, check your cookies", logger.WARNING)
        self.session.cookies.clear()
        return False