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 bae317b commit 3dd0d6d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,19 @@ def write_to_readme(movies):
f.write("# Einthusan Movie Details\n\n")
for movie in movies:
if movie: # Only write non-empty movie dictionaries
f.write(f"## {movie.get('title', 'Unknown Title')} ({movie.get('year', 'N/A')})\n\n")
f.write(f"## {movie.get('title', 'Unknown Title')} ({movie.get('year', 'N/A')}) ")

# Write IMDb link if available
extras = movie.get('extras', {})
if 'imdb' in extras:
f.write(f"[IMDb]({extras['imdb']})")

# Write Trailer link if available
if 'trailer' in extras:
f.write(f" [Trailer]({extras['trailer']})")

f.write("\n\n")

f.write(f"- **Synopsis**: {movie.get('synopsis', 'N/A')}\n\n")

# Writing professionals in specified format
Expand All @@ -103,13 +115,7 @@ def write_to_readme(movies):
f.write(f"- {rating_type}: {rating_value}\n")
f.write("\n")

f.write("### Links\n")
extras = movie.get('extras', {})
if 'imdb' in extras:
f.write(f"- [IMDb]({extras['imdb']})\n")
if 'trailer' in extras:
f.write(f"- [Trailer]({extras['trailer']})\n")
f.write("\n---\n\n")
f.write("---\n\n")

# Example usage
url = "https://einthusan.tv/movie/results/?find=Popularity&lang=malayalam&ptype=view&tp=l30d"
Expand Down

0 comments on commit 3dd0d6d

Please sign in to comment.