# Buggy code
def _api_call(self, params=None, results_per_page=300, offset=0):
    """Call provider API."""
    parsed_json = {}

    try:
        server = jsonrpclib.Server(self.urls["base_url"])
        parsed_json = server.getTorrents(
            self.api_key, params or {}, int(results_per_page), int(offset)
        )
        time.sleep(cpu_presets[app.CPU_PRESET])
    except jsonrpclib.jsonrpc.ProtocolError as error:
        if error.message == (-32001, "Invalid API Key"):
            log.warning("Incorrect authentication credentials.")
        elif error.message == (-32002, "Call Limit Exceeded"):
            log.warning("You have exceeded the limit of 150 calls per hour.")
        else:
            log.error(
                "JSON-RPC protocol error while accessing provider. Error: {msg!r}",
                {"msg": error.message},
            )

    except (socket.error, socket.timeout, ValueError) as error:
        log.warning("Error while accessing provider. Error: {msg}", {"msg": error})
    return parsed_json


# Traceback (ProtocolError)
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Scene numbering enabled series Atlanta using indexer numbering: S02E11
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Converted parsed result Atlanta.S02E11.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [11], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.195343971252, total_time: None, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Matched release Atlanta.S02E11.720p.WEBRip.x264-RTFM to a series in your database: Atlanta
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Parsed Atlanta.S02E11.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [11], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.195343971252, total_time: 0.204225063324, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Added RSS item: Atlanta.S02E11.720p.WEBRip.x264-RTFM to cache: drunkenslug with url https://drunkenslug.com/getnzb/b9896785bd7c56e802f0278f70658b7c97352428.nzb&i=1438&r=**********
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Scene numbering enabled series Atlanta using indexer numbering: S02E10
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Converted parsed result Atlanta.S02E10.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [10], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.194579124451, total_time: None, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Matched release Atlanta.S02E10.720p.WEBRip.x264-RTFM to a series in your database: Atlanta
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Parsed Atlanta.S02E10.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [10], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.194579124451, total_time: 0.202982902527, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Added RSS item: Atlanta.S02E10.720p.WEBRip.x264-RTFM to cache: drunkenslug with url https://drunkenslug.com/getnzb/07523099da841137f97292770feb0933378ecd91.nzb&i=1438&r=**********
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Scene numbering enabled series Atlanta using indexer numbering: S02E03
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Converted parsed result Atlanta.S02E03.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [3], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.195599794388, total_time: None, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Matched release Atlanta.S02E03.720p.WEBRip.x264-RTFM to a series in your database: Atlanta
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Parsed Atlanta.S02E03.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [3], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.195599794388, total_time: 0.203774929047, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Added RSS item: Atlanta.S02E03.720p.WEBRip.x264-RTFM to cache: drunkenslug with url https://drunkenslug.com/getnzb/81d25c5905d6fb1a391da950f9d64544ebc2edcc.nzb&i=1438&r=**********
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Scene numbering enabled series Atlanta using indexer numbering: S02E02
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Converted parsed result Atlanta.S02E02.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [2], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.194836854935, total_time: None, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Matched release Atlanta.S02E02.720p.WEBRip.x264-RTFM to a series in your database: Atlanta
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Parsed Atlanta.S02E02.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [2], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.194836854935, total_time: 0.202975988388, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Added RSS item: Atlanta.S02E02.720p.WEBRip.x264-RTFM to cache: drunkenslug with url https://drunkenslug.com/getnzb/9c5a0839085ae37162deb2665b05fa84d4c4445f.nzb&i=1438&r=**********
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Scene numbering enabled series Atlanta using indexer numbering: S02E07
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Converted parsed result Atlanta.S02E07.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [7], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.189881086349, total_time: None, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Matched release Atlanta.S02E07.720p.WEBRip.x264-RTFM to a series in your database: Atlanta
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Parsed Atlanta.S02E07.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [7], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.189881086349, total_time: 0.198132991791, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:46 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Added RSS item: Atlanta.S02E07.720p.WEBRip.x264-RTFM to cache: drunkenslug with url https://drunkenslug.com/getnzb/d7f6acd02e5aafc77578b2813ea0d54a5b13f9ff.nzb&i=1438&r=**********
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Scene numbering enabled series Atlanta using indexer numbering: S02E06
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Converted parsed result Atlanta.S02E06.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [6], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.200688123703, total_time: None, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Matched release Atlanta.S02E06.720p.WEBRip.x264-RTFM to a series in your database: Atlanta
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Parsed Atlanta.S02E06.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [6], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.200688123703, total_time: 0.209551095963, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Added RSS item: Atlanta.S02E06.720p.WEBRip.x264-RTFM to cache: drunkenslug with url https://drunkenslug.com/getnzb/904cf3e714b03828f0322eb3466a103f70421ac1.nzb&i=1438&r=**********
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Scene numbering enabled series Atlanta using indexer numbering: S02E05
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Converted parsed result Atlanta.S02E05.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [5], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.196044921875, total_time: None, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Matched release Atlanta.S02E05.720p.WEBRip.x264-RTFM to a series in your database: Atlanta
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Parsed Atlanta.S02E05.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [5], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.196044921875, total_time: 0.205436944962, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Added RSS item: Atlanta.S02E05.720p.WEBRip.x264-RTFM to cache: drunkenslug with url https://drunkenslug.com/getnzb/608852a820652c2aeba98f3d6425e86bc3540359.nzb&i=1438&r=**********
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Scene numbering enabled series Atlanta using indexer numbering: S02E04
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Converted parsed result Atlanta.S02E04.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [4], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.196406126022, total_time: None, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Matched release Atlanta.S02E04.720p.WEBRip.x264-RTFM to a series in your database: Atlanta
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Parsed Atlanta.S02E04.720p.WEBRip.x264-RTFM into title: Atlanta, season: 2, episode: [4], screen_size: 720p, format: WEBRip, video_codec: h264, video_encoder: x264, release_group: RTFM, type: episode, parsing_time: 0.196406126022, total_time: 0.205027103424, absolute_episode: [], quality: 720p WEB-DL
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Added RSS item: Atlanta.S02E04.720p.WEBRip.x264-RTFM to cache: drunkenslug with url https://drunkenslug.com/getnzb/e12368a96747e04d71cc09bc8ffb5015b07a211f.nzb&i=1438&r=**********
2018-05-20 18:05:47 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Unable to match [MTBB].Hakumei.to.Mikochi.-.06.[53469020] to a series in your database. Parser result: release_group: MTBB, title: Hakumei to Mikochi, episode: [], absolute_episode: [6], crc32: 53469020, type: episode, parsing_time: 0.169653892517, total_time: 0.191093921661, quality: Unknown, season: None
2018-05-20 18:05:48 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Unable to match The.Real.Housewives.of.Beverly.Hills.S08E13.Crying.Shame.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTb to a series in your database. Parser result: title: The Real Housewives of Beverly Hills, season: 8, episode: [13], episode_title: Crying Shame, screen_size: 1080p, streaming_service: Amazon Prime, format: WEB-DL, audio_codec: EAC3, audio_channels: 5.1, video_codec: h264, release_group: NTb, type: episode, parsing_time: 0.254415035248, total_time: 0.472565889359, absolute_episode: [], quality: 1080p WEB-DL
2018-05-20 18:05:48 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Unable to match [MTBB].Hakumei.to.Mikochi.-.05.[8221F07B] to a series in your database. Parser result: release_group: MTBB, title: Hakumei to Mikochi, episode: [], absolute_episode: [5], crc32: 8221F07B, type: episode, parsing_time: 0.151184082031, total_time: 0.172325134277, quality: Unknown, season: None
2018-05-20 18:05:48 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Unable to match [MTBB].Hakumei.to.Mikochi.-.04.[B3BE0048] to a series in your database. Parser result: release_group: MTBB, title: Hakumei to Mikochi, episode: [], absolute_episode: [4], crc32: B3BE0048, type: episode, parsing_time: 0.150989055634, total_time: 0.171762943268, quality: Unknown, season: None
2018-05-20 18:05:48 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Hit old cached items, not parsing any more for: drunkenslug
2018-05-20 18:05:49 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Drunkenslug] :: [f1c04d4] Transaction with 11 queries executed
2018-05-20 18:05:49 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [BinSearch] :: [f1c04d4] Updating providers cache
2018-05-20 18:05:49 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [BinSearch] :: [f1c04d4] Search mode: RSS
2018-05-20 18:05:50 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [BinSearch] :: [f1c04d4] GET URL: https://www.binsearch.info/browse.php?max=50&bg=alt.binaries.teevee&server=2 [Status: 200]
2018-05-20 18:05:50 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [BinSearch] :: [f1c04d4] User-Agent: Medusa/0.2.3 (Linux; 4.9.35-v7+; b84c2846-5c28-11e8-b40b-b827eb6b4d4c)
2018-05-20 18:05:51 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [BinSearch] :: [f1c04d4] GET URL: https://www.binsearch.info/browse.php?max=50&bg=alt.binaries.teevee&server=2 [Status: 200]
2018-05-20 18:05:51 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [BinSearch] :: [f1c04d4] User-Agent: Medusa/0.2.3 (Linux; 4.9.35-v7+; b84c2846-5c28-11e8-b40b-b827eb6b4d4c)
2018-05-20 18:05:52 INFO     SEARCHQUEUE-DAILY-SEARCH :: [BinSearch] :: [f1c04d4] Removing cache entries older than 15 days from binsearch
2018-05-20 18:05:52 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [BinSearch] :: [f1c04d4] Unable to match 64f89d8a3f8749024af2ee69 to a series in your database. Parser result: uuid: 64f89d8a3f8749024af2ee69, type: episode, parsing_time: 0.17396903038, total_time: 0.174580097198, absolute_episode: [], quality: Unknown, episode: [], season: None
2018-05-20 18:05:52 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [BinSearch] :: [f1c04d4] Unable to match 669eeade113e890541ffed99.part5 to a series in your database. Parser result: title: 669eeade113e890541ffed99, episode: [5], type: episode, parsing_time: 0.184637069702, total_time: 0.405330896378, absolute_episode: [], quality: Unknown, season: None
2018-05-20 18:05:52 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [BinSearch] :: [f1c04d4] Hit old cached items, not parsing any more for: binsearch
2018-05-20 18:05:52 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Updating providers cache
2018-05-20 18:05:52 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Search mode: RSS
2018-05-20 18:06:02 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] GET URL: https://usenet-crawler.com/api?apikey=**********&maxage=3331&cat=5000%2C5070%2C5080%2C5020%2C5040%2C5050%2C5030%2C5060&limit=100&t=search&offset=0 [Status: 200]
2018-05-20 18:06:02 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] User-Agent: Medusa/0.2.3 (Linux; 4.9.35-v7+; b84c2846-5c28-11e8-b40b-b827eb6b4d4c)
2018-05-20 18:06:05 INFO     SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Removing cache entries older than 15 days from usenet_crawler
2018-05-20 18:06:05 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Unable to match profession.acteur.2018.doc.french.720p.hdtv.x264-deal to a series in your database. Parser result: title: profession acteur, year: 2018, episode_title: doc, language: fr, screen_size: 720p, format: HDTV, video_codec: h264, video_encoder: x264, release_group: deal, type: episode, parsing_time: 0.192453145981, total_time: 0.403011083603, absolute_episode: [], quality: 720p HDTV, episode: [], season: None
2018-05-20 18:06:06 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Unable to match Gone.2017.S01E04.Devil.Among.Us.1080p.AMZN.WEB-DL.DDP5.1.NL-Sub to a series in your database. Parser result: title: Gone, alias: Gone 2017, year: 2017, season: 1, episode: [4], episode_title: Devil Among, country: US, screen_size: 1080p, streaming_service: Amazon Prime, format: WEB-DL, audio_codec: EAC3, audio_channels: 5.1, subtitle_language: nl, type: episode, parsing_time: 0.264893054962, total_time: 0.473062038422, absolute_episode: [], quality: 1080p WEB-DL
2018-05-20 18:06:06 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Unable to match Gone.2017.S01E04.Devil.Among.Us.1080p.AMZN.WEB-DL.DDP5.1.NL-Sub to a series in your database. Parser result: title: Gone, alias: Gone 2017, year: 2017, season: 1, episode: [4], episode_title: Devil Among, country: US, screen_size: 1080p, streaming_service: Amazon Prime, format: WEB-DL, audio_codec: EAC3, audio_channels: 5.1, subtitle_language: nl, type: episode, parsing_time: 0.260329008102, total_time: 0.471900224686, absolute_episode: [], quality: 1080p WEB-DL
2018-05-20 18:06:06 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Unable to match 7b&1O3f3Bj7a7ihg2117KJ78f7bfF3hg to a series in your database. Parser result: title: 7b&1O3f3Bj7a7ihg2117KJ78f7bfF3hg, type: episode, parsing_time: 0.150080919266, total_time: 0.36390709877, absolute_episode: [], quality: Unknown, episode: [], season: None
2018-05-20 18:06:07 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Unable to match [DeadFish].Shinkansen.Henkei.Robo.Shinkalion.The.Animation.-.16.[720p][AAC] to a series in your database. Parser result: release_group: DeadFish, title: Shinkansen Henkei Robo Shinkalion The Animation, episode: [], absolute_episode: [16], screen_size: 720p, audio_codec: AAC, type: episode, parsing_time: 0.14661693573, total_time: 0.358633995056, quality: 720p HDTV, season: None
2018-05-20 18:06:07 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Unable to match [BakedFish].Nil.Admirari.no.Tenbin:.Teito.Genwaku.Kitan.-.07.[720p][AAC] to a series in your database. Parser result: release_group: BakedFish, title: Nil Admirari no Tenbin: Teito Genwaku Kitan, episode: [], absolute_episode: [7], screen_size: 720p, audio_codec: AAC, type: episode, parsing_time: 0.151964187622, total_time: 0.364120960236, quality: 720p HDTV, season: None
2018-05-20 18:06:08 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Unable to match [DeadFish].Shinkansen.Henkei.Robo.Shinkalion.The.Animation.-.15.[720p][AAC] to a series in your database. Parser result: release_group: DeadFish, title: Shinkansen Henkei Robo Shinkalion The Animation, episode: [], absolute_episode: [15], screen_size: 720p, audio_codec: AAC, type: episode, parsing_time: 0.144922018051, total_time: 0.360753059387, quality: 720p HDTV, season: None
2018-05-20 18:06:08 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Unable to match [BakedFish].Cutie.Honey.Universe.(2018).-.07.[720p][AAC] to a series in your database. Parser result: release_group: BakedFish, title: Cutie Honey Universe, alias: Cutie Honey Universe 2018, year: 2018, episode: [], absolute_episode: [7], screen_size: 720p, audio_codec: AAC, type: episode, parsing_time: 0.181432962418, total_time: 0.38986492157, quality: 720p HDTV, season: None
2018-05-20 18:06:08 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Unable to match [HorribleSubs].Nil.Admirari.no.Tenbin.-.Teito.Genwaku.Kitan.-.07.[1080p] to a series in your database. Parser result: release_group: HorribleSubs, title: Nil Admirari no Tenbin, alias: Nil Admirari no Tenbin - Teito Genwaku Kitan, alternative_title: Teito Genwaku Kitan, episode: [], absolute_episode: [7], screen_size: 1080p, type: episode, parsing_time: 0.159178972244, total_time: 0.371609926224, quality: 1080p HDTV, season: None
2018-05-20 18:06:09 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Unable to match 79kv4FLGWZgREhZM3tBA.part042 to a series in your database. Parser result: title: 79kv4FLGWZgREhZM3tBA, episode: [42], type: episode, parsing_time: 0.121972084045, total_time: 0.334326028824, absolute_episode: [], quality: Unknown, season: None
2018-05-20 18:06:09 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [Usenet-Crawler] :: [f1c04d4] Hit old cached items, not parsing any more for: usenet_crawler
2018-05-20 18:06:09 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [BTN] :: [f1c04d4] Updating providers cache
2018-05-20 18:06:09 DEBUG    SEARCHQUEUE-DAILY-SEARCH :: [BTN] :: [f1c04d4] Search mode: RSS
2018-05-20 18:06:29 ERROR    SEARCHQUEUE-DAILY-SEARCH :: [BTN] :: [f1c04d4] JSON-RPC protocol error while accessing provider. Error: ''
Traceback (most recent call last):
  File "/home/pi/Medusa/medusa/providers/torrent/json/btn.py", line 246, in _api_call
    int(offset)
  File "/home/pi/Medusa/ext/jsonrpclib/jsonrpc.py", line 650, in __call__
    return self.__send(self.__name, args)
  File "/home/pi/Medusa/ext/jsonrpclib/jsonrpc.py", line 531, in _request
    response = self._run_request(request)
  File "/home/pi/Medusa/ext/jsonrpclib/jsonrpc.py", line 564, in _run_request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/home/pi/Medusa/ext/jsonrpclib/jsonrpc.py", line 387, in single_request
    response.msg)
ProtocolError: (u'api.broadcasthe.net/', 524, 'Origin Time-out', <httplib.HTTPMessage instance at 0x65effda0>)

# Fixed code
def _api_call(self, params=None, results_per_page=300, offset=0):
    """Call provider API."""
    parsed_json = {}

    try:
        server = jsonrpclib.Server(self.urls["base_url"])
        parsed_json = server.getTorrents(
            self.api_key, params or {}, int(results_per_page), int(offset)
        )
        time.sleep(cpu_presets[app.CPU_PRESET])
    except jsonrpclib.jsonrpc.ProtocolError as error:
        message = error.args[0]
        if message == (-32001, "Invalid API Key"):
            log.warning("Incorrect authentication credentials.")
        elif message == (-32002, "Call Limit Exceeded"):
            log.warning("You have exceeded the limit of 150 calls per hour.")
        elif isinstance(message, tuple) and message[1] in (524,):
            log.warning(
                "Provider is currently unavailable. Error: {code} {text}",
                {"code": message[1], "text": message[2]},
            )
        else:
            log.error(
                "JSON-RPC protocol error while accessing provider. Error: {msg!r}",
                {"msg": message},
            )

    except (socket.error, ValueError) as error:
        log.warning("Error while accessing provider. Error: {msg!r}", {"msg": error})
    return parsed_json