Commit 806395c
Fix external-review issues: dedup OFF_MARKERS, paginate Bilibili, validate creators, version cap, retire bidao pilot, add tests + CI
Robustness / bugs:
- shared_markers.py: single source for OFF_MARKERS (FULL for features, COMPARE for
compare_form -- the deliberate livestream / 联名 divergence preserved, behavior
unchanged), ending the silent drift between the two copies.
- fetch_bilibili.py: paginate up to num (was first-page-only -> missed data past 50);
add BilibiliError mirroring YouTubeError; factor out _to_record / _get_page.
- creators.py: validate_creators() lists ALL config problems (typo'd keys, missing
alias/zone, duplicate alias, youtube missing channel) instead of a KeyError at
fetch time; called at the start of fetch_multi.
- Cap bilibili-api-python <18.0.0 (requirements.txt + pyproject.toml).
- schema.py: VideoRecord TypedDict documenting the standard video record.
Cleanup -- retire the single-creator pilot cluster (bidao-hardcoded, mutually coupled
via classified.json, superseded by the generalized features/scan_signals pipeline,
and absent from every pipeline / README command list):
- delete classify_and_stats.py, fetch_videos.py, and the orphaned consumers comments.py
+ subtitle.py (they read the now-gone classified.json); drop all four from the
PyInstaller spec hiddenimports; add shared_markers + schema.
- anonymize remaining bidao / real-BV references in analyze_video.py + diagnose.py
docstrings; reword the README L2-text line to the surviving compare_meme.py.
Tests + CI (the project had zero tests):
- conftest.py + tests/ (23 tests): features.extract, off_tag, OFF_MARKERS divergence,
validate_creators, spearman, build_report formatters, runtime paths, and
fetch_bilibili parse/record/error + pagination (incl. the >50-video multi-page path).
- pyproject dev extra + pytest config; CI now runs pytest.
Deliberately skipped (with reasons): scripts/ -> subpackage restructure (would break
the released PyInstaller packaging), web CSRF/rate-limit (localhost-only app), scipy
for spearman (intentional zero-dep). Two report claims were verified already-fine and
left alone: scan_signals already degrades on missing data; requirements/pyproject are
already aligned.
Verified: 23 tests pass, compileall clean, viralens --help ok, frozen build succeeds
and --vl-exec compare_form / fetch_multi / build_report all work (new modules bundled,
BilibiliError surfaces correctly).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 3c4cf43 commit 806395c
22 files changed
Lines changed: 401 additions & 618 deletions
File tree
- .github/workflows
- packaging
- scripts
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
This file was deleted.
This file was deleted.
0 commit comments