'TVMaze episode lookup'

@etag
@api.response(200, u'Successfully    found    episode', tvmaze_episode_schema)
@api.response(NotFoundError)
@api.response(BadRequest)
def get(self, tvmaze_id, session=None):

    args = episode_parser.parse_args()
    air_date = args.get(u'air_date')
    season_num = args.get(u'season_num')
    ep_num = args.get(u'ep_num')
    kwargs = {u'tvmaze_id': tvmaze_id, u'session': session}
    if air_date:
        kwargs[u'series_id_type'] = u'date'
        kwargs[u'series_date'] = air_date
    elif (season_num and ep_num):
        kwargs[u'series_id_type'] = u'ep'
        kwargs[u'series_season'] = season_num
        kwargs[u'series_episode'] = ep_num
    else:
        raise BadRequest(u'not    enough    parameters    sent    for    lookup')
    try:
        episode = tvm.episode_lookup(**kwargs)
    except LookupError as e:
        raise NotFoundError(e.args[0])
    return jsonify(episode.to_dict())
