Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
495 views
in Technique[技术] by (71.8m points)

python - does imdbpy2sql.py export soundtracks to mysql?

I downloaded all data from imdb.org/interfaces and fed that to imdbpy2sql.py. The script sucessfully imports all movies, actors, etc.

But it does not create tables for soundtracks (trivia, crazy-credits, etc.) Is the script designed to import soundtracks at all?

These are the tables that are created and populated... Am I missing something?

aka_name
aka_title
cast_info
char_name
company_name
company_type
complete_cast
comp_cast_type
info_type
keyword
kind_type
link_type
movie_companies
movie_info
movie_info_idx
movie_keyword
movie_link
name
person_info
role_type
title
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Movie information are stored not normalized (for performance reasons at insert-time) in the movie_info table. Here, the info_type_id field specify which kind of information is stored in the info field.

You can find the list of valid info_type IDs in the info_type table. For example, on my system, 'soundtrack' has ID 14.

A simple query will give you the information you're looking for. Obviously you can also use IMDbPY directly and avoid doing the query by yourself, but that depends on what you need.

For example:

from imdb import IMDb
ia = IMDb('sql', uri='mysql://username:password@localhost/imdb')
inglorious = ia.search_movie('Inglorious Basterds')[0]
ia.update(inglorious)
print inglorious['soundtrack']

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...