首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >未经授权(HTTP 401) R omdbapi

未经授权(HTTP 401) R omdbapi
EN

Stack Overflow用户
提问于 2017-05-23 09:06:06
回答 2查看 2.2K关注 0票数 0

当我试图访问OMDbAPI (http://www.omdbapi.com/)时,会收到一个错误。此外,当我去那个网站并尝试手动查找一部电影时,我会得到一个Response failed

我试图运行这一行:find_by_title('Arrival', year_of_release = 2016),并获得以下错误:Error in find_by_title("Arrival", year_of_release = 2016) : Unauthorized (HTTP 401).

任何帮助都是非常感谢的。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-05-25 08:21:52

您必须获得一个密钥并将其添加到所有请求中。

OMDb API:http://www.omdbapi.com/?i=tt3896198&apikey=key海报API:http://img.omdbapi.com/?i=tt3896198&h=600&apikey=key

这是他们网站上的东西。

代码语言:javascript
复制
We are going private!

05/10/17 - New API Keys! Due to some security concerns on how the keys were being distributed I updated the form to email them and also changed the algorithm used, which means your older keys not obtained through email will eventually stop working. 

05/08/17 - Going Private! Please go read the post on the Patreon page about this major change. 

你必须得到一个API密钥。

票数 1
EN

Stack Overflow用户

发布于 2017-06-17 15:15:44

我用了他们的API一年多了,现在停止了。如果您需要执行大量查询,那么我认为成为OMDBAPI的赞助商是个好主意。然而,我在我的小型私人项目中使用了它们的API。在搜索了一下之后,我找到了另一个API。下面是PHP中的代码,也许您可以在R中执行类似的操作:

代码语言:javascript
复制
<?php
$imdbID = 'tt2866360';
$data = json_decode(file_get_contents('http://api.rest7.com/v1/movie_info.php?imdb=' . $imdbID));

if (@$data->success !== 1)
{
    die('Failed');
}
echo '<pre>';
print_r($data->movies[0]);

我不附属于这个网站。但是我使用这个API,所以如果有人知道的话,我可以回答一两个问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44130398

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档