# 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 json
import os
import urllib2
    import xbmcgui
    from xbmcswift2 import xbmcgui
from abcscraper import AbstractScraper
from resources.lib.model.apiresponse import ApiResponse
        game_cache_path = self._set_up_path(os.path.join(self.api_cache, nvapp.id))

        json_file = self._get_json_data(game_cache_path, game)
        try:
            json_data = json.load(open(json_file))
        except:
            xbmcgui.Dialog().notification(
                self.core.string('name'),
                self.core.string('scraper_failed') % (game, self.name())
            )

            if json_file is not None and os.path.isfile(json_file):
                os.remove(json_file)

            return ApiResponse()

        if json_data['Response'] != 'False':
            json_data['posters'] = []
            cover_path = self._dump_image(game_cover_path, json_data['Poster'])
            if cover_path is not None:
                json_data['posters'].append(cover_path)
            del json_data['Poster']
            response = dict((k.lower(), v) for k, v in json_data.iteritems())
            if 'genre' in response:
                response['genre'] = response.get('genre').split(',')
                response['genre'] = [str(v).strip() for v in response.get('genre')]

            return ApiResponse.from_dict(**response)
        else:


# 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/omdbscraper.py
import json
import os
import urllib2
    import xbmcgui
    from xbmcswift2 import xbmcgui
from abcscraper import AbstractScraper
from resources.lib.model.apiresponse import ApiResponse

        game_cache_path = self._set_up_path(os.path.join(self.api_cache, nvapp.id))

        json_file = self._get_json_data(game_cache_path, game)
        try:
            json_data = json.load(open(json_file))
        except:
            xbmcgui.Dialog().notification(
                self.core.string('name'),
                self.core.string('scraper_failed') % (game, self.name())
            )

            if json_file is not None and os.path.isfile(json_file):
                os.remove(json_file)

            return ApiResponse()

        if json_data['Response'] != 'False':
            json_data['posters'] = []
            cover_path = self._dump_image(game_cover_path, json_data['Poster'])
            if cover_path is not None:
                json_data['posters'].append(cover_path)
            del json_data['Poster']
            response = dict((k.lower(), v) for k, v in json_data.iteritems())
            if 'genre' in response:
                response['genre'] = response.get('genre').split(',')
                response['genre'] = [str(v).strip() for v in response.get('genre')]

            return ApiResponse.from_dict(**response)
        else:


            return ApiResponse()