Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python
import sys
from tvdb_api import Tvdb
from tvnamer.config_defaults import defaults
from tvnamer.utils import Config, FileParser, FileFinder
from tvnamer.tvnamer_exceptions import (ShowNotFound, SeasonNotFound, EpisodeNotFound,
EpisodeNameNotFound, UserAbort, InvalidPath, NoValidFilesFoundError,
InvalidFilename, DataRetrievalError)
if __name__ == "__main__":
tvdb_instance = Tvdb(
interactive = False,
search_all_languages = Config['search_all_languages'],
language = 'en')
finder = FileFinder(sys.argv[1],
with_extension=['mp4', 'avi', 'mkv'],
recursive=True)
series = dict()
for file in finder.findFiles():
parser = FileParser(file)
episode = parser.parse()
name= episode.seriesname.lower()
if name not in series:
series[name] = []
series[name].append(episode)
for serie, episodes in series.items():
print serie
print tvdb_instance[serie]
@athoune
Copy link
Author

athoune commented Sep 4, 2014

mkdir tvseries
cd tvseries
virtualenv .
source bin/activate
pip install tvnamer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment