bilinote-cli 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. bilinote_cli-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +49 -0
  2. bilinote_cli-0.1.0/.github/ISSUE_TEMPLATE//346/226/260/345/242/236/345/212/237/350/203/275/345/273/272/350/256/256.md +29 -0
  3. bilinote_cli-0.1.0/.github/workflows/docker-build.yml +73 -0
  4. bilinote_cli-0.1.0/.github/workflows/main.yml +160 -0
  5. bilinote_cli-0.1.0/.gitignore +123 -0
  6. bilinote_cli-0.1.0/BiliNote.shortcut +0 -0
  7. bilinote_cli-0.1.0/CLAUDE.md +72 -0
  8. bilinote_cli-0.1.0/LICENSE +21 -0
  9. bilinote_cli-0.1.0/PKG-INFO +205 -0
  10. bilinote_cli-0.1.0/README.en.md +181 -0
  11. bilinote_cli-0.1.0/README.md +184 -0
  12. bilinote_cli-0.1.0/TODO.md +42 -0
  13. bilinote_cli-0.1.0/dev-docs//345/216/206/345/217/262/350/256/260/345/275/225/345/222/214/351/207/215/350/257/225/346/234/215/345/212/241/350/256/276/350/256/241.md +388 -0
  14. bilinote_cli-0.1.0/dev-docs//345/217/221/345/270/203/345/210/260 githubTODO.md" +37 -0
  15. bilinote_cli-0.1.0/dev-docs//345/221/275/345/220/215/346/226/271/345/274/217.md +230 -0
  16. bilinote_cli-0.1.0/publish.sh +4 -0
  17. bilinote_cli-0.1.0/pyproject.toml +42 -0
  18. bilinote_cli-0.1.0/skills/357/274/210/346/226/275/345/267/245/344/270/255 unfinished/357/274/211/bilinote/SKILL.md" +190 -0
  19. bilinote_cli-0.1.0/skills/357/274/210/346/226/275/345/267/245/344/270/255 unfinished/357/274/211/bilinote/evals/evals.json" +35 -0
  20. bilinote_cli-0.1.0/skills/357/274/210/346/226/275/345/267/245/344/270/255 unfinished/357/274/211/bilinote/memory.md +0 -0
  21. bilinote_cli-0.1.0/src/__init__.py +0 -0
  22. bilinote_cli-0.1.0/src/app/config_manager.py +287 -0
  23. bilinote_cli-0.1.0/src/app/core/__init__.py +0 -0
  24. bilinote_cli-0.1.0/src/app/decorators/__init__.py +0 -0
  25. bilinote_cli-0.1.0/src/app/decorators/timeit.py +16 -0
  26. bilinote_cli-0.1.0/src/app/downloaders/__init__.py +0 -0
  27. bilinote_cli-0.1.0/src/app/downloaders/base.py +52 -0
  28. bilinote_cli-0.1.0/src/app/downloaders/bilibili_downloader.py +365 -0
  29. bilinote_cli-0.1.0/src/app/downloaders/common.py +1 -0
  30. bilinote_cli-0.1.0/src/app/downloaders/douyin_downloader.py +294 -0
  31. bilinote_cli-0.1.0/src/app/downloaders/douyin_helper/abogus.py +635 -0
  32. bilinote_cli-0.1.0/src/app/downloaders/kuaishou_downloader.py +93 -0
  33. bilinote_cli-0.1.0/src/app/downloaders/kuaishou_helper/__init__.py +0 -0
  34. bilinote_cli-0.1.0/src/app/downloaders/kuaishou_helper/kuaishou.py +96 -0
  35. bilinote_cli-0.1.0/src/app/downloaders/local_downloader.py +137 -0
  36. bilinote_cli-0.1.0/src/app/downloaders/xiaoyuzhoufm_download.py +25 -0
  37. bilinote_cli-0.1.0/src/app/downloaders/youtube_downloader.py +121 -0
  38. bilinote_cli-0.1.0/src/app/downloaders/youtube_subtitle.py +98 -0
  39. bilinote_cli-0.1.0/src/app/enmus/exception.py +21 -0
  40. bilinote_cli-0.1.0/src/app/enmus/note_enums.py +7 -0
  41. bilinote_cli-0.1.0/src/app/enmus/task_status_enums.py +28 -0
  42. bilinote_cli-0.1.0/src/app/exceptions/__init__.py +0 -0
  43. bilinote_cli-0.1.0/src/app/exceptions/biz_exception.py +6 -0
  44. bilinote_cli-0.1.0/src/app/exceptions/note.py +9 -0
  45. bilinote_cli-0.1.0/src/app/exceptions/provider.py +12 -0
  46. bilinote_cli-0.1.0/src/app/gpt/__init__.py +0 -0
  47. bilinote_cli-0.1.0/src/app/gpt/base.py +17 -0
  48. bilinote_cli-0.1.0/src/app/gpt/gpt_factory.py +13 -0
  49. bilinote_cli-0.1.0/src/app/gpt/prompt.py +77 -0
  50. bilinote_cli-0.1.0/src/app/gpt/prompt_builder.py +114 -0
  51. bilinote_cli-0.1.0/src/app/gpt/provider/OpenAI_compatible_provider.py +31 -0
  52. bilinote_cli-0.1.0/src/app/gpt/request_chunker.py +161 -0
  53. bilinote_cli-0.1.0/src/app/gpt/universal_gpt.py +348 -0
  54. bilinote_cli-0.1.0/src/app/gpt/utils.py +4 -0
  55. bilinote_cli-0.1.0/src/app/models/__init__.py +0 -0
  56. bilinote_cli-0.1.0/src/app/models/audio_model.py +15 -0
  57. bilinote_cli-0.1.0/src/app/models/gpt_model.py +19 -0
  58. bilinote_cli-0.1.0/src/app/models/model_config.py +16 -0
  59. bilinote_cli-0.1.0/src/app/models/notes_model.py +12 -0
  60. bilinote_cli-0.1.0/src/app/models/pipeline_model.py +27 -0
  61. bilinote_cli-0.1.0/src/app/models/provide_model.py +16 -0
  62. bilinote_cli-0.1.0/src/app/models/transcriber_model.py +16 -0
  63. bilinote_cli-0.1.0/src/app/models/video_record.py +0 -0
  64. bilinote_cli-0.1.0/src/app/secret_manager.py +116 -0
  65. bilinote_cli-0.1.0/src/app/services/__init__.py +0 -0
  66. bilinote_cli-0.1.0/src/app/services/batch_processor.py +343 -0
  67. bilinote_cli-0.1.0/src/app/services/cache/__init__.py +0 -0
  68. bilinote_cli-0.1.0/src/app/services/cache/task_cache.py +122 -0
  69. bilinote_cli-0.1.0/src/app/services/constant.py +17 -0
  70. bilinote_cli-0.1.0/src/app/services/note.py +141 -0
  71. bilinote_cli-0.1.0/src/app/services/pipeline/__init__.py +0 -0
  72. bilinote_cli-0.1.0/src/app/services/pipeline/ai_processor.py +98 -0
  73. bilinote_cli-0.1.0/src/app/services/pipeline/preparer.py +264 -0
  74. bilinote_cli-0.1.0/src/app/services/postprocessing.py +54 -0
  75. bilinote_cli-0.1.0/src/app/services/searcher.py +113 -0
  76. bilinote_cli-0.1.0/src/app/services/serial_executor.py +17 -0
  77. bilinote_cli-0.1.0/src/app/transcriber/__init__.py +0 -0
  78. bilinote_cli-0.1.0/src/app/transcriber/base.py +14 -0
  79. bilinote_cli-0.1.0/src/app/transcriber/bcut.py +245 -0
  80. bilinote_cli-0.1.0/src/app/transcriber/groq.py +76 -0
  81. bilinote_cli-0.1.0/src/app/transcriber/kuaishou.py +109 -0
  82. bilinote_cli-0.1.0/src/app/transcriber/transcriber_provider.py +134 -0
  83. bilinote_cli-0.1.0/src/app/transcriber/whisper_cpp.py +120 -0
  84. bilinote_cli-0.1.0/src/app/utils/cookie_helper.py +18 -0
  85. bilinote_cli-0.1.0/src/app/utils/env_checker.py +0 -0
  86. bilinote_cli-0.1.0/src/app/utils/file_cleanup.py +36 -0
  87. bilinote_cli-0.1.0/src/app/utils/logger.py +37 -0
  88. bilinote_cli-0.1.0/src/app/utils/note_helper.py +66 -0
  89. bilinote_cli-0.1.0/src/app/utils/path_helper.py +150 -0
  90. bilinote_cli-0.1.0/src/app/utils/screenshot_marker.py +13 -0
  91. bilinote_cli-0.1.0/src/app/utils/status_code.py +12 -0
  92. bilinote_cli-0.1.0/src/app/utils/url_parser.py +81 -0
  93. bilinote_cli-0.1.0/src/app/utils/video_helper.py +70 -0
  94. bilinote_cli-0.1.0/src/app/utils/video_reader.py +188 -0
  95. bilinote_cli-0.1.0/src/app/validators/__init__.py +0 -0
  96. bilinote_cli-0.1.0/src/app/validators/video_url_validator.py +38 -0
  97. bilinote_cli-0.1.0/src/cli.py +613 -0
  98. bilinote_cli-0.1.0/src/config/__init__.py +0 -0
  99. bilinote_cli-0.1.0/src/config/config.yaml.example +37 -0
  100. bilinote_cli-0.1.0/src/config/dev_config.json +6 -0
  101. bilinote_cli-0.1.0/src/config/model_config_manager.py +218 -0
  102. bilinote_cli-0.1.0/src/config/models.json +84 -0
  103. bilinote_cli-0.1.0/src/config/transcriber.json +29 -0
  104. bilinote_cli-0.1.0/src/ffmpeg_helper.py +49 -0
  105. bilinote_cli-0.1.0/tests/__init__.py +0 -0
  106. bilinote_cli-0.1.0/tests/conftest.py +7 -0
  107. bilinote_cli-0.1.0/tests/integration/test_transcriber_integration.py +54 -0
  108. bilinote_cli-0.1.0/tests/unit/downloaders/test_bilibili_downloader.py +195 -0
  109. bilinote_cli-0.1.0/tests/unit/downloaders/test_cookie_helper.py +47 -0
  110. bilinote_cli-0.1.0/tests/unit/downloaders/test_douyin_downloader.py +94 -0
  111. bilinote_cli-0.1.0/tests/unit/downloaders/test_kuaishou_downloader.py +136 -0
  112. bilinote_cli-0.1.0/tests/unit/gpt/test_request_chunker.py +88 -0
  113. bilinote_cli-0.1.0/tests/unit/gpt/test_universal_gpt_checkpoint.py +57 -0
  114. bilinote_cli-0.1.0/tests/unit/services/test_searcher.py +263 -0
  115. bilinote_cli-0.1.0/tests/unit/services/test_task_serial_executor.py +32 -0
  116. bilinote_cli-0.1.0/tests/unit/transcriber/test_transcriber_fallback.py +213 -0
  117. bilinote_cli-0.1.0/tests/unit/utils/test_note_helper.py +26 -0
  118. bilinote_cli-0.1.0/tests/unit/utils/test_path_helper.py +172 -0
  119. bilinote_cli-0.1.0/tests/unit/utils/test_screenshot_marker.py +25 -0
  120. bilinote_cli-0.1.0/tests/unit/utils/test_url_parser.py +99 -0
  121. bilinote_cli-0.1.0/tests/unit/utils/test_video_helper.py +136 -0
  122. bilinote_cli-0.1.0/tests/unit/utils/test_video_reader_dedupe.py +55 -0
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: Bug report
3
+ about: 上报一些bug
4
+ title: "[BUG]"
5
+ labels: bug
6
+ assignees: JefferyHcool
7
+
8
+ ---
9
+
10
+ ---
11
+ name: 🐛 Bug 反馈
12
+ about: 提交一个 Bug 报告,帮助我们改进
13
+ title: "[Bug] "
14
+ labels: bug
15
+ assignees: ''
16
+ ---
17
+
18
+ **版本说明**
19
+
20
+ 请说明的你的版本号
21
+
22
+ **部署方式**
23
+
24
+ 使用的是什么方式部署(代码环境部署,docker部署,桌面端,在线预览)
25
+
26
+ **描述问题**
27
+ 清晰、简明地描述你遇到的问题是什么。
28
+
29
+ **复现步骤**
30
+ 复现该问题的步骤:
31
+
32
+ 1. 进入页面 '...'
33
+ 2. 点击 '...'
34
+ 3. 滚动到 '...'
35
+ 4. 出现错误
36
+
37
+ **预期行为**
38
+ 清晰、简明地描述你本来预期发生的行为。
39
+
40
+ **截图**
41
+ 如果适用,请添加截图以帮助说明问题。
42
+
43
+ **桌面端(请补充以下信息)**
44
+
45
+ - 操作系统:例如 Windows / macOS / Ubuntu
46
+ - 浏览器:例如 Chrome、Safari
47
+
48
+ **其他补充信息**
49
+ 请补充任何其他相关信息。
@@ -0,0 +1,29 @@
1
+ ---
2
+ name: 新增功能建议
3
+ about: 一些新的功能建议
4
+ title: "[FEATHURE]"
5
+ labels: enhancement
6
+ assignees: JefferyHcool
7
+
8
+ ---
9
+
10
+ ---
11
+ name: ✨ 功能请求
12
+ about: 提出一个新的功能建议
13
+ title: "[Feature] "
14
+ labels: enhancement
15
+ assignees: ''
16
+
17
+ ---
18
+
19
+ **这个功能请求是否与某个问题相关?请描述**
20
+ 清晰简要地描述问题是什么。例如:每次遇到 [...] 都让我感到很沮丧。
21
+
22
+ **描述你希望实现的解决方案**
23
+ 清晰简要地描述你希望发生的事情。
24
+
25
+ **描述你考虑过的备选方案**
26
+ 清晰简要地描述你考虑过的其他解决方案或功能。
27
+
28
+ **其他补充信息**
29
+ 请在此添加关于功能请求的其他上下文或截图。
@@ -0,0 +1,73 @@
1
+ name: Build and Publish Docker Image
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+
9
+ env:
10
+ REGISTRY: ghcr.io
11
+ IMAGE_NAME: ${{ github.repository }}
12
+
13
+ jobs:
14
+ build-and-push:
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ contents: read
18
+ packages: write
19
+
20
+ steps:
21
+ - name: Checkout Code
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Set up Docker Buildx
25
+ uses: docker/setup-buildx-action@v3
26
+
27
+ - name: Log in to GitHub Container Registry
28
+ uses: docker/login-action@v3
29
+ with:
30
+ registry: ${{ env.REGISTRY }}
31
+ username: ${{ github.actor }}
32
+ password: ${{ secrets.GITHUB_TOKEN }}
33
+
34
+ - name: Extract metadata (tags, labels)
35
+ id: meta
36
+ uses: docker/metadata-action@v5
37
+ with:
38
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39
+ tags: |
40
+ type=semver,pattern={{version}}
41
+ type=semver,pattern={{major}}.{{minor}}
42
+ type=sha,prefix=
43
+ type=raw,value=latest,enable={{is_default_branch}}
44
+
45
+ - name: Build and Push Docker Image
46
+ uses: docker/build-push-action@v6
47
+ with:
48
+ context: .
49
+ file: Dockerfile.complete
50
+ push: true
51
+ tags: ${{ steps.meta.outputs.tags }}
52
+ labels: ${{ steps.meta.outputs.labels }}
53
+ cache-from: type=gha
54
+ cache-to: type=gha,mode=max
55
+ platforms: linux/amd64,linux/arm64
56
+
57
+ - name: Generate Usage Instructions
58
+ run: |
59
+ echo "=========================================="
60
+ echo "Docker Image Published!"
61
+ echo "=========================================="
62
+ echo ""
63
+ echo "Pull the image:"
64
+ echo " docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
65
+ echo ""
66
+ echo "Run the container:"
67
+ echo " docker run -d -p 80:80 \\"
68
+ echo " -v bilinote-data:/app/backend/data \\"
69
+ echo " --name bilinote \\"
70
+ echo " ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
71
+ echo ""
72
+ echo "Access the application at: http://localhost"
73
+ echo "=========================================="
@@ -0,0 +1,160 @@
1
+ name: Build & Release Desktop App
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build:
11
+ strategy:
12
+ matrix:
13
+ include:
14
+ - platform: macos-latest
15
+ target: universal-apple-darwin
16
+ - platform: ubuntu-22.04
17
+ target: x86_64-unknown-linux-gnu
18
+ - platform: windows-latest
19
+ target: x86_64-pc-windows-msvc
20
+
21
+ runs-on: ${{ matrix.platform }}
22
+
23
+ steps:
24
+ - name: Checkout Code
25
+ uses: actions/checkout@v4
26
+
27
+ # Linux 系统依赖(Tauri 需要)
28
+ - name: Install Linux Dependencies
29
+ if: matrix.platform == 'ubuntu-22.04'
30
+ run: |
31
+ sudo apt-get update
32
+ sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
33
+
34
+ # 设置 Python 环境(带 pip 缓存)
35
+ - name: Set up Python
36
+ uses: actions/setup-python@v5
37
+ with:
38
+ python-version: '3.11'
39
+ cache: 'pip'
40
+ cache-dependency-path: backend/requirements.txt
41
+
42
+ # 安装 Python 依赖并执行构建
43
+ - name: Install Python dependencies & Build backend
44
+ shell: bash
45
+ run: |
46
+ python -m pip install --upgrade pip
47
+ pip install -r backend/requirements.txt
48
+
49
+ if [ "$RUNNER_OS" = "Windows" ]; then
50
+ backend\\build.bat
51
+ else
52
+ chmod +x backend/build.sh
53
+ ./backend/build.sh
54
+ fi
55
+
56
+ # 设置 pnpm
57
+ - name: Setup pnpm
58
+ uses: pnpm/action-setup@v4
59
+ with:
60
+ version: 'latest'
61
+
62
+ # 设置 Node 环境
63
+ - name: Set up Node.js
64
+ uses: actions/setup-node@v4
65
+ with:
66
+ node-version: '20'
67
+
68
+ - name: Install frontend dependencies
69
+ working-directory: BillNote_frontend
70
+ run: pnpm install
71
+
72
+ # 设置 Rust 环境
73
+ - name: Set up Rust
74
+ uses: dtolnay/rust-toolchain@stable
75
+
76
+ # Cargo 缓存
77
+ - name: Cache Cargo
78
+ uses: actions/cache@v4
79
+ with:
80
+ path: |
81
+ ~/.cargo/bin/
82
+ ~/.cargo/registry/index/
83
+ ~/.cargo/registry/cache/
84
+ ~/.cargo/git/db/
85
+ BillNote_frontend/src-tauri/target/
86
+ key: ${{ runner.os }}-cargo-${{ hashFiles('BillNote_frontend/src-tauri/Cargo.lock') }}
87
+ restore-keys: ${{ runner.os }}-cargo-
88
+
89
+ # 打包 Tauri 应用
90
+ - name: Build Tauri App
91
+ working-directory: BillNote_frontend
92
+ run: pnpm tauri build
93
+
94
+ # 收集产物到统一目录
95
+ - name: Collect release artifacts
96
+ shell: bash
97
+ run: |
98
+ mkdir -p release-artifacts
99
+ BUNDLE_DIR="BillNote_frontend/src-tauri/target/release/bundle"
100
+
101
+ # macOS: .dmg
102
+ find "$BUNDLE_DIR" -name "*.dmg" -exec cp {} release-artifacts/ \; 2>/dev/null || true
103
+ # Windows: .msi, .exe (NSIS)
104
+ find "$BUNDLE_DIR" -name "*.msi" -exec cp {} release-artifacts/ \; 2>/dev/null || true
105
+ find "$BUNDLE_DIR/nsis" -name "*.exe" -exec cp {} release-artifacts/ \; 2>/dev/null || true
106
+ # Linux: .deb, .AppImage
107
+ find "$BUNDLE_DIR" -name "*.deb" -exec cp {} release-artifacts/ \; 2>/dev/null || true
108
+ find "$BUNDLE_DIR" -name "*.AppImage" -exec cp {} release-artifacts/ \; 2>/dev/null || true
109
+
110
+ echo "=== Collected artifacts ==="
111
+ ls -lh release-artifacts/
112
+
113
+ # 生成 SHA256 校验和
114
+ - name: Generate checksums
115
+ shell: bash
116
+ run: |
117
+ cd release-artifacts
118
+ sha256sum * > SHA256SUMS.txt 2>/dev/null || shasum -a 256 * > SHA256SUMS.txt
119
+ cat SHA256SUMS.txt
120
+
121
+ # 上传产物(供 release job 使用)
122
+ - name: Upload artifacts
123
+ uses: actions/upload-artifact@v4
124
+ with:
125
+ name: artifacts-${{ matrix.platform }}
126
+ path: release-artifacts/
127
+
128
+ # 创建 GitHub Release 并上传所有产物
129
+ release:
130
+ needs: build
131
+ runs-on: ubuntu-latest
132
+ if: startsWith(github.ref, 'refs/tags/v')
133
+ permissions:
134
+ contents: write
135
+
136
+ steps:
137
+ - name: Checkout Code
138
+ uses: actions/checkout@v4
139
+
140
+ # 下载所有平台的构建产物
141
+ - name: Download all artifacts
142
+ uses: actions/download-artifact@v4
143
+ with:
144
+ path: all-artifacts
145
+ merge-multiple: true
146
+
147
+ - name: List all artifacts
148
+ run: |
149
+ echo "=== All release artifacts ==="
150
+ ls -lhR all-artifacts/
151
+
152
+ # 创建 Release 并上传产物
153
+ - name: Create GitHub Release
154
+ uses: softprops/action-gh-release@v2
155
+ with:
156
+ name: BiliNote ${{ github.ref_name }}
157
+ draft: false
158
+ prerelease: false
159
+ generate_release_notes: true
160
+ files: all-artifacts/*
@@ -0,0 +1,123 @@
1
+ # macOS
2
+ .DS_Store
3
+
4
+ # Python
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+ *.so
9
+ .Python
10
+ build/
11
+ develop-eggs/
12
+ dist/
13
+ downloads/
14
+ eggs/
15
+ .eggs/
16
+ lib64/
17
+ parts/
18
+ sdist/
19
+ var/
20
+ wheels/
21
+ share/python-wheels/
22
+ *.egg-info/
23
+ .installed.cfg
24
+ *.egg
25
+ MANIFEST
26
+
27
+ # PyInstaller
28
+ *.manifest
29
+ *.spec
30
+
31
+ # Installer logs
32
+ pip-log.txt
33
+ pip-delete-this-directory.txt
34
+
35
+ # Unit test / coverage reports
36
+ htmlcov/
37
+ .tox/
38
+ .nox/
39
+ .coverage
40
+ .coverage.*
41
+ .cache
42
+ nosetests.xml
43
+ coverage.xml
44
+ *.cover
45
+ *.py,cover
46
+ .hypothesis/
47
+ .pytest_cache/
48
+ cover/
49
+
50
+ # Jupyter Notebook
51
+ .ipynb_checkpoints
52
+
53
+ # IPython
54
+ profile_default/
55
+ ipython_config.py
56
+
57
+ # pyenv
58
+ .python-version
59
+
60
+ # UV
61
+ uv.lock
62
+
63
+ # pipenv
64
+ Pipfile.lock
65
+
66
+ # poetry
67
+ poetry.lock
68
+
69
+ # pdm
70
+ .pdm.toml
71
+ .pdm-python
72
+ .pdm-build/
73
+
74
+ # PEP 582
75
+ __pypackages__/
76
+
77
+ # Environments
78
+ .env
79
+ .venv
80
+ env/
81
+ venv/
82
+ ENV/
83
+ env.bak/
84
+ venv.bak/
85
+
86
+ # mkdocs documentation
87
+ /site
88
+
89
+ # mypy
90
+ .mypy_cache/
91
+ .dmypy.json
92
+ dmypy.json
93
+
94
+ # Pyre type checker
95
+ .pyre/
96
+
97
+ # pytype static type analyzer
98
+ .pytype/
99
+
100
+ # Cython debug symbols
101
+ cython_debug/
102
+
103
+ # IDE
104
+ .idea/
105
+ .vscode/
106
+ .qoder/
107
+
108
+ # Ruff
109
+ .ruff_cache/
110
+
111
+ # PyPI configuration file
112
+ .pypirc
113
+
114
+ # Project specific
115
+ playground.ipynb
116
+ logs/
117
+ *.log
118
+ /data/*
119
+ !/data/resources/
120
+
121
+ # FFmpeg 构建文件
122
+ ffmpeg*/
123
+ ffmpg*/
Binary file
@@ -0,0 +1,72 @@
1
+ # CLAUDE.md
2
+
3
+ Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
4
+
5
+ **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
6
+
7
+ ## 1. Think Before Coding
8
+
9
+ **Don't assume. Don't hide confusion. Surface tradeoffs.**
10
+
11
+ Before implementing:
12
+ - State your assumptions explicitly. If uncertain, ask.
13
+ - If multiple interpretations exist, present them - don't pick silently.
14
+ - If a simpler approach exists, say so. Push back when warranted.
15
+ - If something is unclear, stop. Name what's confusing. Ask.
16
+
17
+ ## 2. Simplicity First
18
+
19
+ **Minimum code that solves the problem. Nothing speculative.**
20
+
21
+ - No features beyond what was asked.
22
+ - No abstractions for single-use code.
23
+ - No "flexibility" or "configurability" that wasn't requested.
24
+ - No error handling for impossible scenarios.
25
+ - If you write 200 lines and it could be 50, rewrite it.
26
+
27
+ Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
28
+
29
+ ## 3. Surgical Changes
30
+
31
+ **Touch only what you must. Clean up only your own mess.**
32
+
33
+ When editing existing code:
34
+ - Don't "improve" adjacent code, comments, or formatting.
35
+ - Don't refactor things that aren't broken.
36
+ - Match existing style, even if you'd do it differently.
37
+ - If you notice unrelated dead code, mention it - don't delete it.
38
+
39
+ When your changes create orphans:
40
+ - Remove imports/variables/functions that YOUR changes made unused.
41
+ - Don't remove pre-existing dead code unless asked.
42
+
43
+ The test: Every changed line should trace directly to the user's request.
44
+
45
+ ## 4. Goal-Driven Execution
46
+
47
+ **Define success criteria. Loop until verified.**
48
+
49
+ Transform tasks into verifiable goals:
50
+ - "Add validation" → "Write tests for invalid inputs, then make them pass"
51
+ - "Fix the bug" → "Write a test that reproduces it, then make it pass"
52
+ - "Refactor X" → "Ensure tests pass before and after"
53
+
54
+ For multi-step tasks, state a brief plan:
55
+ ```
56
+ 1. [Step] → verify: [check]
57
+ 2. [Step] → verify: [check]
58
+ 3. [Step] → verify: [check]
59
+ ```
60
+
61
+ Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
62
+
63
+ ---
64
+
65
+ **These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.
66
+
67
+ ## 5. Project-associated Notes
68
+
69
+ ### 运行临时 Python 代码
70
+ ```bash
71
+ uv run python -c "print('import yt_dlp;Hello from uv')"
72
+ ```
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Jeffery Huang
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.