def get_links(watchlist): links = [] for show in watchlist: show_name = show["name"] (last_season, last_episode) = show["lastDownloaded"].split("-") last_season = int(last_season) last_episode = int(last_episode) try: seasons = EztvAPI().tv_show(show_name).seasons() for season in seasons: for episode in seasons[season]: if (season > last_season or (season == last_season and episode > last_episode)): season_name = "0" + str( season) if season < 10 else str(season) episode_name = "0" + str( episode) if episode < 10 else str(episode) magnet = seasons[season][episode] links.append( (show_name, season_name, episode_name, magnet)) except TVShowNotFound as e: print e pass except Exception as e: #do nothing since show is found pass return links
from eztv_api import EztvAPI test_api = EztvAPI().tv_show('New girl') # get all the seasons from New girl seasons = test_api.seasons() for season in seasons: for episode in seasons[season]: # will print the magnet link of all episodes, in all seasons print seasons[season][episode] # specific season episodes = test_api.season(3) for episode in episodes: # will print the magnet link for all episodes print episodes[episode] # specific episode print test_api.episode(3, 10)
old_episode = episode update_tv_show(name, str(old_season), str(old_episode)) def update_config_file(): global parser, CONFIG_FILE with open(CONFIG_FILE, 'wb') as configfile: parser.write(configfile) if (len(sys.argv) > 1 and sys.argv[1] == "--v"): VERBOSE_MODE = True while True: parser.read(CONFIG_FILE) for serie in parser.sections(): # iterate on all series if (serie != "config"): try: display_message("Checking for TV Show %s" % (serie)) test_api = EztvAPI().tv_show(serie) iterate_on_seasons(test_api.seasons(), serie) except Exception, err: print Exception, err else: pass update_config_file() time.sleep(float(TIMER * 10))
old_season = season old_episode = episode update_tv_show(name, str(old_season), str(old_episode)) def update_config_file(): global parser, CONFIG_FILE with open(CONFIG_FILE, 'wb') as configfile: parser.write(configfile) if (len(sys.argv) > 1 and sys.argv[1] == "--v"): VERBOSE_MODE = True while True: parser.read(CONFIG_FILE) for serie in parser.sections(): # iterate on all series if (serie != "config"): try: display_message("Checking for TV Show %s" % (serie)) test_api = EztvAPI().tv_show(serie) iterate_on_seasons(test_api.seasons(), serie) except Exception, err: print Exception, err else: pass update_config_file() time.sleep(float(TIMER * 10))
from eztv_api import EztvAPI test_api = EztvAPI().tv_show('Game Of Thrones') # get all the seasons from Game Of Thrones seasons = test_api.seasons() for season in seasons: for episode in seasons[season]: # will print the magnet link of all episodes, in all seasons print seasons[season][episode] # specific season episodes = test_api.season(3) for episode in episodes: # will print the magnet link for all episodes print episodes[episode] # specific episode print test_api.episode(3, 10)
from eztv_api import EztvAPI import subprocess test_api=EztvAPI().tv_show('Game of Thrones') print subprocess.check_output('transmission-remote -a '+test_api.episode(1,3), shell=True)