AI prompts
base on 自建哔哩漫游解析服务器(PHP) # 写在开头
* 动手能力强的可以用这个,服务器回应的速度比我这个快多了。
* Go: https://github.com/JasonKhew96/biliroaming-go-server
* Rust: https://github.com/pchpub/BiliRoaming-Rust-Server
----
# BiliRoaming-PHP-Server
哔哩漫游 PHP 解析服务器
自建解析服务器参考配置
## 下载:
* [下载最新版](https://github.com/david082321/BiliRoaming-PHP-Server/releases/latest)
## 用法:
* 直接放到网站根目录,例如 wwwroot 或 public_html 或 private_html 或 网站域名的文件夹(宝塔)
* 默认为「在线黑名单」模式。
## 示例:
![示例](https://i.loli.net/2021/01/10/VwJ5D1GoRBbyfmq.jpg)
(完成)
------
## (非必要步骤) 修改黑白名单模式、修改其他设置
* 默认为「在线黑名单」模式,若您想使用「本地黑名单」或是「黑名单-替换国产动画」或是「在线白名单」或是「本地白名单」或是「无任何限制」等其他模式,请手动修改 config.php
* config.php 每个修改项目,后面都有注释提供参考
## (非必要步骤) 防止重复的 301 转址
若要开启网页版油猴脚本的支持,务必设置这个
### Apache
* [下载这个,然后放在网站根目录 (.htaccess) ](https://github.com/david082321/BiliRoaming-PHP-Server/blob/main/.htaccess)
### Nginx
* 在配置文件中加入以下代码
```
server {
#...(中间略过,请加在配置文件最底下)...
rewrite "^/intl/gateway/v2/app/search/type?(.*)$" /intl/gateway/v2/app/search/type/index.php?$1 last;
rewrite "^/intl/gateway/v2/app/search/v2?(.*)$" /intl/gateway/v2/app/search/v2/index.php?$1 last;
rewrite "^/intl/gateway/v2/app/subtitle?(.*)$" /intl/gateway/v2/app/subtitle/index.php?$1 last;
rewrite "^/intl/gateway/v2/ogv/playurl?(.*)$" /intl/gateway/v2/ogv/playurl/index.php?$1 last;
rewrite "^/intl/gateway/v2/ogv/view/app/season?(.*)$" /intl/gateway/v2/ogv/view/app/season/index.php?$1 last;
rewrite "^/intl/gateway/v2/ogv/view/app/season2?(.*)$" /intl/gateway/v2/ogv/view/app/season2/index.php?$1 last;
rewrite "^/intl/gateway/v2/ogv/view/app/episode?(.*)$" /intl/gateway/v2/ogv/view/app/episode/index.php?$1 last;
rewrite "^/pgc/player/api/playurl?(.*)$" /pgc/player/api/playurl/index.php?$1 last;
rewrite "^/pgc/player/web/playurl?(.*)$" /pgc/player/web/playurl/index.php?$1 last;
rewrite "^/pgc/view/web/season?(.*)$" /pgc/view/web/season/index.php?$1 last;
rewrite "^/x/intl/passport-login/oauth2/refresh_token?(.*)$" /x/intl/passport-login/oauth2/refresh_token/index.php?$1 last;
rewrite "^/x/v2/search/type?(.*)$" /x/v2/search/type/index.php?$1 last;
rewrite "^/x/web-interface/search/type?(.*)$" /x/web-interface/search/type/index.php?$1 last;
}
```
### Nginx,但是是宝塔用户
* 打开网站设置的「伪静态」,然后直接复制下面代码,然后保存
```
rewrite "^/intl/gateway/v2/app/search/type?(.*)$" /intl/gateway/v2/app/search/type/index.php?$1 last;
rewrite "^/intl/gateway/v2/app/search/v2?(.*)$" /intl/gateway/v2/app/search/v2/index.php?$1 last;
rewrite "^/intl/gateway/v2/app/subtitle?(.*)$" /intl/gateway/v2/app/subtitle/index.php?$1 last;
rewrite "^/intl/gateway/v2/ogv/playurl?(.*)$" /intl/gateway/v2/ogv/playurl/index.php?$1 last;
rewrite "^/intl/gateway/v2/ogv/view/app/season?(.*)$" /intl/gateway/v2/ogv/view/app/season/index.php?$1 last;
rewrite "^/intl/gateway/v2/ogv/view/app/season2?(.*)$" /intl/gateway/v2/ogv/view/app/season2/index.php?$1 last;
rewrite "^/intl/gateway/v2/ogv/view/app/episode?(.*)$" /intl/gateway/v2/ogv/view/app/episode/index.php?$1 last;
rewrite "^/pgc/player/api/playurl?(.*)$" /pgc/player/api/playurl/index.php?$1 last;
rewrite "^/pgc/player/web/playurl?(.*)$" /pgc/player/web/playurl/index.php?$1 last;
rewrite "^/pgc/view/web/season?(.*)$" /pgc/view/web/season/index.php?$1 last;
rewrite "^/x/intl/passport-login/oauth2/refresh_token?(.*)$" /x/intl/passport-login/oauth2/refresh_token/index.php?$1 last;
rewrite "^/x/v2/search/type?(.*)$" /x/v2/search/type/index.php?$1 last;
rewrite "^/x/web-interface/search/type?(.*)$" /x/web-interface/search/type/index.php?$1 last;
```
## (非必要步骤) 缓存
多人使用时建议开启
* 安装 MySQL
* 修改 config.php 的 SAVE_CACHE 设置
* 导入 cache.sql
* 配置 config.php 的“MySQL数据库”
* 可选项:开启 Redis 可以加快服务器反应速度
* 安装 Redis
* 配置 config.php 的“redis数据库”
## (非必要步骤,实验性) 支持网页版油猴脚本
* [油猴脚本地址](https://github.com/ipcjs/bilibili-helper/blob/user.js/packages/unblock-area-limit/README.md)
* 修改 config.php 的 WEB_ON 设置
* 配置上面的禁用 301 转址
* 脚本的 代理服务器->自定义 输入以下内容 (example.com 请改成你的服务器地址)
##### https://example.com
* 注意:不配置上面的 「禁用 301 转址」,将无法正常加载。(哔哩漫游无影响)
* 题外话:如果不会配置,可以改用[这个脚本](https://github.com/zzc10086/grocery_store/blob/master/bili_proxy/BPplayurl.php)
--------
# 文件功能介绍
```
├─intl/gateway/v2
│ ├─app
│ │ └─search
│ │ ├─type/index.php (东南亚APP 搜索)
│ │ └─v2/index.php (东南亚APP 搜索)
│ └─subtitle/index.php (东南亚APP 字幕)
│ └─ogv
│ ├─playurl/index.php (东南亚APP 播放地址)
│ ├─view/app/episode/index.php (东南亚APP episode)
│ ├─view/app/season/index.php (东南亚APP season)
│ └─view/app/season2/index.php (东南亚APP season)
├─pgc
│ ├─player
│ │ ├─api/playurl/index.php (APP 播放地址)
│ │ └─web/playurl/index.php (WEB 播放地址)
│ └─view
│ └─web/season/index.php (WEB season)
├─x/
│ ├─intl/passport-login/oauth2/refresh_token/index.php (东南亚APP refresh_token)
│ ├─v2/search/type/index.php (APP 搜索)
│ └─web-interface/search/type/index.php (WEB 搜索)
├─utils/
│ ├─auth.php (鉴权)
│ ├─fuck_search.php (在搜索中添加提示)
│ ├─fuck_sub.php (添加东南亚番剧字幕)
│ ├─functions.php (功能函数合集)
│ ├─functions_cache.php (功能函数合集)[仅缓存使用]
│ ├─functions_cache_key.php (功能函数合集)[仅缓存使用]
│ ├─lock_area.php (锁区、web接口判断)
│ ├─process.php (处理用户传入参数)
│ ├─refresh_token.php (自动刷新访问密钥)
│ ├─refresh_token_th.php (自动刷新访问密钥)
│ ├─replace.php (修改返回内容)
│ ├─replace_playurl.php (替换视频)
│ ├─resign.php (替换访问密钥)
│ └─version.php (版本信息、Header)
├─.htaccess (防止重复的 301 转址)
├─add_key.php (添加访问密钥)[仅缓存使用]
├─cache.sql (导入 MySQL 用的)[仅缓存使用]
├─config.php (设置本程序各种参数) <──参数设置在这里
├─hello.php (默认欢迎页面)
└─index.php (WEB 播放地址、显示欢迎页)
```
", Assign "at most 3 tags" to the expected json: {"id":"3821","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"