How to get the json file as well
Noah-0214 opened this issue · comments
Noah-0214 commented
I ran the script and I got the csv files, but I wonder if I can get the json files as well?
Renzhiairen commented
Noah I ran the code for my country Italy, but I got only a dataset of 200 rows ? Do you know why? I was expecting a larger dataset
Noah-0214 commented
I think you are just getting data from that specific day, so I'm assuming there were just 200 trending videos that day
bhdben commented
to get json...
def write_to_file(country_code, country_data):
print(f"Writing {country_code} data to file...")
if not os.path.exists(output_dir):
os.makedirs(output_dir)
with open(f"{output_dir}/{time.strftime('%y.%d.%m')}_{country_code}_videos.json", "w+", encoding='utf-8') as file:
json.dump(country_data, file, ensure_ascii=False, indent=2)