imdbpy2sql.py导出音轨到mysql吗? [英] does imdbpy2sql.py export soundtracks to mysql?

查看:207
本文介绍了imdbpy2sql.py导出音轨到mysql吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从imdb.org/interfaces下载了所有数据,并将其输入到imdbpy2sql.py。
该脚本成功导入所有电影,演员等。



但是它不会创建配乐表(琐事,疯狂信用等)
脚本是否设计为导入音轨?



这些是创建和填充的表...我错过了什么?

  aka_name 
aka_title
cast_info
char_name
company_name
company_type
complete_cast
comp_cast_type
info_type
关键字
kind_type
link_type
movie_companies
movie_info
movie_info_idx
movie_keyword
movie_link
name
person_info
role_type
title


解决方案

电影信息在movie_info表中未被归一化(出于性能原因在插入时间)。
这里,info_type_id字段指定信息字段中存储哪种信息。



您可以在info_type表中找到有效的info_type ID列表。例如,在我的系统上,soundtrack的ID为14。



一个简单的查询将为您提供您要查找的信息。
显然,你也可以直接使用IMDbPY,并避免自己做查询,但这取决于你需要的。



例如:

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


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

解决方案

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']

这篇关于imdbpy2sql.py导出音轨到mysql吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆