Last active
January 22, 2017 01:45
-
-
Save srob650/745f6a074d69974106c20d50000350ac to your computer and use it in GitHub Desktop.
[pytvmaze] Get all episodes for show for next 7 days
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import pytvmaze | |
today = datetime.datetime.now() | |
week = today + datetime.timedelta(days=7) | |
tvm = pytvmaze.TVMaze() | |
# Edit maze_id for desired show | |
s = tvm.get_show(maze_id=279) | |
eps = [episode for episode in s.episodes | |
if datetime.datetime.strptime(episode.airdate, '%Y-%M-%d') >= today | |
and datetime.datetime.strptime(episode.airdate, '%Y-%M-%d') <= week] | |
print(eps) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment