forked from zce/api-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
93 lines (82 loc) · 4.34 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>API Proxy « Douban</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
<link rel="stylesheet" href="https://unpkg.com/normalize.css">
<link rel="stylesheet" href="https://unpkg.com/milligram">
<style>
.site-header {
padding-top: 2.0rem;
border-bottom: 1px solid #eee;
}
.site-main > section {
margin-top: 5rem;
}
.site-footer {
padding: 2.5rem 0;
border-top: 1px solid #eee;
}
</style>
</head>
<body>
<header class="site-header">
<div class="container">
<h1>Douban API Proxy</h1>
</div>
</header>
<main class="site-main">
<section class="container">
<h2>简单介绍</h2>
<blockquote>
<p><strong>注意:搜索接口由于官方问题暂时无法正常工作</strong></p>
</blockquote>
<p>一个豆瓣 API 的代理服务,旨在帮助各位初学者解决豆瓣屏蔽小程序请求问题(豆瓣接口 403 问题)<br> ε=ε=ε=(~ ̄▽ ̄)~</p>
<p><a href="https://github.com/zce/douban-api-proxy" class="button">View Source</a></p>
</section>
<section class="container">
<h2>我个人提供的代理服务</h2>
<ul>
<li><a href="https://douban.uieee.com">https://douban.uieee.com</a> (已备案)</li>
<li><a href="https://douban-api.uieee.com">https://douban-api.uieee.com</a> (已备案)</li>
<li><a href="https://douban-api.now.sh">https://douban-api.now.sh</a></li>
<li><a href="https://douban-api.zce.now.sh">https://douban-api.zce.now.sh</a></li>
</ul>
<p>🎉 代理服务现已支持 CORS 调用~</p>
<p>每个代理限流:10000 次 / 1 小时,由于是豆瓣官方的限流,所以所有使用该地址的朋友都是共享这 10000 次请求的,我也没办法再去提高这个数字(普通个人用户是 100 次 / 1 小时),所以还是<strong>希望大家不要滥用</strong>。</p>
<blockquote>
<p>P.S. 我搭建的这个免费的服务中接口权限更高,可以使用影评、图书、音乐之类的接口,原因是我在代理请求的同时额外添加了一个 `apikey`(由于特殊原因就不公开这个 KEY 了)</p>
</blockquote>
</section>
<section class="container">
<h2>解决方案(原理)</h2>
<p>经过排查和摸索,豆瓣应该是根据 HTTP <code>Referer</code> 判断是否为小程序内发起的请求,所以我们<strong>通过反向代理的方式修改源请求中的 <code>Referer</code> 解决</strong>。</p>
<p>至于有些朋友想在客户端直接修改请求 Referer 的话,我只能说不可能,你应该去补习一下基本功,给你一个链接:</p>
<p><a href="https://fetch.spec.whatwg.org/#forbidden-header-name">Fetch forbidden header names</a></p>
<p>我的解决办法很简单:通过 Nginx 或者其他的代理方式中转一下,从而规避这个问题。</p>
</section>
<section class="container">
<h2>豆瓣 API 文档</h2>
<blockquote>
<p>豆瓣 API 服务可能计划对外关闭(目前除部分接口,其余仍可继续使用),官方 API 文档已经下线,考虑到众多初学者的需要我重新整理了一份:</p>
</blockquote>
<ul>
<li>文档源文件:<a href="https://github.com/zce/douban-api-docs">https://github.com/zce/douban-api-docs</a></li>
<li>在线地址:<a href="https://douban-api-docs.zce.me">https://douban-api-docs.zce.me</a></li>
</ul>
</section>
<section class="container">
<h2>免责声明</h2>
<p>本仓库只是为了“部落”的崛起,如涉及侵犯个人或者团体利益,请与我取得联系,我将主动删除一切相关资料,谢谢!</p>
</section>
</main>
<footer class="site-footer">
<p class="container">
This service is hosted by <a href="https://zeit.co/now">ZEIT Now</a>.
<a href="https://github.com/zce/douban-api-proxy"></></a> with <span class="heart">♥</span> by <a href="https://zce.me">zce</a>.
Licensed under the <a href="https://github.com/zce/douban-api-proxy/blob/master/LICENSE">MIT License</a>.
</p>
</footer>
</body>
</html>