Skip to content

AisukaYuki/bilibili-oversea-search

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 

Repository files navigation

bilibili海外区域搜索

首先安装Tampermonkey等脚本管理工具,然后点击这里安装脚本。

在搜索页面选中番剧标签,设置好代理服务器,代理服务器相关详见这里

设置好代理服务器后在下拉框选择相应的服务器点击“搜索”按钮即可搜索。

港澳台搜索代理

港澳台可通过部署阿里云函数香港节点 HTTP 函数实现,下面为部署代码,代理服务器填写除了 https:// 外的完整路径。另外部分公共服务器可能不支持港澳台搜索,请自行选择使用。

var getRawBody = require('raw-body');
var getFormBody = require('body/form');
var body = require('body');

exports.handler = (req, resp, context) => {
    'use strict';

    const params = {
        path: req.path,
        queries: req.queries,
        headers: req.headers,
        method: req.method,
        requestURI: req.url,
        clientIP: req.clientIP,
    }
    const https = require('https');
    let queries = [];
    for (const key in req.queries) {
        queries.push(`${key}=${encodeURIComponent(req.queries[key])}`);
    }
    const options = {
        hostname: 'api.bilibili.com',
        port: 443,
        path: req.path + '?' + queries.join('&'),
        method: 'GET',
        headers: {
            'Referer': 'https://search.bilibili.com/bangumi',
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36 Edg/93.0.961.52'
        }
    };
    const httpsRequest = https.request(options, (res) => {
        console.log('statusCode:', res.statusCode);
        let responseText = '';
        res.on('data', (d) => {
            responseText += d.toString();
        });
        res.on('end', function() {
            resp.send(responseText);
        });
    });

    httpsRequest.on('error', (error) => {
        resp.send(error.toString());
    });
    httpsRequest.end();
}

About

bilibili海外区域搜索

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%