# Path: resources/lib/model/apiresponse.py
# class ApiResponse:
#     def __init__(self, name=None, year=None, genre=None, plot=None, posters=None, fanarts=None):
#         if genre is None:
#             genre = []
#         if posters is None:
#             posters = []
#         if fanarts is None:
#             fanarts = {}
# 
#         self.name = name
#         self.year = year
#         self.genre = genre
#         self.plot = plot
#         self.posters = posters
#         self.fanarts = fanarts
# 
#     @classmethod
#     def from_dict(cls, name=None, year=None, genre=None, plot=None, posters=None, fanarts=None, **kwargs):
#         return cls(name, year, genre, plot, posters, fanarts)


import ConfigParser
import json
import os
import urllib2
import dateutil.parser as date_parser
    import xbmcgui
    from xbmcswift2 import xbmcgui
from abcscraper import AbstractScraper
from resources.lib.model.apiresponse import ApiResponse
            return ApiResponse()

        url_opener = urllib2.build_opener()
        url_opener.addheaders = [
            ('Accept', 'application/json'),
            ('Authorization', 'Token token=%s' % igdb_api_key)
        ]

        if not os.path.isfile(file_path):
            query_string = 'search?q=%s' % game
            response = url_opener.open(self.api_url % query_string)
            if response.getcode() in [200, 304]:
                search_results = json.load(url_opener.open(self.api_url % query_string))
                print search_results
                if len(search_results) > 0:
                    best_match_id = search_results['games'][0]['id']
                else:
                    return None
            else:
                raise IOError("Server failed with status code %s" % response.getcode())
        else:
            best_match_id = None

        try:
            json_data = json.load(open(self._get_json_data(url_opener, game_cache_path, game, best_match_id)))
        except IOError:
            return None

        json_data = json_data['game']


# Path: resources/lib/model/apiresponse.py
# class ApiResponse:
#     def __init__(self, name=None, year=None, genre=None, plot=None, posters=None, fanarts=None):
#         if genre is None:
#             genre = []
#         if posters is None:
#             posters = []
#         if fanarts is None:
#             fanarts = {}
# 
#         self.name = name
#         self.year = year
#         self.genre = genre
#         self.plot = plot
#         self.posters = posters
#         self.fanarts = fanarts
# 
#     @classmethod
#     def from_dict(cls, name=None, year=None, genre=None, plot=None, posters=None, fanarts=None, **kwargs):
#         return cls(name, year, genre, plot, posters, fanarts)


# Path: resources/lib/scraper/igdbscraper.py
import ConfigParser
import json
import os
import urllib2
import dateutil.parser as date_parser
    import xbmcgui
    from xbmcswift2 import xbmcgui
from abcscraper import AbstractScraper
from resources.lib.model.apiresponse import ApiResponse

            return ApiResponse()

        url_opener = urllib2.build_opener()
        url_opener.addheaders = [
            ('Accept', 'application/json'),
            ('Authorization', 'Token token=%s' % igdb_api_key)
        ]

        if not os.path.isfile(file_path):
            query_string = 'search?q=%s' % game
            response = url_opener.open(self.api_url % query_string)
            if response.getcode() in [200, 304]:
                search_results = json.load(url_opener.open(self.api_url % query_string))
                print search_results
                if len(search_results) > 0:
                    best_match_id = search_results['games'][0]['id']
                else:
                    return None
            else:
                raise IOError("Server failed with status code %s" % response.getcode())
        else:
            best_match_id = None

        try:
            json_data = json.load(open(self._get_json_data(url_opener, game_cache_path, game, best_match_id)))
        except IOError:
            return None

        json_data = json_data['game']


        api_response = ApiResponse()