config.get('MyEpisodes', 'Password')) login = my_episodes.login() if (login == False): print "ERROR - Could not login to MyEpisodes" sys.exit(1) my_episodes.get_show_list() trakt = Trakt(config.get('Trakt', 'ClientId'), config.get('Trakt', 'ClientSecret')) print "Requesting Trakt.tv authorization..." print "To authorize access to you trakt.tv account access the following URL in a web browser and copy the authorization code:" print trakt.get_authorize_url() code = raw_input('Paste the authorization code here: ') trakt.authorize(code) for show in my_episodes.show_list: show['name'] = unicodedata.normalize('NFKD', show['name']).encode( 'ascii', 'ignore') print "\nProcessing: {}".format(show['name']) try: tvdb_data = tvdb[show['name']] except: f = open('fails.txt', 'a') f.write("%s\n" % show['name']) print "ERROR - Could not get TVDB ID for {}".format(show['name']) print "Skipping show: {}".format(show['name']) continue
if(login == False): print "ERROR - Could not login to MyEpisodes" sys.exit(1) my_episodes.get_show_list() trakt = Trakt( config.get('Trakt', 'ClientId'), config.get('Trakt', 'ClientSecret')) print "Requesting Trakt.tv authorization..." print "To authorize access to you trakt.tv account access the following URL in a web browser and copy the authorization code:" print trakt.get_authorize_url() code = raw_input('Paste the authorization code here: ') trakt.authorize(code) for show in my_episodes.show_list: show['name'] = unicodedata.normalize('NFKD', show['name']).encode('ascii','ignore') print "\nProcessing: {}".format(show['name']) try: tvdb_data = tvdb[show['name']] except: f = open('fails.txt', 'a') f.write("%s\n" % show['name']) print "ERROR - Could not get TVDB ID for {}".format(show['name']) print "Skipping show: {}".format(show['name']) continue print ' Importing collection...'