连接到 IMDB
以前有人这样做过吗? 在我看来应该有一个网络服务,但我找不到。 我正在编写一个供个人使用的应用程序,该应用程序仅显示 IMDB 的基本信息。
Has any one done this before? It would seem to me that there should be a webservice but i can't find one. I am writing an application for personal use that would just show basic info from IMDB.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
IMDb 的库目前看来相当不可靠且效率极低。 我真的希望 IMDb 能够创建一个网络服务。
经过一番搜索后,我找到了 IMDb 的合理替代方案。 它提供了所有基本信息,例如概述、年份、评分、海报、预告片等:
电影数据库 (TMDb)< /a>.
它提供了一个带有多种语言的包装器的网络服务,并且到目前为止看起来很可靠。 对于我自己来说,搜索结果也更加准确。
The libraries for IMDb seem quite unreliable at present and highly inefficient. I really wish IMDb would just create a webservice.
After a bit of searching I found a reasonable alternative to IMDb. It provides all the basic information such as overview, year, ratings, posters, trailers etc.:
The Movie Database (TMDb).
It provides a webservice with wrappers for several languages and seems reliable so far. The search results have been, for myself, more accurate as well.
没有可用的网络服务。
但是有足够多的用每种语言编写的 html 抓取工具来满足您的需求!
我在一些个人项目中使用了 .NET 3.5 Imdb 服务开源项目。
1 分钟谷歌结果:
There is no webservice available.
But there are enough html scrapers written in every language to suit your needs!
I've used the .NET 3.5 Imdb Services opensource project in a few personal projects.
1 minute google results:
IMDb 发布的唯一“API”是一组纯文本数据文件,其中包含格式化的演员列表、导演、电影等。您可能需要编写自己的解析器,除非有人为您的语言发布了解析器。 尝试使用 Google 搜索“imdb api”和“imdb 解析器”。
屏幕抓取工具可能很有用,但他们在使用条款中明确禁止抓取工具。
The only "API" the IMDb publishes is a set of plain-text data files containing formatted lists of actors, directors, movies, etc. You would likely need to write your own parser unless somebody has released one for your language. Try Google searches like "imdb api" and "imdb parser".
A screen scraper might be useful, but they specifically prohibit scrapers in their terms of use.
虽然这是两年前发布的,但这里有一个简单的 python 代码,
另存为 imdb.py,然后在 shell 或终端或其他任何地方运行,
如果您想要 xml 数据,只需将 json 替换为 xml
请注意,这是使用 imdbapi.com网站返回 json 结果访问该网站以查看更多选项。
Though this was posted over two years ago, here is a simple python code
save as imdb.py and then run as in shell or terminal or whatever
if you want xml data just replace json with xml
please note that this is using the imdbapi.com website to return a json result visit that website to view more options.
这是我自己使用正则表达式的解决方案:
Here is my own solution using RegEx:
IMDB 禁止抓取工具,并且每隔一段时间就更改页面布局,因此解析 HTML 是一种选择,但准备好每年调整代码 2-3 次(去过那里、做过那个、放弃过)。 他们确实有一项收费服务,可以完全访问数据,但您还需要解释它的用途,并说服他们您不是在建立一个竞争网站(我有一个链接,但似乎已更改且现在找不到)。
IMDB prohibits scrapers, and change the page layout every once in a while, so parsing HTML is an option, but be prepared to adjust your code 2-3 times a year (been there, done that, given up). They do have a fee-based service giving the full access to the data, but you'll also need to explain what is it for, and convince them you are not building a competitive website (I had a link to that, but it seems to have changed and can't find it now).
另一种选择是在本地计算机上运行 IMDB 数据库。 Java 电影数据库 导入 IMDB 数据库文件,对其进行转换并提供可本地访问的 IMDB 副本。 IMDB 具有 Java 电影数据库所没有的一些功能,反之亦然,但如果您正在寻找的是快速访问所有数据,那么可能值得一试。
Another alternative is to run the IMDB database on your local machine. Java Movie Database imports the IMDB database files, converts them and provides a locally-accessible copy of IMDB. IMDB has some functionality which Java Movie Database does not have and visa-versa but if what you're looking for is quick access to all the data it might be worth giving this a try.
现在有一个(未记录的)API,例如
http://www.imdb.com/xml/find?json=1&q=Harry+Potter
。 请参阅 IMDB 是否提供 API?Now there's is an (undocumented) API like
http://www.imdb.com/xml/find?json=1&q=Harry+Potter
. See Does IMDB provide an API?TRYNT Heavy Technologies 提供(免费)用于检索基本 IMDb 数据的 Web 服务 - 请访问他们的网站 http://www.trynt.com/trynt-movie-imdb-api/。 他们还提供单独的电视数据服务。
TRYNT Heavy Technologies provides (for free) a web service for retrieving basic IMDb data -- check out their site at http://www.trynt.com/trynt-movie-imdb-api/. They also have a separate service for Television data.
至少有一个名为 IMDb8 的非官方 IMDb API。 它有大约 31 个端点,包括
等。与任何其他 API 一样,它使用起来非常简单。 我使用这个 API 构建了一个有趣的问答项目。 您可以在此处找到有关如何入门的教程。
There is at least one unofficial IMDb API called IMDb8. It has about 31 endpoints including
etc. Like any other API it is very straightforward to use. I used this API for building a fun trivia project. You can find a tutorial on how to get started here.