2022-09-01 16:17:36 +03:00
|
|
|
from src import imdb_datasets_worker
|
|
|
|
import requests
|
|
|
|
|
|
|
|
|
|
|
|
def download_imdb_datasets():
|
|
|
|
print('Downloading title.basics.tsv.gz ...')
|
2022-09-03 19:48:14 +03:00
|
|
|
r = requests.get('https://datasets.imdbws.com/title.basics.tsv.gz')
|
|
|
|
last_update = r.headers['Last-Modified']
|
|
|
|
print(f'Dataset date: {last_update}')
|
2022-09-01 16:17:36 +03:00
|
|
|
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')
|
2022-09-03 19:48:14 +03:00
|
|
|
last_update = r.headers['Last-Modified']
|
|
|
|
print(f'Dataset date: {last_update}')
|
2022-09-01 16:17:36 +03:00
|
|
|
with open('title.akas.tsv.gz', 'wb') as akas:
|
|
|
|
akas.write(r.content)
|
|
|
|
del r
|
|
|
|
|
|
|
|
|
|
|
|
download_imdb_datasets()
|
|
|
|
imdb_datasets_worker.convert_datasets_to_db()
|