-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathgenerate_json.py
More file actions
43 lines (37 loc) · 1.12 KB
/
Copy pathgenerate_json.py
File metadata and controls
43 lines (37 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import json
# Define the number of entries you need to generate
num_entries = 1200
# Create a list to hold all movie data
movie_list = []
# Generate the movie entries
for i in range(7, num_entries + 7): # Start from ID 7 to match your example
movie = {
"id": i,
"title": "",
"dateWatched": "",
"watched": False,
"trailerLink": "",
"movieLink": "",
"modernTrailerLink": "",
"requestedBy": {
"userId": "",
"username": "",
"platform": ""
},
"category": "",
"trailerPrivate": False,
"moviePrivate": False,
"year": 0,
"subtitles": True,
"language": "",
"voteCount": 0,
"imageUrl": f"./img/movie{i}.jpg", # Dynamically set the image filename
"runtime": "",
"ratings": ""
}
# Append each movie to the list
movie_list.append(movie)
# Write the list to a JSON file
with open('movieList.json', 'w') as json_file:
json.dump(movie_list, json_file, indent=4)
print(f"Successfully generated {num_entries} movie entries in 'movieList.json'.")