Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_path_video(filename):
guess = guessit.guess_file_info(filename)
if guess[u'type'] == u'episode':
series = guess.get(u'series', u'').title()
season = guess.get(u'season', u'')
return config.TV_PATH.format(series=series, season=season)
elif guess[u'type'] == u'movie':
title = guess.get(u'title', u'').title()
year = guess.get(u'year', u'')
return config.MOVIE_PATH.format(title=title, year=year)
else:
return None