Compare commits

..

No commits in common. "4045f1ad3f82987588aaf9ea8eb3c79a61b06bb6" and "a79a2d9ef620d217851455aeb15dfef4f7e0a328" have entirely different histories.

4 changed files with 54 additions and 13 deletions

46
.github/workflows/pr-reviewer.yml vendored Normal file
View File

@ -0,0 +1,46 @@
name: opencode-review
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
permissions:
contents: read
jobs:
review:
# 跳过 fork 来的 PRGitHub 不会把 secrets 传给 fork PR 触发的工作流,
# 跑了也必然失败,所以直接跳过避免噪音(平台限制,非配置问题)。
if: github.event.pull_request.head.repo.fork == false
runs-on: ubuntu-latest
steps:
- name: Generate bot token
id: token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
token: ${{ steps.token.outputs.token }}
- name: Configure git identity
run: |
git config --global user.name "takanashi-hoshino-agent[bot]"
git config --global user.email "takanashi-hoshino-agent[bot]@users.noreply.github.com"
- name: Run opencode review
uses: anomalyco/opencode/github@latest
env:
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
# 用自定义 GitHub App 生成的 bot token跟原 opencode.yml 一致,
# 评论 PR / 提交都走 takanashi-hoshino-agent[bot] 的身份。
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
with:
model: opencode/deepseek-v4-flash-free
use_github_token: true
prompt: ${{ secrets.OPENCODE_PROMPT }}

View File

@ -48,7 +48,7 @@ module.exports = async (query, request) => {
case 'linuxapi': { case 'linuxapi': {
if (isReq) { if (isReq) {
const pureHex = data.replace(/\s/g, '') const pureHex = data.replace(/\s/g, '')
const decrypted = aesDecrypt(pureHex, 'ecb', linuxapiKey, '', 'hex') const decrypted = aesDecrypt(pureHex, linuxapiKey, '', 'hex')
result = JSON.parse(decrypted.toString(CryptoJS.enc.Utf8)) result = JSON.parse(decrypted.toString(CryptoJS.enc.Utf8))
} else { } else {
result = typeof data === 'string' ? JSON.parse(data) : data result = typeof data === 'string' ? JSON.parse(data) : data

View File

@ -255,13 +255,9 @@
} }
logs.write(`[index] 查询完成。结果数量=${resp.data.result.length}`) logs.write(`[index] 查询完成。结果数量=${resp.data.result.length}`)
for (var song of resp.data.result) { for (var song of resp.data.result) {
var a = document.createElement('a'); logs.write(
a.href = 'https://music.163.com/song?id=' + encodeURIComponent(song.song.id); `[result] <a target="_blank" href="https://music.163.com/song?id=${song.song.id}">${song.song.name} - ${song.song.album.name} (${song.startTime / 1000}s)</a>`
a.target = '_blank'; )
a.textContent = song.song.name + ' - ' + song.song.album.name + ' (' + (song.startTime / 1000) + 's)';
logs.appendChild(document.createTextNode('[result] '));
logs.appendChild(a);
logs.appendChild(document.createElement('br'));
} }
}) })
}) })

View File

@ -34,12 +34,12 @@ const aesEncrypt = (text, mode, key, iv, format = 'base64') => {
return encrypted.ciphertext.toString().toUpperCase() return encrypted.ciphertext.toString().toUpperCase()
} }
const aesDecrypt = (ciphertext, mode, key, iv, format = 'base64') => { const aesDecrypt = (ciphertext, key, iv, format = 'base64') => {
let bytes let bytes
if (format === 'base64') { if (format === 'base64') {
bytes = CryptoJS.AES.decrypt(ciphertext, CryptoJS.enc.Utf8.parse(key), { bytes = CryptoJS.AES.decrypt(ciphertext, CryptoJS.enc.Utf8.parse(key), {
iv: CryptoJS.enc.Utf8.parse(iv), iv: CryptoJS.enc.Utf8.parse(iv),
mode: CryptoJS.mode[mode.toUpperCase()], mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7, padding: CryptoJS.pad.Pkcs7,
}) })
} else { } else {
@ -48,7 +48,7 @@ const aesDecrypt = (ciphertext, mode, key, iv, format = 'base64') => {
CryptoJS.enc.Utf8.parse(key), CryptoJS.enc.Utf8.parse(key),
{ {
iv: CryptoJS.enc.Utf8.parse(iv), iv: CryptoJS.enc.Utf8.parse(iv),
mode: CryptoJS.mode[mode.toUpperCase()], mode: CryptoJS.mode.ECB,
padding: CryptoJS.pad.Pkcs7, padding: CryptoJS.pad.Pkcs7,
}, },
) )
@ -97,7 +97,7 @@ const eapi = (url, object) => {
const eapiResDecrypt = (encryptedParams, aeapi = false) => { const eapiResDecrypt = (encryptedParams, aeapi = false) => {
// 使用aesDecrypt解密参数 // 使用aesDecrypt解密参数
try { try {
const decrypted = aesDecrypt(encryptedParams, 'ecb', eapiKey, '', 'hex') // WordArray const decrypted = aesDecrypt(encryptedParams, eapiKey, '', 'hex') // WordArray
if (aeapi) { if (aeapi) {
// 带压缩的解密:先转 Base64 再解压 // 带压缩的解密:先转 Base64 再解压
@ -120,7 +120,6 @@ const eapiReqDecrypt = (encryptedParams) => {
// 使用 aesDecrypt 解密参数 // 使用 aesDecrypt 解密参数
const decryptedData = aesDecrypt( const decryptedData = aesDecrypt(
encryptedParams, encryptedParams,
'ecb',
eapiKey, eapiKey,
'', '',
'hex', 'hex',