mirror of
https://gitea.phreedom.club/localhost_frssoft/FMN_bot
synced 2024-12-23 02:23:34 +02:00
Download and update datasets script
This commit is contained in:
parent
b8a47f8db4
commit
4d9a30c5f5
2 changed files with 20 additions and 3 deletions
|
@ -5,11 +5,9 @@ import logging
|
|||
|
||||
|
||||
def main():
|
||||
# imdb_datasets_worker.convert_datasets_to_db()
|
||||
|
||||
logging.basicConfig(level=logger_default_level)
|
||||
|
||||
#listener_mention.run_scan_notif() # Слушаем упоминания в фоне
|
||||
listener_mention.run_scan_notif() # Слушаем упоминания в фоне
|
||||
|
||||
listener_context.scan_context_thread() # Слушаем тред на новые предложения фильмов
|
||||
|
||||
|
|
19
update_imdb_database.py
Normal file
19
update_imdb_database.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
from src import imdb_datasets_worker
|
||||
import requests
|
||||
|
||||
|
||||
def download_imdb_datasets():
|
||||
print('Downloading title.basics.tsv.gz ...')
|
||||
r = requests.get('https://datasets.imdbws.com/title.basics.tsv.gz')
|
||||
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')
|
||||
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()
|
Loading…
Reference in a new issue