Moiz commited on
Commit
b754266
·
1 Parent(s): 90326d2
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -5,7 +5,7 @@ import requests
5
  def fetch_movie_info():
6
  api_key = "f2443b04"
7
  movie_id = "tt1305806" # Fixed movie ID
8
- url = f"http://www.omdbapi.com/?apikey={api_key}&i={movie_id}&plot=full"
9
  response = requests.get(url)
10
 
11
  if response.status_code == 200:
@@ -37,9 +37,10 @@ with gr.Blocks(css="styles.css") as app:
37
  gr.Markdown(
38
  "This app automatically fetches and displays information about the movie: *The Secret in Their Eyes*."
39
  )
40
- output = gr.Textbox(label="Movie Details", lines=10)
41
-
42
- # Automatically populate the textbox when the app starts
43
- output.update(value=fetch_movie_info())
 
44
 
45
  app.launch()
 
5
  def fetch_movie_info():
6
  api_key = "f2443b04"
7
  movie_id = "tt1305806" # Fixed movie ID
8
+ url = f"http://www.omdbapi.com/?apikey={api_key}&i={movie_id}"
9
  response = requests.get(url)
10
 
11
  if response.status_code == 200:
 
37
  gr.Markdown(
38
  "This app automatically fetches and displays information about the movie: *The Secret in Their Eyes*."
39
  )
40
+ output = gr.Textbox(
41
+ label="Movie Details",
42
+ lines=10,
43
+ value=fetch_movie_info() # Assign fetched movie details directly
44
+ )
45
 
46
  app.launch()