Skip to content

Feature/GitHub action#7

Merged
YewFence merged 7 commits intomainfrom
feature/github-action
Dec 23, 2025
Merged

Feature/GitHub action#7
YewFence merged 7 commits intomainfrom
feature/github-action

Conversation

@YewFence
Copy link
Copy Markdown
Owner

@YewFence YewFence commented Dec 23, 2025

#5 Action启动!
CodeRabbit救一下

Summary by CodeRabbit

  • New Features

    • Added a sample environment configuration (.env) for customizable runtime options.
    • Automated multi-platform executable builds with packaged release artifacts for Windows and macOS.
  • Documentation

    • Streamlined Quick Start and usage docs with simplified setup and interactive login guidance.
    • Updated cookie export workflow and cookie file naming/location instructions.
  • Chores

    • Removed legacy configuration example; added dotenv-based configuration support and updated project dependencies.
    • Updated ignore rules for environment files.

✏️ Tip: You can customize this high-level summary in your review settings.

YewFence and others added 5 commits December 24, 2025 00:38
- 将 BROWSER、HEADLESS、VIDEO_LIST_URL 移至 .env 文件
- 添加 python-dotenv 依赖
- 删除 config_example.py,新增 .env.example
- 更新 .gitignore:忽略 .env,取消忽略 config.py

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 推送 v* tag 时自动构建并创建 Release
- 支持手动触发,可指定任意版本构建
- 使用 PyInstaller 打包成单文件可执行程序

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 向 main 分支开 PR 时自动构建
- 构建产物保留 7 天,方便下载测试

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- 快速开始改为下载 Release + 配置 .env
- 开发者使用方式移至后面
- 精简 FAQ 和项目结构说明
- 更新 Cookie 获取文档

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @YewFence, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求通过引入 .env 文件来管理敏感配置,并全面修订了 README.md 文档,以提供更清晰的用户和开发者指南,从而优化了项目的配置管理。这些更改旨在提高安全性、简化最终用户的设置过程,并为开发者提供更明确的指引。

Highlights

  • 配置管理优化: 将敏感配置从 config.py 迁移到 .env 文件,增强了安全性并简化了配置流程。
  • README 文档重构: 大幅更新了 README.md,为最终用户提供了更简洁的快速启动指南(侧重于可执行文件),并为开发者提供了清晰的源码运行说明。
  • 引入 python-dotenv: 添加了 python-dotenv 依赖,用于方便地从 .env 文件加载环境变量。
Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/build.yml
    • .github/workflows/pr-build.yml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Dec 23, 2025

Caution

Review failed

The pull request is closed.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds environment-based configuration via python-dotenv and a runtime-validated config.py, removes the old config_example.py, updates docs and cookie filename, and introduces two GitHub Actions workflows to build and release Windows/macOS executables.

Changes

Cohort / File(s) Summary
Configuration & env
.env.example, config.py, config_example.py (deleted), .gitignore, pyproject.toml
Introduces .env-based configuration and config.py that loads and validates BROWSER/HEADLESS/VIDEO_LIST_URL; removes config_example.py; updates .gitignore to ignore .env; adds python-dotenv>=1.2.1 dependency.
CI / Releases
.github/workflows/build.yml, .github/workflows/pr-build.yml
Adds workflows: pr-build.yml runs on PRs to build platform artifacts (Windows/macOS) with PyInstaller and uploads artifacts (7-day retention); build.yml builds artifacts and creates GitHub Release on tag events. Both use Python 3.13 and uv tooling.
Documentation & cookie workflow
README.md, docs/how_to_get_cookie.md
Reworks README into a Quick Start and developer flow; updates cookie instructions and sample file name to browser_cookies.json, and adjusts quickstart/export steps and references to release assets.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant PR as Pull Request
participant GH as GitHub Actions
participant Runner as Build Runner (win/mac)
participant UV as uv (tooling)
participant PyInstaller as PyInstaller
participant Artifacts as Artifact Storage
participant Release as GitHub Release

PR->>GH: push PR (pr-build.yml)
GH->>Runner: start matrix job (windows/mac)
Runner->>UV: uv sync / uv add pyinstaller
Runner->>PyInstaller: build single-file executable
PyInstaller-->>Runner: artifact (exe / macos)
Runner->>Artifacts: upload artifact (7d retention)
Note right of GH #DDEEFF: On tag -> build.yml triggers full build
GH->>Artifacts: download artifacts (on tag)
GH->>Release: create Release and attach artifacts

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Feature/GitHub action' is vague and overly broad—it doesn't clearly convey the main purpose of the changeset, which involves environment configuration management, GitHub Actions workflows, and documentation updates. Consider a more descriptive title that captures the primary change, such as 'Add GitHub Actions workflows and environment configuration management' or 'Introduce CI/CD pipelines and .env-based configuration'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 832d2bd and 39cce90.

📒 Files selected for processing (1)
  • README.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

这个 PR 做得很棒,通过引入 .env 文件来管理敏感配置,极大地提升了项目的安全性和可配置性。同时,对 README.md 的重构让文档对普通用户和开发者都更加友好,特别是“快速开始”部分,非常清晰。

我发现了一些可以改进的小地方,主要集中在 config.py 的配置校验和 README.md 中的链接健壮性。这些修改将使项目更加稳健和易用。

README.md Outdated
# 2. 克隆项目
git clone <your-repo-url>
cd school_vedio_hw
前往 [Releases](../../releases) 页面,下载对应系统的可执行文件:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

README.md 中指向 Releases 页面的相对链接 ../../releases 在某些情况下(例如,在本地克隆仓库后查看,或在某些IDE中)可能会失效。为了确保链接的健壮性,建议使用完整的绝对URL。

Suggested change
前往 [Releases](../../releases) 页面,下载对应系统的可执行文件:
前往 [Releases](https://github.com/YewFence/fly_vedio_assignment_away/releases) 页面,下载对应系统的可执行文件:

README.md Outdated
---

需要帮助?遇到BUG?请提出issue 🚀
需要帮助?遇到BUG?请提出 [Issue](../../issues) 🚀
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Releases 链接类似,指向 Issue 页面的相对链接 ../../issues 也存在同样的问题,在某些场景下可能无法正确跳转。建议修改为绝对URL,以提供更好的用户体验。

Suggested change
需要帮助?遇到BUG?请提出 [Issue](../../issues) 🚀
需要帮助?遇到BUG?请提出 [Issue](https://github.com/YewFence/fly_vedio_assignment_away/issues) 🚀

YewFence and others added 2 commits December 24, 2025 01:12
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@YewFence YewFence merged commit 55acdb3 into main Dec 23, 2025
2 checks passed
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/how_to_get_cookie.md (1)

18-20: Critical: Cookie filename mismatch with config.py.

The documentation instructs users to create browser_cookies.json, but config.py line 21 sets COOKIE_FILE = "cookies.json". This inconsistency will cause cookie loading to fail.

🔎 Proposed fix

Either update config.py to match the documentation:

-COOKIE_FILE = "cookies.json"  # Cookie文件路径
+COOKIE_FILE = "browser_cookies.json"  # Cookie文件路径

Or update the documentation throughout to reference cookies.json instead of browser_cookies.json.

♻️ Duplicate comments (4)
docs/how_to_get_cookie.md (1)

187-205: Critical: Cookie filename mismatch with config.py.

Multiple references to browser_cookies.json in this section are inconsistent with COOKIE_FILE = "cookies.json" in config.py line 21. Users following these instructions will create a file the application won't find.

README.md (2)

25-27: Use absolute URLs for better link reliability.

The relative link ../../releases may break when viewing the README in certain contexts (local clones, IDEs, etc.).


141-141: Use absolute URLs for better link reliability.

The relative link ../../issues may break when viewing the README in certain contexts (local clones, IDEs, etc.).

.github/workflows/build.yml (1)

43-46: Avoid modifying project files during CI builds.

Using uv add pyinstaller modifies project files during CI execution, creating inconsistency. This is the same issue present in pr-build.yml.

Refer to the solution proposed for .github/workflows/pr-build.yml lines 32-35.

🧹 Nitpick comments (1)
config.py (1)

3-3: Consider fixing fullwidth punctuation for consistency.

Static analysis detected fullwidth punctuation marks in comments. While this doesn't affect functionality, using ASCII punctuation provides better consistency with the codebase.

🔎 Proposed fix
 """
 配置文件
-敏感配置从 .env 文件读取,其他配置在此文件中设置
+敏感配置从 .env 文件读取,其他配置在此文件中设置
 """
 
 # ...
 
-# URL模式匹配(脚本会自动找到所有包含此模式的链接)
+# URL模式匹配(脚本会自动找到所有包含此模式的链接)
 URL_PATTERN = "https://moodle.scnu.edu.cn/mod/fsresource/view.php?id="

Also applies to: 24-24

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 34f0301 and 832d2bd.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • .env.example
  • .github/workflows/build.yml
  • .github/workflows/pr-build.yml
  • .gitignore
  • README.md
  • config.py
  • config_example.py
  • docs/how_to_get_cookie.md
  • pyproject.toml
💤 Files with no reviewable changes (1)
  • config_example.py
🧰 Additional context used
🪛 Ruff (0.14.10)
config.py

3-3: Docstring contains ambiguous (FULLWIDTH COMMA). Did you mean , (COMMA)?

(RUF002)


16-16: Avoid specifying long messages outside the exception class

(TRY003)


24-24: Comment contains ambiguous (FULLWIDTH LEFT PARENTHESIS). Did you mean ( (LEFT PARENTHESIS)?

(RUF003)


24-24: Comment contains ambiguous (FULLWIDTH RIGHT PARENTHESIS). Did you mean ) (RIGHT PARENTHESIS)?

(RUF003)

🔇 Additional comments (4)
.gitignore (1)

12-13: LGTM!

The updated ignore pattern correctly protects the .env file containing sensitive configuration from being committed.

.env.example (1)

1-8: LGTM!

The environment configuration template is clear and well-documented with Chinese comments appropriate for the target audience.

pyproject.toml (1)

8-8: LGTM!

The python-dotenv dependency is correctly added to support environment-based configuration in config.py.

config.py (1)

15-16: LGTM!

The VIDEO_LIST_URL validation properly implements fail-fast behavior, clearly informing users when the required configuration is missing.

Comment on lines +32 to +35
- name: Install dependencies
run: |
uv sync
uv add pyinstaller
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Avoid modifying project files during CI builds.

Using uv add pyinstaller modifies pyproject.toml and lock files during CI execution, which creates inconsistency between CI and local development environments. These modifications are not committed, leading to non-reproducible builds.

🔎 Recommended solutions

Solution 1 (Recommended): Add PyInstaller as a development dependency in pyproject.toml:

[project.optional-dependencies]
dev = ["pyinstaller>=6.0.0"]

Then update the workflow:

       - name: Install dependencies
         run: |
-          uv sync
-          uv add pyinstaller
+          uv sync --extra dev

Solution 2: Use uv pip install to avoid modifying project files:

       - name: Install dependencies
         run: |
           uv sync
-          uv add pyinstaller
+          uv pip install pyinstaller
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Install dependencies
run: |
uv sync
uv add pyinstaller
- name: Install dependencies
run: |
uv sync
uv pip install pyinstaller
🤖 Prompt for AI Agents
.github/workflows/pr-build.yml around lines 32-35: the workflow is running `uv
add pyinstaller` which mutates pyproject.toml and lockfiles during CI; instead
add PyInstaller as a development dependency in pyproject.toml (e.g., under
project.optional-dependencies.dev) and update the workflow step to install
dependencies without modifying project files (e.g., run uv sync/install or use
uv pip install to install without changing manifests); alternatively, if you
prefer not to edit pyproject.toml, replace the `uv add` call with a non-mutating
installer invocation such as `uv pip install pyinstaller` so CI does not alter
repository files.


# ============= 其他配置 =============
# Cookie登录配置
COOKIE_FILE = "cookies.json" # Cookie文件路径
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Cookie filename mismatch with documentation.

COOKIE_FILE is set to "cookies.json", but all documentation (README.md, docs/how_to_get_cookie.md) instructs users to create browser_cookies.json. This mismatch will cause cookie loading to fail.

🔎 Proposed fix

Update to match the documentation:

-COOKIE_FILE = "cookies.json"  # Cookie文件路径
+COOKIE_FILE = "browser_cookies.json"  # Cookie文件路径
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
COOKIE_FILE = "cookies.json" # Cookie文件路径
COOKIE_FILE = "browser_cookies.json" # Cookie文件路径
🤖 Prompt for AI Agents
In config.py around line 21, COOKIE_FILE is set to "cookies.json" which
mismatches documentation that expects "browser_cookies.json"; change the
constant value to "browser_cookies.json" so the runtime cookie loader matches
README/docs/how_to_get_cookie.md and update any related tests or references if
present.

### 第二步:创建配置文件

#### 方法二:使用 pip
在可执行文件同目录下参考 [env.example](./.env.example) 创建 `.env` 文件:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix the reference to match the actual filename.

The link text shows env.example but should be .env.example to match the actual filename.

🔎 Proposed fix
-在可执行文件同目录下参考 [env.example](./.env.example) 创建 `.env` 文件:
+在可执行文件同目录下参考 [.env.example](./.env.example) 创建 `.env` 文件:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
在可执行文件同目录下参考 [env.example](./.env.example) 创建 `.env` 文件:
在可执行文件同目录下参考 [.env.example](./.env.example) 创建 `.env` 文件:
🤖 Prompt for AI Agents
In README.md around line 31, the link text currently reads "env.example" but the
actual filename is ".env.example"; update the link text to ".env.example" so the
reference matches the real file name (i.e., change the displayed text portion of
the markdown link to ".env.example" while keeping the path ./ .env.example
intact).

@YewFence YewFence deleted the feature/github-action branch March 15, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant