From 012841dda2f7f74d9ef0d0981ad27fcb0781a354 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sat, 3 Sep 2022 19:48:14 +0300 Subject: [PATCH] Display datasets date --- update_imdb_database.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/update_imdb_database.py b/update_imdb_database.py index e3e5b5b..fa14172 100644 --- a/update_imdb_database.py +++ b/update_imdb_database.py @@ -4,12 +4,16 @@ import requests def download_imdb_datasets(): print('Downloading title.basics.tsv.gz ...') - r = requests.get('https://datasets.imdbws.com/title.basics.tsv.gz') + r = requests.get('https://datasets.imdbws.com/title.basics.tsv.gz') + last_update = r.headers['Last-Modified'] + print(f'Dataset date: {last_update}') with open('title.basics.tsv.gz', 'wb') as basics: basics.write(r.content) del r print('Downloading title.akas.tsv.gz ...') r = requests.get('https://datasets.imdbws.com/title.akas.tsv.gz') + last_update = r.headers['Last-Modified'] + print(f'Dataset date: {last_update}') with open('title.akas.tsv.gz', 'wb') as akas: akas.write(r.content) del r