Skip to content

Commit

Permalink
Update app.py
Browse files Browse the repository at this point in the history
  • Loading branch information
firofame authored Jul 2, 2024
1 parent a80c057 commit 16b71e8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,15 @@ def extract_movie_details(html_content):

return movies

from datetime import datetime

def write_to_readme(movies):
updated_date = datetime.now().strftime("%Y-%m-%d")
with open('README.md', 'w', encoding='utf-8') as f:
f.write("# Watch List\n\n")
f.write(f"# Watch List (Updated: {updated_date})\n\n")
for idx, movie in enumerate(movies, 1):
if movie: # Only write non-empty movie dictionaries
f.write(f"{idx}. **{movie.get('title', 'Unknown Title')}** ({movie.get('year', 'N/A')}) ")
f.write(f"### {idx}. **{movie.get('title', 'Unknown Title')}** ({movie.get('year', 'N/A')}) ")

# Write IMDb and Trailer links if available
extras = movie.get('extras', {})
Expand Down

0 comments on commit 16b71e8

Please sign in to comment.