Example #1
0
        '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...'
    collection_data = my_episodes.get_collection_episodes(show["id"])
    collection_changes = trakt.add_to_collection(tvdb_data['seriesname'],
                                                 tvdb_data['id'],
                                                 collection_data)

    added = collection_changes['added']['episodes']
    updated = collection_changes['updated']['episodes']
    existing = collection_changes['existing']['episodes']
    if added > 0:
        print "    Added: {} episodes".format(added)
    if updated > 0:
        print "    Updated: {} episodes".format(updated)
    if existing > 0:
        print "    Existing: {} episodes".format(existing)
    if added == 0 and updated == 0 and existing == 0:
        print '    Show not found.'

    print '  Importing watched episodes...'
Example #2
0
    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...'
    collection_data = my_episodes.get_collection_episodes(show["id"])
    collection_changes = trakt.add_to_collection(
            tvdb_data['seriesname'],
            tvdb_data['id'],
            collection_data)

    added = collection_changes['added']['episodes']
    updated = collection_changes['updated']['episodes']
    existing = collection_changes['existing']['episodes']
    if added > 0:
        print "    Added: {} episodes".format(added)
    if updated > 0:
        print "    Updated: {} episodes".format(updated)
    if existing > 0:
        print "    Existing: {} episodes".format(existing)
    if added == 0 and updated == 0 and existing == 0:
        print '    Show not found.'
    
    print '  Importing watched episodes...'