'TheTVDB episode lookup'

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

    args = episode_parser.parse_args()
    language = args[u'language']
    absolute_number = args.get(u'absolute_number')
    season_number = args.get(u'season_number')
    ep_number = args.get(u'ep_number')
    air_date = args.get(u'air_date')
    if (not ((season_number and ep_number) or absolute_number or air_date)):
        raise BadRequest(u'not    enough    parameters    for    lookup.    Either    season    and    episode    number    or    absolute    number    are    required.')
    kwargs = {u'tvdb_id': tvdb_id, u'session': session, u'language': language}
    if absolute_number:
        kwargs[u'absolute_number'] = absolute_number
    if (season_number and ep_number):
        kwargs[u'season_number'] = season_number
        kwargs[u'episode_number'] = ep_number
    if air_date:
        kwargs[u'first_aired'] = air_date
    try:
        episode = lookup_episode(**kwargs)
    except LookupError as e:
        raise NotFoundError(e.args[0])
    return jsonify(episode.to_dict())
