Commit Graph
932 Commits
Author SHA1 Message Date
ForgQi 55370dd87a Add dynamic log level reload support to server
Introduces tracing_subscriber::reload to enable dynamic log level changes at runtime. Updates the main server initialization and ServiceRegister to accept and store a log handle. Refactors related code to support this feature and removes disabled state from developer UI log level selectors.
2025-11-27 03:41:09 +08:00
ForgQi 3698bcf28a Add struct-patch support and improve config handling
Introduces the struct-patch crate for partial config updates and applies it to configuration models. Refactors config access patterns, adds PartialEq to several types, and updates LiveStreamer to use ConfigPatch for override_cfg. Also updates the CI workflow to use macos-15-intel, improves download task cancellation logic, and upgrades @douyinfe/semi-ui and related dependencies in the frontend.
2025-11-20 03:26:40 +08:00
ForgQi 4fdd0f81c1 Add Bilibili anonymous origin option and improve hook step execution
Introduces a new 'bili_anonymous_origin' option to the config for Bilibili original quality without login. Refactors hook step command execution to use platform-specific shells, capture and log stdout/stderr in real time, and improves process handling. Also updates workspace version to 1.1.23 and makes minor code cleanups.
2025-11-19 02:28:49 +08:00
ForgQi 7763a4cf3a Refactor download workflow and add is_only_self support
Refactored the download workflow to improve danmaku client handling, status transitions, and resource cleanup. Enhanced logging for better traceability. Added support for the 'is_only_self' field in upload streamer models and the Studio struct, ensuring correct type usage and propagation through the upload pipeline. Updated pythonize dependency to version 0.27.0 and improved queue management logic in the monitor.
2025-11-18 03:28:04 +08:00
ForgQi 5de3dcaa6d Refactor monitor and download manager for improved cleanup
Refactored the monitor system by merging RoomsHandle into Monitor, centralizing plugin and worker management, and improving monitor task spawning. Updated DownloadManager to use the new Monitor structure, added a cleanup method for graceful shutdown, and ensured worker statuses are reset on exit. Adjusted related modules and API endpoints to accommodate these changes, and improved code clarity and error handling throughout.
2025-11-17 03:18:01 +08:00
ForgQi 2810ac9a88 Refactor and clean up unused imports and code paths
Removed unused imports, simplified code by eliminating unnecessary variables and clones, and applied Rust idioms such as let-else and .cloned(). Added Default implementations for certain structs. These changes improve code clarity, maintainability, and reduce potential for confusion or errors.
2025-11-17 01:07:00 +08:00
ForgQi 064111669e Refactor download manager and downloader architecture
Refactored the download manager to unify plugin and worker management, replacing ActorHandle with DownloadManager. Updated API endpoints and download logic to use the new DownloadManager interface. Introduced DownloaderRuntime enum to abstract over different downloader implementations. Added initial ytdlp.rs for YouTube downloads. Refactored StreamGears and Streamlink to fit the new architecture, and updated worker and status handling throughout the codebase.
2025-11-17 01:05:30 +08:00
ForgQi 58e7d3c80f Add Streamlink downloader and refactor Twitch plugin
Introduces a new Streamlink downloader implementation supporting multiple platforms and output modes. Refactors the Twitch plugin to use async traits and separates TwitchDownloader logic. Cleans up endpoint logging and updates workspace version to 1.1.22.
2025-11-05 01:44:31 +08:00
ForgQi 673a1e7eb8 Refactor plugin system and update dependencies
Refactored the plugin system, including changes to plugin loading and Twitch plugin implementation. Updated dependencies in Cargo.lock to their latest versions, improving compatibility and security. Adjusted downloader and download logic to align with the new plugin structure.
2025-11-04 00:56:51 +08:00
ForgQi 99b00d3bc3 Add Twitch plugin and refactor ffmpeg downloader
Introduces a new Twitch plugin module for stream handling, including GraphQL queries and stream URL extraction. Refactors ffmpeg_downloader to extract process logging and waiting logic into a reusable async function. Updates dependencies to use workspace versions for rand and serde_urlencoded, and bumps version numbers to 1.1.21.
2025-11-03 00:58:43 +08:00
ForgQi d1cb0047a5 Refactor segment event processing and downloader callbacks
Refactored SegmentEventProcessor to manage its channel internally and removed unnecessary cloning. Updated downloader traits and implementations to use FnMut callbacks with explicit lifetimes, improving flexibility and correctness. Adjusted file and segment types in the downloader module to be generic over lifetimes, ensuring proper resource management. These changes improve event handling, callback usage, and lifetime safety across the download pipeline.
2025-10-31 02:47:32 +08:00
ForgQi 6051dc8fe9 Refactor downloader architecture and config handling
Refactored the downloader system to pass DownloadConfig explicitly to all downloaders, removing internal state from FfmpegDownloader and StreamGears. Simplified DownloadPlugin::create_downloader to only require the downloader type, and updated DownloadTask to manage cancellation and retries more robustly. Adjusted related code to support the new DownloadConfig flow, improved resource cleanup, and updated trait signatures and usages throughout the codebase.
2025-10-30 02:10:17 +08:00
ForgQi b497749744 Update download task execution and improve docs
Refactored the DownloadTask::execute method to return DownloadStatus and adjusted its visibility. Enhanced DActor message handling to update stream info after download execution. Updated README and introduction guide with improved instructions for background running and systemd service configuration.
2025-10-27 02:05:23 +08:00
ForgQi f5f2998d16 Add streamer file info API and improve file listing
Introduces a new API endpoint `/v1/streamer-info/files/{id}` to fetch file lists for a specific streamer, and updates the frontend to fetch file lists dynamically per row. Also updates serialization for streamer date fields, improves comments and error handling, and changes the default downloader type for plugins. Minor documentation and code cleanup included.
2025-10-27 01:28:08 +08:00
ForgQi 2ede5cda33 Refactor YY plugin to Rust and update downloader logic
Migrates the YY plugin from Python to Rust, implementing it under crates/biliup-cli/src/server/core/plugin/yy.rs and registering it in the service register. Removes the old Python plugin. Refactors downloader instantiation logic into DownloadPlugin, and updates header construction utility. Updates CLI and README to clarify the --auth option. Cleans up duplicate code in stream-gears and synchronizes workspace version numbers.
2025-10-26 17:01:45 +08:00
ForgQi ff3fd2ef15 Refactor tracing and type casting in stream-gears
Removed unused tracing initialization and related code from stream-gears. Replaced deprecated `downcast` calls with `cast` for PyO3 types. Cleaned up imports and minor code improvements in biliup-cli and stream-gears modules.
2025-10-25 00:10:00 +08:00
ForgQi 3ad7c6ac0f Move tracing initialization to server entry point
Refactored tracing initialization from lib.rs to server.rs, ensuring logging setup occurs only when the server starts. Updated README and docker-compose.yml to reflect new server startup command and options for authentication.
2025-10-24 23:07:43 +08:00
ForgQi 9e155493f0 Refactor imports and formatting across modules
This commit cleans up and reorders imports for consistency, improves formatting (especially for multi-line expressions and function signatures), and fixes minor style issues in several files. It also updates the server command to pass the 'auth' parameter and makes minor logic clarifications in the stream-gears Python entrypoint.
2025-10-24 03:21:44 +08:00
ForgQi b829731ad9 Refactor CLI, update dependencies, and improve server logic
Refactored CLI argument parsing and main entrypoint in both Python and Rust, updated pyo3 and pythonize dependencies, and improved modularization in biliup-cli. Added an 'auth' flag to the server command, fixed several import and ownership issues, and improved plugin and server initialization logic. Also cleaned up unused imports and streamlined code for better maintainability.
2025-10-24 03:11:27 +08:00
ForgQi a0b6800c0a Refactor async worker status and improve file move logic
Refactored worker status management to use async RwLock and updated all related methods to be async. Improved file move logic in hook steps to support cross-filesystem moves by falling back to copy+delete when necessary. Updated API endpoints, download/upload logic, and monitor state transitions to be fully async and more robust. Also added a Debug implementation for Credentials to avoid logging sensitive data, and made minor UI tweaks to disable certain developer options.
2025-10-22 02:13:37 +08:00
ForgQi 2fcdb0fe7b Move associated XML file with video in HookStep
When moving a video file, also check for an associated XML file (e.g., subtitles or metadata) and move it to the target directory if it exists. This ensures related files are kept together during the move operation.
2025-10-01 01:52:04 +08:00
ForgQi af82185618 Refactor recorder usage and context handling
Refactored the handling of the Recorder struct to include recording start time and improved filename templating. The Context struct now holds a Recorder instance, and its initialization was updated throughout the codebase. Adjusted upload and download logic to use the new Recorder, and improved logging in hook steps. Bumped version to 1.1.15.
2025-10-01 01:45:55 +08:00
ForgQi ea17305b0a Refactor actor system and add upload status tracking
Refactored download and upload actor implementations into separate modules for better maintainability. Added upload_status field to LiveStreamerEntity and API responses, and updated the frontend to display upload status. Also added Huya protocol config option and improved Huya stream header handling in stream-gears. Minor bug fixes and code cleanups included.
2025-10-01 00:26:07 +08:00
ForgQi e2da70b9ea Update config.rs
Bump workspace version to 1.1.13

Updated the workspace and related package versions from 1.1.12 to 1.1.13 in Cargo.toml and Cargo.lock for release and dependency consistency.
2025-09-30 01:52:54 +08:00
ForgQi 247f231640 Refactor log tabs and improve download/upload handling
Merged download and upload logs into a single tab in the log viewer and commented out the separate upload log tab. Removed unused and legacy methods from the Python upload and download engine classes. Improved logging and error handling in Rust server modules, including more informative log messages and better context propagation. Updated plugin interface to pass context instead of just URL, and enhanced dictionary filtering in config state. Bumped workspace version to 1.1.12.
2025-09-30 01:44:46 +08:00
ForgQi 3e76841206 Update README.md 2025-09-30 00:07:39 +08:00
ForgQi bd1ccdd0ff Refactor upload pipeline and improve code consistency
Refactored upload pipeline to use stream inspection for file item insertion, improving modularity and resource handling. Cleaned up imports, improved formatting, and removed redundant logging and code. Minor fixes in module ordering and code style for better maintainability.
2025-09-29 04:19:22 +08:00
ForgQi 92b5a30df5 Add streamer pause/resume feature and UI updates
Introduces a pause/resume button for streamers in the UI and backend, including API endpoint and status handling. Refactors streamer status display, updates related TypeScript interfaces, and improves modal forms. Also updates @douyinfe/semi-ui and related dependencies to v2.86.0, and bumps workspace version to 1.1.10. Minor logging and trait changes in Rust backend for improved clarity and error handling.
2025-09-29 03:18:21 +08:00
ForgQi d4b6a5fb22 Refactor models and context for streamer separation
Split LiveStreamer and UploadStreamer models into separate modules and update references throughout the codebase. Refactor StreamInfo to StreamInfoExt, embedding StreamerInfo for improved database integration. Update context, plugin, monitor, and related logic to support new model structure and database operations. Bump version to 1.1.9.
2025-09-27 16:42:53 +08:00
ForgQi e41acef883 Refactor upload logic and add WebSocket log endpoint
Refactored upload logic to decouple upload and submission, moving UploadLine and related logic to biliup-cli crate root. Added a new WebSocket log endpoint in a dedicated ws.rs module and routed it accordingly. Updated database migration to set certain fields to null instead of empty strings. Adjusted context and download/upload manager logic to pass StreamInfo and Context as needed. Added static file serving route and improved filename generation for uploads. Bumped version to 1.1.8 and enabled 'fs' feature for tower-http.
2025-09-27 01:13:18 +08:00
tdh62 9c2c892c39 Fix null/"null" values in JSON fields for livestreamers tables (#1485) 2025-09-26 08:35:12 +00:00
ForgQi 0320890823 Add WebSocket log streaming and status endpoint
Introduces a WebSocket endpoint for real-time log streaming and a new /v1/status API for server status. Refactors log file handling, updates dependencies (adds ws feature to axum), and improves file validation logic. Also updates workspace and crate versions to 1.1.7, and makes minor improvements to log rotation and struct derivations.
2025-09-26 04:11:13 +08:00
ForgQi e7e795dd72 Replace typed-builder with bon and update builder usage
Replaced the 'typed-builder' crate with 'bon' across the project, updating all builder pattern usages to match the new derive macros and method names. Adjusted struct derives and builder method calls in uploader and upload logic to use 'bon::Builder' and the new 'maybe_' method conventions. Updated dependencies in Cargo.toml files accordingly and removed 'typed-builder' from the workspace.
2025-09-26 02:13:31 +08:00
ForgQi 69caca628c Refactor segment event handling and add download task module
Introduces a new `download` module to encapsulate download task logic, including segment event processing and file validation. Refactors segment event handling to use a new `SegmentInfo` struct and updates related interfaces and modules for improved clarity and maintainability. Adjusts uploader and downloader logic to work with the new event structure, and enhances FFmpeg and stream gears downloaders to emit and process segment events accordingly.
2025-09-26 01:42:03 +08:00
ForgQi 2a8c1d0bd6 Refactor uploader logic and improve worker status handling
Moved upload and post-processing logic to a new common/upload.rs module and refactored UActor to use it. WorkerStatus now tracks the active downloader instance, with improved serialization and debug output. StreamGears downloader now supports cancellation via tokio-util's CancellationToken. API endpoints and service registration updated to match new worker and uploader logic. Various doc comments and error handling improved throughout the codebase.
2025-09-24 01:26:11 +08:00
ForgQi 267bda7360 Add and improve Rust doc comments across server modules
Added and expanded Rust documentation comments (///) for structs, enums, traits, functions, and methods throughout the core and infrastructure modules. These comments clarify the purpose, parameters, and return values of types and functions, improving code readability and maintainability for developers. No functional or logic changes were made.
2025-09-23 05:14:28 +08:00
ForgQi fc159cd598 Add and improve Chinese doc comments across server modules
Added and enhanced Chinese documentation comments throughout the server codebase, including API endpoints, configuration structures, context, error handling, infrastructure, and router modules. These comments clarify the purpose and usage of structs, enums, functions, and modules, improving code readability and maintainability for Chinese-speaking developers. No functional logic was changed.
2025-09-23 04:44:46 +08:00
ForgQi aea8fb56a8 Refactor server context and downloader integration
Refactored the server context to use a unified Context struct with extension support, updated Worker to encapsulate streamer, config, and client, and adjusted all usages accordingly. Moved util.rs to common/util.rs and updated imports. Enhanced downloader and plugin interfaces to support richer context and danmaku integration. Added DanmakuClient implementation in stream-gears and improved post-processing hooks to support multiple files. Various bug fixes and improvements for error handling, file operations, and configuration defaults.
2025-09-23 04:26:20 +08:00
Heporis a19e1861f1 Update Termux-publish.yml (#1474) 2025-09-22 02:15:59 +00:00
ForgQi 84c798a8d7 Refactor and clean up unused imports and code
Removed unused imports and redundant code across multiple modules to improve code clarity and maintainability. Updated function signatures in flv_parser for lifetime correctness. Added Drop implementation for ActorHandle to ensure background tasks are aborted on drop. Simplified logic in uploader login functions and improved pattern matching in endpoints. Minor code style and comment cleanups throughout the codebase.
2025-09-21 16:50:58 +08:00
ForgQi fb4dc2b50a Refactor server code and migrate modules to biliup-cli
Moved and refactored server-related modules from stream-gears to biliup-cli, including API endpoints, configuration, core logic, and infrastructure. Replaced usage of anyhow with error-stack and custom AppError/AppResult types throughout the codebase. Updated dependencies in Cargo.toml and Cargo.lock, and adjusted code to use new error handling and module paths. Removed obsolete modules and files from stream-gears, and updated README and workspace version.
2025-09-21 16:29:33 +08:00
XuanRan_Nyan 0bdcf14a00 chore: Docker Build CI 改用 native arm64 runner (#1470)
* chore: Docker Build CI 改用 native arm64

* fix IMAGE_NAME

* Bypassing build jobs on pull requests
2025-09-21 05:11:01 +00:00
ForgQi 9128183595 Refactor downloader hooks and add post-processing support
Refactored the downloader callback mechanism to use a generic callback instead of direct channel messaging, simplifying the interface for all downloaders. Moved HookStep to its own module and implemented async post-processing hooks (run, move, remove) for video files after successful upload. Enabled login guard in the application controller and updated workspace and version metadata.
2025-09-21 01:29:50 +08:00
ForgQi 2f309ba8a0 Add PUT /v1/configuration endpoint for config updates
Introduces a new put_configuration handler to allow updating configuration via the /v1/configuration endpoint. Updates the router to support PUT requests, modifies the README to improve image rendering, and bumps the workspace version to 1.1.3.
2025-09-20 23:10:36 +08:00
XuanRan_Nyan 89c9b709c7 Fix(Docker): Run with wheel instead (#1468)
* chore: 同步 UploadLines

* revert profile

* Fix(Docker): Optimize Docker build with multi-stage architecture and wheel-based installation

- Split build into separate stages for webui, wheel building, and deployment
- Build Python wheel using Rust/maturin instead of editable install
- Update FFmpeg to version 8.0 with latest builds
- Improve build caching by copying source before conditional git clone
- Upgrade base Python image to 3.13-slim
- Streamline dependency management and cleanup processes
2025-09-20 13:45:59 +00:00
ForgQi a5faefb533 Add QR code login and user management endpoints
Introduces endpoints for QR code-based login and user management in the stream-gears server. Adds support for creating, deleting, and listing users, as well as endpoints for QR code generation and login via QR code. Refactors configuration management to use a global LazyLock, updates model serialization for streamer hooks, and improves context and service registration to support stateless clients. Also updates the frontend to handle new user and QR code flows, and adds an image resource for donation display in the README.
2025-09-20 21:43:51 +08:00
XuanRan_Nyan fe163af02d chore: 同步更新 UploadLines (#1466)
* chore: 同步 UploadLines

* revert profile
2025-09-20 07:41:34 +00:00
ForgQi 50845dc6cd Update .gitignore and refactor douyin.py imports
Added 'logs' to .gitignore to exclude log files from version control. Cleaned up and reorganized imports in douyin.py for better readability and maintainability.

Refactor and clean up imports, logic, and pattern usage

This commit removes unused imports, simplifies logic with let-else and pattern matching, and updates code style for conciseness and clarity across multiple modules. It also adds Default implementations for handler structs, improves error handling, and streamlines repository and service registration code.
2025-09-19 23:24:55 +08:00
ForgQi 4011ccde88 Improve config handling and database initialization
Removes unused data migration from PyInstaller spec. Adds automatic creation of parent directories for the SQLite database in Rust, and improves configuration retrieval by inserting a default config if missing. Updates model and repository code to support insert operations for configuration. Also cleans up unused test URLs in server startup.

Bump version to 1.1.1

Update Cargo.toml and Cargo.lock to reflect the new package version 1.1.1.
2025-09-19 22:59:11 +08:00
ForgQi 1e035df468 Refactor web build output and packaging paths
Updated Dockerfile to copy from /biliup/out instead of /biliup/biliup/web/public. Removed web public directory from PyInstaller and pyproject.toml includes. Adjusted build script in package.json to stop copying build output to web/public. These changes streamline the build and packaging process by consolidating output paths.
2025-09-19 03:34:01 +08:00