Commit c4c2c7f8 authored by Yu Gan's avatar Yu Gan

Initial commit of media microservices

parent 5a6c00d8
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import json
file1 = open("casts_1_10.json", "r")
file2 = open("casts_11_20.json", "r")
file3 = open("casts_21_30.json", "r")
file4 = open("casts_31_40.json", "r")
file5 = open("casts_41_50.json", "r")
casts = list()
casts += json.load(file1)
casts += json.load(file2)
casts += json.load(file3)
casts += json.load(file4)
casts += json.load(file5)
with open("casts.json", "w") as file:
unique_casts = []
ids = []
for cast in casts:
try:
if cast["id"] not in ids:
ids.append(cast["id"])
unique_casts.append(cast)
except:
pass
json.dump(unique_casts, file, indent=2)
import json
import io
with open("movies.json", "r") as in_file:
movies = json.load(in_file)
with io.open("movie_titles.txt", "w", encoding='utf8') as out_file:
for movie in movies:
try:
out_file.write("\"" + movie["title"] + "\",\n")
except:
print(movie["title"])
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import json
file1 = open("movies_1_10.json", "r")
file2 = open("movies_11_20.json", "r")
file3 = open("movies_21_30.json", "r")
file4 = open("movies_31_40.json", "r")
file5 = open("movies_41_50.json", "r")
movies = list()
movies += json.load(file1)
movies += json.load(file2)
movies += json.load(file3)
movies += json.load(file4)
movies += json.load(file5)
with open("movies.json", "w") as file:
json.dump(movies, file, indent=2)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment