115Master Documentation
repository·main·Indexed 21 days ago
https://github.com/cbingb666/115masterA userscript designed to enhance the 115 cloud storage web interface. Key features include an advanced video player (XPlayer) with ultra quality, online subtitles, and IINA integration; file list improvements such as video covers and path displays; and one-click magnet link integration for offline tasks. The repository also contains a monorepo with technical details on the XPlayer's HUD component, keyboard shortcut management via the useShortcuts hook, and AVPlayer core control through the useAvPlayerCore hook.
What's inside 115Master
- This directory is dedicated to backing up 115 resources. The primary purpose is to prevent loss of access or traceability caused by 115 resources being deleted or modified.
Overview of 115Master features
main115Master provides several enhancements to the 115 web interface, categorized into Player, File List, and Magnet support:
Player Enhancements
- Ultra Quality: High-definition playback.
- Video Thumbnails: Visual previews.
- Online Subtitles: Support for web-based subtitles.
- IINA Playback: Integration with IINA player.
- Picture-in-Picture: Support for PiP mode.
- Playlist: Manage multiple videos.
- Custom Hotkeys: User-definable keyboard shortcuts.
- Color Adjustment: Video color correction tools.
File List Enhancements
- Video Covers: Visual thumbnails in the list.
- Path Display: Shows the full title/path of the file.
- Navigation: 'Back to directory' button.
- Scroll Memory: Remembers scroll position.
- Offline Task Redirection: Redirects without refreshing for offline tasks.
- File Download: Supports single file downloads.
- Folder Interaction: Middle-click a folder to open in a new tab.
Magnet Support
- Supports one-click triggering of offline tasks from any website's Magnet links.
Understand the 115 VOD cross-origin authorization flow
mainThe official 115 VOD authorization relies on a multi-step redirect chain to obtain a cross-origin cookie. If you are implementing custom playback, you must replicate this sequence:
- Initial Request: Navigate to the VOD URL (e.g.,
https://115vod.com/?pickcode={pickcode}&share_id={share_id}). - Passport Redirect: The request is redirected to the
hnpassportapi.115.comauthentication endpoint with agotoparameter pointing to the115vod.com/bridgeendpoint. - Bridge Redirect: The passport service redirects to
https://115vod.com/bridge?goto=...&auth_token=.... - Cookie Acquisition: This bridge request returns the necessary
cookie. - Final Redirect: The user is redirected back to the original VOD URL, now authorized with the acquired cookie.
1. https://115vod.com/?pickcode=eu03yk1a3yp1dzzdt&share_id=0 2. Redirect to: https://hnpassportapi.115.com/app/1.0/web/1.0/login/authToken?goto=...&time=...&digest=... 3. Redirect to: https://115vod.com/bridge?goto=...&auth_token=xxx 4. Result: Cookie is set 5. Final Redirect: https://115vod.com/?pickcode=eu03yk1a3yp1dzzdt&share_id=0- Initial Request: Navigate to the VOD URL (e.g.,
Install 115Master
main115Master is a userscript designed to enhance the 115 resource backup experience. Follow these steps to install:
- Browser Requirements: Use
Chrome 130+or115Browser 35+. - Script Manager: Install Tampermonkey v5.3.3+ or ScriptCat.
- Developer Mode: Enable Browser Extension Developer Mode.
- Install Script: Download and install the 115Master user script.
https://github.com/cbingb666/115master/releases/latest/download/115master.user.js- Browser Requirements: Use
Understand Stream objects and selection
mainWhen a media file is loaded, the player exposes a list of available
streams. EachStreamobject contains metadata and codec parameters used to identify the media type and capabilities.Stream Properties:
mediaType: 'Audio' or 'Video'.codecparProxy: Contains codec parameters likewidth,height, andcodecId.id: Unique identifier for the stream.duration: Total duration (int64).metadata: Additional stream metadata.
Stream Selection:
audioStreams: A computed array of all audio streams.videoStreams: A computed array of all video streams.currentVideoStream: The currently active video stream.setAudioStream(id): Method to switch the active audio track by its stream ID.
// Accessing streams via the hook const { streams, audioStreams, videoStreams, setAudioStream } = useAvPlayerCore(ctx); // Switch to a specific audio track if (audioStreams.value.length > 0) { await setAudioStream(audioStreams.value[0].id); }Understand KeyBinding formats
mainKeyboard shortcuts are represented using two primary formats:
KeyBindingStr: A single string representing the combination, e.g.,'Shift+A'or'A'.KeyBindingArr: An array of strings representing the keys, e.g.,['Shift', 'A']or['A'].
KeyBindingsis an array ofKeyBindingStr, allowing a single action to be mapped to multiple string-based shortcuts.Understand the VideoCover data structure
mainThe hook returns a
VideoCover[]array in itsstateproperty. There are two main types used internally:VideoCoverRaw: The raw data containing theBlobobject.VideoCover: The processed data ready for UI rendering, where theBlobis converted into astringURL viaURL.createObjectURL.
VideoCoverProperties:width:number- The width of the generated image.height:number- The height of the generated image.frameTime:number- The actual timestamp (in seconds) of the frame captured.seekTime:number- The time (in seconds) at which the video was seeked to capture the frame.img:string- Theblob:URL used in<img>tags.
Configure ESLint using @115master/eslint-config
mainTo apply the standard linting rules for this project, use the
baseConfigexported from@115master/eslint-configin youreslint.config.jsfile. This provides a pre-configured ESLint flat configuration designed for the monorepo's environment.import { baseConfig } from '@115master/eslint-config' export default baseConfigManage FileListMod lifecycle
mainWhen using
FileListMod, you must manage its lifecycle to prevent memory leaks and orphaned observers.- Initialization: Instantiating the class via
new FileListMod()triggers theinit()process, which starts theMutationObserverand sets up scroll history. - Cleanup: You must call the
.destroy()method when the component or page is unmounted. This method disconnects theMutationObserver, destroys all activeFileItemModLoaderinstances, and cleans up theFileListScrollHistory.
- Initialization: Instantiating the class via
Use @115master/eslint-config in ESLint configurations
mainTo apply the standard linting rules used across the 115master monorepo, import
baseConfigfrom@115master/eslint-configand export it as the default configuration in youreslint.config.jsfile.import { baseConfig } from '@115master/eslint-config' export default baseConfigUse @115master/eslint-config in your project
mainTo apply the standard linting rules used across the 115master monorepo, import and export
baseConfigfrom@115master/eslint-configin youreslint.config.jsfile. This allows your project to inherit the shared ESLint configuration.import { baseConfig } from '@115master/eslint-config' export default baseConfigTroubleshoot VOD domain cross-origin authorization failure in master player
mainIf you experience failures when attempting to play VOD (Video on Demand) content in the
masterplayer, but the content plays successfully in the official115player, it is likely due to a missing cross-origin authorization token.Root Cause
The official
115player automatically handles the re-authorization of cross-origin tokens via a specific redirect chain that sets a required cookie. Themasterplayer currently lacks this automatic re-authorization logic.Reproduction Steps
- Log out of your account.
- Log back in.
- Attempt to play via the
masterplayer (will fail). - Attempt to play via the
115player (will succeed).
Solution
To fix this, the
masterplayer's playback page must be updated to intercept and execute the cross-origin authorization request flow used by the official player.