Skip to content

Commit

Permalink
Deploy fleet
Browse files Browse the repository at this point in the history
  • Loading branch information
FYLSen committed Apr 20, 2024
1 parent 62dbbc1 commit 9f3446e
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build
on:
push:
branches:
- master
schedule:
- cron: '0 12 * * *'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: oven-sh/setup-bun@v1
with:
bun-version: canary
- name: Get current date
id: date
run: |
echo "date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
echo "year=$(date +'%Y')" >> $GITHUB_OUTPUT
echo "month=$(date +'%m')" >> $GITHUB_OUTPUT
echo "day=$(date +'%d')" >> $GITHUB_OUTPUT
echo "hour=$(date +'%H')" >> $GITHUB_OUTPUT
echo "minute=$(date +'%M')" >> $GITHUB_OUTPUT
echo "second=$(date +'%S')" >> $GITHUB_OUTPUT
- name: Cache cache.db
uses: actions/cache@v4
with:
save-always: true
path: |
.cache
key: ${{ runner.os }}-v1-${{ steps.date.outputs.year }}-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }} ${{ steps.date.outputs.hour }}:${{ steps.date.outputs.minute }}:${{ steps.date.outputs.second }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-v1-${{ steps.date.outputs.year }}-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }} ${{ steps.date.outputs.hour }}:${{ steps.date.outputs.minute }}:
${{ runner.os }}-v1-${{ steps.date.outputs.year }}-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }} ${{ steps.date.outputs.hour }}:
${{ runner.os }}-v1-${{ steps.date.outputs.year }}-${{ steps.date.outputs.month }}-${{ steps.date.outputs.day }}
${{ runner.os }}-v1-${{ steps.date.outputs.year }}-${{ steps.date.outputs.month }}-
${{ runner.os }}-v1-${{ steps.date.outputs.year }}-
${{ runner.os }}-v1-
- run: bun install
- run: bun run build
- name: Pre-deploy check
# If the public directory doesn't exist, the build should fail.
# If the public directory is empty, the build should fail.
run: |
if [ ! -d public ]; then
echo "public directory not found"
exit 1
fi
if [ ! "$(ls -A public)" ]; then
echo "public directory is empty"
exit 1
fi
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GIT_TOKEN }}
user_name: ${{ secrets.GIT_USER }}
user_email: ${{ secrets.GIT_EMAIL }}
#external_repository: SukkaLab/ruleset.skk.moe
publish_branch: gh-pages
publish_dir: public
cname: ${{ secrets.CNAME }}
1 change: 1 addition & 0 deletions Mock/blank.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
1 change: 1 addition & 0 deletions Mock/reject-200
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions Mock/reject-array
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
1 change: 1 addition & 0 deletions Mock/reject-dict
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Binary file added Mock/reject-img
Binary file not shown.
Binary file added Mock/reject-video
Binary file not shown.
28 changes: 28 additions & 0 deletions Modules/YouTube.Enhance.sgmodule
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!name=Youtube (Music) Enhance
#!desc=适用于 Youtube & Youtube Music
#!arguments=屏蔽上传按钮:true,屏蔽选段按钮:true,字幕翻译语言:zh-Hans,歌词翻译语言:zh-Hans,脚本执行引擎:jsc,启用调试模式:false
#!arguments-desc=- 屏蔽参数:[true, false] \n- 翻译参数:[语言代码, off] \n- 脚本引擎:[auto, jsc, webview]\n\n1. 语言代码遵循 Google Translate Languages Codes, 当填入 off 时关闭翻译\n2. 推荐使用 jsc 引擎,但你仍可以切换成 webview 体验 Surge 新特性\n3. 开启调试模式用于输出更多日志
#!category=🫥 Fleeting

# > Note
# Youtube 画中画和后台播放分别在客户端内关闭
# - 设置 -> 通用 -> 画中画
# - 设置 -> 后台播放和下载 -> 后台播放


[URL Rewrite]
(^https?:\/\/[\w-]+\.googlevideo\.com\/(?!dclk_video_ads).+?)&ctier=L(&.+?),ctier,(.+) url 302

[Rule]
AND,((DOMAIN-SUFFIX,googlevideo.com), (PROTOCOL,UDP)),REJECT
AND,((DOMAIN,youtubei.googleapis.com), (PROTOCOL,UDP)),REJECT

[Script]
youtube.request = type=http-request,pattern=^https:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|reel\/reel_watch_sequence),requires-body=1,max-size=-1,binary-body-mode=1,engine={{{脚本执行引擎}}},script-path=https://fleet.fylsen.com/Script/youtube.request.preview.js
youtube.response = type=http-response,pattern=^https:\/\/youtubei\.googleapis\.com\/youtubei\/v1\/(browse|next|player|search|reel\/reel_watch_sequence|guide|account\/get_setting),requires-body=1,max-size=-1,binary-body-mode=1,engine={{{脚本执行引擎}}},script-path=https://fleet.fylsen.com/Script/youtube.response.preview.js,argument="{"lyricLang":"{{{歌词翻译语言}}}","captionLang":"{{{字幕翻译语言}}}","blockUpload":{{{屏蔽上传按钮}}},"immersive":{{{屏蔽选段按钮}}},"debug":{{{启用调试模式}}}}"

[Map Local]
^https?:\/\/[\w-]+\.googlevideo\.com\/initplayback.+&oad data="https://fleet.fylsen.com/Mock/reject-200"

[MITM]
hostname = %APPEND% *.googlevideo.com, youtubei.googleapis.com
3 changes: 3 additions & 0 deletions Script/youtube.request.preview.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Script/youtube.response.preview.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions Source/domainset/ip_attribution.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# WeChat
szshort.weixin.qq.com
szextshort.weixin.qq.com
szminorshort.weixin.qq.com
mp.weixin.qq.com
4 changes: 4 additions & 0 deletions Source/non_ip/ai_ platform.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Bing
DOMAIN-SUFFIX,bing.com
# Coze
DOMAIN-SUFFIX,coze.com

0 comments on commit 9f3446e

Please sign in to comment.