Video stream downloading system and method based on browser extension and nas integration
Patent Information
- Application Number
- CN202610976795.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-02
- Publication Date
- 2026-09-29
AI Technical Summary
[0003]这些方法存在以下问题:对于能够合法下载的视频,例如无DRM(Digital RightsManagement,数字版权管理)、无防盗链、无加密措施的视频流,因未提供直接的下载功能,用户不熟悉其他下载方式而无法下载;下载操作繁琐,例如需要用户手动识别和复制视频链接;无法获取动态生成的视频流;对直播流和m3u8格式的支持有限;没有与NAS设备的直接集成(需要用户将视频下载到终端,再传入NAS)等
本方案中,终端内搭载浏览器,插件包括前端服务和后台服务,前端服务部署在浏览器中,后台服务部署在NAS服务器中,实现NAS集成。
Smart Images

Figure CN122845849A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network video technology, and more specifically, to a video streaming download system and method based on browser extensions and NAS integration. Background Technology
[0002] With the increasing abundance of online video content, users frequently need to download videos from web pages for local storage or later viewing. Traditional video download methods mainly rely on: manually copying video links and using third-party download tools, installing dedicated download plugins for specific websites, or capturing video content using screen recording software.
[0003] These methods have the following problems: For legally downloadable videos, such as video streams without DRM (Digital Rights Management), anti-leeching, or encryption measures, the lack of a direct download function means users are unfamiliar with other download methods and cannot download them; the download process is cumbersome, requiring users to manually identify and copy video links; dynamically generated video streams cannot be obtained; support for live streams and m3u8 format is limited; and there is no direct integration with NAS devices (users need to download the video to the terminal and then transfer it to the NAS), etc. Summary of the Invention
[0004] The purpose of this application is to provide a video streaming download system and method based on browser extensions and NAS integration, which can identify rich video resources, provide users with a convenient and legal download method, and can directly store them in the NAS.
[0005] To achieve the above objectives, the embodiments of this application are implemented in the following manner: In a first aspect, embodiments of this application provide a video streaming download system based on browser extensions and NAS integration, including a terminal and a NAS server. The terminal is equipped with a browser, and the plugin includes a front-end service and a back-end service. The front-end service is deployed in the browser, and the back-end service is deployed in the NAS server. The front-end service of the plugin is loaded when the browser is launched on the terminal, and is used to identify video resources. When a video resource is identified, a floating button is generated on the terminal's display interface. When the terminal initiates a download command based on the user's operation of the floating button, a download request is generated and sent to the plugin's back-end service. The download request includes a video address, a request header, and a storage path. The plugin's back-end service is used to submit a download task request to the NAS server after receiving the download request. The NAS server is used to create a download task based on the download task request submitted by the back-end service and to report the task status to the back-end service. The plugin's back-end service is also used to send the task status to the plugin's front-end service after receiving the task status reported by the NAS server. The plugin's front-end service is also used to generate a task status prompt message on the terminal's display interface after receiving the task status, for the user to view the task status prompt.
[0006] In conjunction with the first aspect, in the first possible implementation of the first aspect, the plugin's front-end service identifies video resources by analyzing the webpage DOM structure to identify video links and video resources.
[0007] In conjunction with the first aspect, in the second possible implementation of the first aspect, the plugin's backend service identifies video resources in the following way: by monitoring all network requests through the browser's webRequest API, capturing .m3u8 requests and .mp4 requests, extracting request headers, parsing the m3u8 index file, and sending the obtained video address and header information to the plugin's frontend service.
[0008] In conjunction with the first aspect, in the third possible implementation of the first aspect, the plugin's background service is specifically used to: receive download requests sent by the plugin's front-end service, parse the task instructions, video request headers, video source address, and file save path carried in the request; for m3u8 format video stream tasks, forward all parameters to the specified interface of the NAS server via a POST request, and complete the submission of the download task request.
[0009] In conjunction with the third possible implementation of the first aspect, in the fourth possible implementation of the first aspect, the NAS server is specifically used for: receiving task requests, parsing out the start command, video request header, video source address, and save path; verifying the legality and integrity of the video address, save path, and request header; using a network request carrying the request header to access the video source address and obtain the content of the m3u8 file; parsing the m3u8 file to generate a structured video stream list; downloading all video segments according to the video stream list and merging the video segments into a complete MP4 file; writing the finally generated MP4 file to the specified save path; and returning the task status to the plugin's background service.
[0010] In conjunction with the fourth possible implementation of the first aspect, in the fifth possible implementation of the first aspect, the background service of the plugin is specifically used for: listening to the task status returned by the NAS server and parsing the task creation result; if the task creation result is a successful status, then standardizing and encapsulating the successful status into a task status; if the task creation result is a failed status, then extracting the failure reason, combining the failure status and the failure reason, and standardizing and encapsulating them into a task status; and sending the task status back to the front-end service of the plugin.
[0011] In conjunction with the fifth possible implementation of the first aspect, in the sixth possible implementation of the first aspect, the plugin's front-end service is specifically used for: parsing the task status after receiving the task status sent by the back-end service; generating corresponding task status prompt information based on the success or failure of the task status; and popping up visual task status prompt information in the browser page for the user to view the task status prompt of the download task.
[0012] Secondly, embodiments of this application provide a video stream download method based on browser extensions and NAS integration, applied to the front-end service of a plugin in a video stream download system based on browser extensions and NAS integration, as described in any one of the first aspects or possible implementations of the first aspect. The front-end service is loaded when the terminal starts a browser. The method includes: identifying video links and video resources by analyzing the webpage DOM structure, and / or receiving video addresses and header information sent by a background service, wherein the video addresses and header information are obtained by the background service through monitoring network requests; generating a floating button on the terminal's display interface when a video resource is identified; generating a download request and sending it to the plugin's background service when the terminal initiates a download command based on the user's operation on the floating button, wherein the download request includes a video address, request headers, and storage path; receiving the task status returned by the background service, and generating task status prompt information on the terminal's display interface for the user to view the task status prompt.
[0013] Thirdly, embodiments of this application provide a video stream download method based on browser extensions and NAS integration, applied to the background service of a plugin in a video stream download system based on browser extensions and NAS integration, as described in any one of the first aspects or possible implementations of the first aspect. The method includes: monitoring all network requests through the browser's webRequest API, capturing .m3u8 requests and .mp4 requests, extracting request headers, parsing the m3u8 index file, and sending the obtained video address and header information to the plugin's front-end service; after receiving a download request from the front-end service, submitting a download task request to the NAS server; and after receiving the task status feedback from the NAS server, sending the task status to the plugin's front-end service.
[0014] Fourthly, embodiments of this application provide a video stream download method based on browser extensions and NAS integration, applied to a NAS server in a video stream download system based on browser extensions and NAS integration, as described in any one of the first aspects or possible implementations of the first aspect. The method includes: receiving a download task request sent by the background service of the plugin, parsing out a start command, a video request header, a video source address, and a save path; verifying the legality and completeness of the video address, save path, and request header; accessing the video source address using a network request carrying the request header to obtain the content of an m3u8 file; parsing the m3u8 file to generate a structured video stream list; downloading all video segments according to the video stream list and merging the video segments into a complete MP4 file; writing the finally generated MP4 file to a specified save path; and returning the task status to the background service of the plugin.
[0015] Beneficial effects: In this solution, the terminal is equipped with a browser, and the plugins include front-end services and back-end services. The front-end services are deployed in the browser, and the back-end services are deployed on the NAS server to achieve NAS integration.
[0016] The plugin's front-end service is loaded when the browser is launched on the terminal. It identifies video resources (by parsing the webpage's DOM structure and monitoring network requests via a back-end service, capturing .m3u8 and .mp4 requests, extracting request headers, and parsing the m3u8 index file). Upon identifying a video resource, it generates a floating button on the terminal's display (providing users with a legitimate and convenient download function). When the terminal initiates a download command based on the user's interaction with the floating button, it generates a download request (including video address, request headers, storage path, etc.) and sends it to the plugin's back-end service. The plugin's back-end service, upon receiving a download request, submits a download task request to the NAS server. The NAS server, based on the download task request submitted by the back-end service, creates a download task and reports the task status back to the back-end service. The plugin's back-end service also sends the task status information to the plugin's front-end service upon receiving feedback from the NAS server. Furthermore, the plugin's front-end service generates a task status notification on the terminal's display for the user to view. This solution can automatically capture all downloadable video streams on web pages (not necessarily providing download functionality, but legal download is possible), eliminating the need for users to manually copy links and perform tedious download operations using third-party download tools. This solution not only identifies static video stream resources by analyzing web pages but also monitors network requests in real time to capture dynamically generated video streams (such as live streams). Compared to users using screen recording (with built-in screen recording software or third-party screen recording software) to save video streams, this solution provides complete video streams at the original resolution, with higher video quality. This solution provides an intuitive user interface on the terminal, facilitating user selection and management of video streams. This solution integrates seamlessly with NAS devices, supporting remote downloading and storage, achieving seamless integration between cloud and local storage. Furthermore, it supports multiple video formats and protocols (mp4, m3u8, etc.), including m3u8 live streams, and can capture video streams within iframes, solving the problem of traditional plugins being unable to capture video within nested frames (browser plugins support two methods: code injection within the webpage and browser background services. Code injection primarily involves static analysis, while background services can intercept all browser traffic data, not just tabs, thus capturing all iframe data and resolving the issue of traditional plugins being unable to capture video within nested frames). Additionally, this solution enables secure processing of request header information and URL verification, primarily used to reuse original browser requests, filter illegal characters, reject dangerous protocols and internal network addresses, and improve the security and anti-tampering capabilities of resource requests. This solution does not forge request headers, bypass anti-hotlinking measures, DRM, or access controls; it is a legitimate use of sniffing technology.
[0017] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is an interaction diagram of the parties in a video streaming download system based on browser extensions and NAS integration, provided as an embodiment of this application.
[0020] Figure 2 This is a flowchart illustrating the front-end services used in video streaming downloads based on browser extensions and NAS integration.
[0021] Figure 3 This is a flowchart illustrating the backend services used in video streaming downloads based on browser extensions and NAS integration.
[0022] Figure 4 A diagram illustrating the generation of floating buttons for the terminal's display interface.
[0023] Figure 5 This is a diagram illustrating the floating button displayed on the terminal's screen that allows for downloading.
[0024] Figure 6 This is a flowchart illustrating the application of a NAS server in video streaming downloads based on browser extensions and NAS integration.
[0025] Figure 7 This is a diagram illustrating how task status prompts are displayed on the terminal's screen.
[0026] Figure 8 This is an illustration showing how clicking the task status prompt will redirect you to the NAS application to view the download task. Detailed Implementation
[0027] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0028] Please see Figure 1 , Figure 1 This is an interaction diagram of the parties in a video streaming download system based on browser extensions and NAS integration, provided as an embodiment of this application.
[0029] In this embodiment, the video streaming download system based on browser extensions and NAS integration may include a terminal and a NAS server. The terminal has a built-in browser, and the plugin includes a front-end service and a back-end service. The front-end service is deployed in the browser, and the back-end service is deployed on the NAS server. The plugin's front-end service can be loaded when the browser is launched on the terminal, while the plugin's back-end service runs on the NAS server. The connection between the terminal and the NAS server is established through user account login verification, which is not the focus of this solution and will not be described in detail.
[0030] When a user launches a browser via a terminal to begin browsing the web, the front-end service of the plugin deployed in the browser is loaded and begins running. At this time, the front-end service can perform steps in the video streaming download method based on browser extensions and NAS integration, such as... Figure 2 As shown, the process applied to the front-end service in video stream download based on browser extensions and NAS integration may include steps S11, S12, S13, and S14.
[0031] While a user browses a webpage and the browser initiates a network request, the background service can execute steps in the video stream download method based on browser extensions and NAS integration, such as... Figure 3 As shown, the process for downloading video streams based on browser extensions and NAS integration and applied to the background service may include steps S21, S22, and S23.
[0032] First, when the browser initiates a network request, the background service can run step S21.
[0033] Step S21: Monitor all network requests through the browser's webRequest API, capture .m3u8 and .mp4 requests, extract the request headers, parse the m3u8 index file, and send the obtained video address and header information to the plugin's front-end service.
[0034] In this embodiment, the backend service can monitor all network requests through the browser's webRequest API, capture .m3u8 and .mp4 requests, parse the m3u8 index file, and send the obtained video address and header information to the plugin's frontend service.
[0035] The core logic code is as follows: / / Background service worker threads monitor network requests chrome.webRequest.onSendHeaders.addListener( (a) => { let path = new URL(a.url).pathname; if ( (a.url.indexOf(".m3u") > 0 || a.url.indexOf(".mp4") > 0) && a.tabId >= 0 && a.url.indexOf(portal) === -1 && a.url.indexOf("192.168.") === -1 ) { / / Extract request header information let headers: { [key: string]: string} = {}; let requestHeader: chrome.webRequest.HttpHeader[] = a.requestHeaders?? []; requestHeader.forEach((value, index) => { if (value.value) { headers[value.name] = value.value; } }); / / Parse M3U8 file if (a.url.indexOf(".m3u")) { fetch(a.url, { headers}) .then((res) => res.text()) .then((text) => { let praser = new m3u8Praser.Parser(); praser.push(text); praser.end(); console.log(praser.manifest); }); } / / Send message to content script chrome.tabs.sendMessage<action>( a.tabId, { action: findM3U8Action, type: a.url.indexOf(".m3u") > 0 ? fileType.m3u8 : fileType.other, url: a.url, headers: headers, }, { frameId: a.frameId} ); } }, { urls: []}, ["requestHeaders", "extraHeaders"] ); This allows you to monitor all network requests via the browser's webRequest API, capture .m3u8 and .mp4 requests, identify video resources, and send the relevant video addresses and header information to the front-end service.
[0036] The front-end service can also recognize video resources and can run step S11.
[0037] Step S11: By analyzing the webpage DOM structure, identify video links and video resources, and / or receive video addresses and header information sent by the backend service, wherein the video addresses and header information are identified by the backend service through monitoring network requests.
[0038] In this embodiment, the front-end service can identify video links and video resources by analyzing the webpage DOM structure.
[0039] Specifically, the front-end service obtains publicly accessible hyperlinks by parsing the webpage's DOM structure, and then uses regular expressions to filter out links belonging to video resource formats (such as .mp4, .m3u8, etc.), thereby achieving the identification and extraction of video links.
[0040] Of course, the front-end service also receives video addresses and header information sent by the back-end service through network requests. This collaborative identification approach, where the front-end and back-end services work together, complements each other, significantly improving the coverage and accuracy of video resource recognition. It is compatible with various video deployment formats on different websites. Furthermore, through a reasonable division of labor between the front-end and back-end, with lightweight front-end operation and stable back-end processing, the system boasts high compatibility, high stability, and high recognition rate. It also processes only publicly available resources and legitimate requests throughout the entire process, ensuring system security and compliance.
[0041] When a video resource is identified, the front-end service can run step S12.
[0042] Step S12: When a video resource is detected, a floating button is generated on the terminal's display interface.
[0043] In this embodiment, when the front-end service detects video resources, it can generate a floating button on the terminal's display interface, allowing users to conveniently download the video resources (which can be directly downloaded to the NAS server).
[0044] The logic code for the front-end service to identify video resources through parsing the webpage's DOM structure and generate floating buttons after identifying video resources (or video resource information sent by the back-end service) is as follows: / / Content script analysis webpage link function main() { if (document.readyState != "complete") return; let links = Array.from(document.getElementsByTagName("a")) .filter((l) => checkExp.test(parseUrl(l.href))) .forEach((l) => { createItem(l); }); if (Object.keys(msgs).length) { renderFab(msgs); } } / / Floating button component const Fab = (props: { urls: { [key: string]: Action}}) => { let [open, setOpen] = useState(false); return ( <div style="{{" position: "fixed", top: "50vh", right: "10px"}}> <div style={{ display: "flex", justifyContent: "flex-end", position: "relative", marginBottom: "12px", }} > <div className={`icon ${open ? "open" : ""}`} onClick={() => { setOpen(!open); }} > {Object.keys(props.urls).length} {open && Object.keys(props.urls).map((url, index) => { return ( <div className="copy" onClick={() => { var copyFrom = document.createElement("textarea"); copyFrom.textContent = url; document.body.appendChild(copyFrom); copyFrom.select(); document.execCommand("copy"); copyFrom.blur(); document.body.removeChild(copyFrom); message(chrome.i18n.getMessage("linkCopied")); }} > {new URL(url).pathname} <div className="btn" onClick={() => { let action = props.urls[url]; action && createTask(action); }} > {chrome.i18n.getMessage("download")} ); })} ); }; At this point, after the terminal's display interface generates floating buttons, such as... Figure 4 As shown, users can interact with the floating buttons displayed on the terminal's screen (for example, clicking them to select download to NAS), such as... Figure 5 As shown. Accordingly, the front-end service can proceed to step S13.
[0045] Step S13: When the terminal initiates a download command based on the user's operation on the floating button, a download request is generated and sent to the plugin's background service. The download request includes the video address, request header, and storage path.
[0046] In this embodiment, when the terminal initiates a download command based on the user's operation on the floating button, the front-end service can generate a download request (including video address, request header, storage path, and other information) and send it to the plugin's back-end service.
[0047] The background service can run step S22.
[0048] Step S22: After receiving the download request sent by the front-end service, submit the download task request to the NAS server.
[0049] In this embodiment, the backend service can receive download requests sent by the plugin's frontend service and parse the task instructions, video request headers, video source address, and file save path carried in the request. For m3u8 format video stream tasks, the backend service can forward all parameters (task instructions, video request headers, video source address, and file save path, etc.) to the designated interface of the NAS server via a POST request to complete the download task request submission.
[0050] At this point, the NAS server can run the steps of downloading video streams based on browser extensions and NAS integration. For example... Figure 6 As shown, the process of downloading video streams based on browser extensions and NAS integration and applied to the NAS server may include steps S31, S32, S33, S34, S35, S36, and S37.
[0051] First, the NAS server can run step S31.
[0052] Step S31: Receive the download task request sent by the plugin's background service, and parse out the start command, video request header, video source address, and save path.
[0053] In this embodiment, after receiving a download task request sent by the background service of the plugin, the NAS server can parse the download task request and extract information such as the start command, video request header, video source address, and save path.
[0054] After that, the NAS server can proceed to step S32.
[0055] Step S32: Verify the validity and completeness of the video address, save path, and request header.
[0056] In this embodiment, the NAS server can verify the validity and integrity of the video address, storage path, and request header. After verification, step S33 is executed.
[0057] Step S33: Use a network request with a request header to access the video source address and obtain the content of the m3u8 file.
[0058] In this embodiment, the NAS server can use a network request with a request header to access the video source address and obtain the m3u8 file content. Of course, the processing is relatively similar or simpler for MP4 or other file formats; this embodiment uses the m3u8 format as an example for explanation.
[0059] After that, the NAS server can proceed to step S34.
[0060] Step S34: Parse the m3u8 file to generate a structured video stream list.
[0061] In this embodiment, the NAS server can parse m3u8 files to generate a structured list of video streams. The NAS server has a built-in M3U8 parser that supports parsing live streams and segmented videos.
[0062] Afterwards, the NAS server can proceed to step S35.
[0063] Step S35: Download all video segments according to the video stream list and merge the video segments into a complete MP4 file.
[0064] The NAS server can download all video segments based on the video stream list, merge the video segments into a complete MP4 file, and realize the download of video resources on the NAS.
[0065] Additionally, the NAS server can run step S36.
[0066] Step S36: Write the final generated MP4 file to the specified save path.
[0067] In this embodiment, the NAS server can write the final generated MP4 file to a specified save path, thereby saving the video resources on the NAS.
[0068] Furthermore, the NAS server can run step S37.
[0069] Step S37: Return the task status to the plugin's background service.
[0070] In this embodiment, the NAS server can return the task status to the plugin's background service.
[0071] The logic code for the NAS server section is as follows: / / Create a download task else if (message.action === createTaskAction) { let action: Action = message as Action; if (action.type === fileType.m3u8) { fetch(server + " / hlsvod / merge", { method: "post" body: JSON.stringify({ action: "open", headers: action.headers, source: encodeURIComponent(action.url), dest: encodeURIComponent( userConfig?.DirName_Downloads ?? "Downloads", `${ action.title ? action.title?.replace( / [.|?<>%#*\\ / ] / g, "") : `unknown${Date.now()}` }.mp4`, .filter((a) => !!a) .join(" / ") ), ), }) .then((res) => res.json()) .then((json) => { json.status = json.status === "success"; if (json.status) { resolve(json); } else { reject( chrome.i18n.getMessage("createTaskError") + ":" + json.reason.error ); } }) .catch((e) => { reject( chrome.i18n.getMessage("createTaskError") + ":" + e.message ); }); } The background service can run step S23 after the NAS server reports the task status.
[0072] Step S23: After receiving the task status feedback from the NAS server, send the task status to the front-end service of the plugin.
[0073] In this embodiment, the background service can monitor the task status returned by the NAS server. After receiving the task status feedback from the NAS server, it parses the task creation result. If the task creation result is a successful status, the successful status is standardized and encapsulated into a task status; if the task creation result is a failed status, the failure reason is extracted, and the failure status and failure reason are combined and standardized and encapsulated into a task status. The task status is then sent back to the plugin's front-end service.
[0074] The front-end service can then proceed to step S14.
[0075] Step S14: Receive the task status returned by the background service, generate task status prompt information on the terminal display interface, and let the user view the task status prompt.
[0076] In this embodiment, after receiving the task status from the backend service, the frontend service can parse the task status. Then, based on whether the task status is successful or failed, it generates corresponding task status prompts and displays these prompts visually in the browser page for the user to view the download task's status. Figure 7 As shown, this task status prompt can provide users with a way to access NAS applications (such as "Smart Assistant" in this embodiment), such as... Figure 8 As shown, this allows users to view specific task status and perform task management operations.
[0077] The above describes the video stream download system based on browser extensions and NAS integration, and its specific operation method, provided in this embodiment. To prevent the misuse of this tool, further development will be undertaken (although this function is not yet online, the direction and approach are clear), specifically: During the process of identifying video resources in the front-end and back-end services, the identification of downloadable identifiers for video resources is incorporated to determine whether the video resources are legally downloadable. For example, if the video tag has controlsList="download", the video tag has the download attribute, the webpage has a "download" button, or the video has no DRM, then the video is legally downloadable. For legally downloadable videos, the video streaming download method based on browser extensions and NAS integration provided in this embodiment continues to run, allowing users to conveniently download video resources to the NAS. For video resources that are not legally downloadable, this embodiment does not provide the function of downloading to the NAS, but instead provides caching acceleration and sharing functions. Video resources are cached on the NAS for accelerated video access (not saved to the user's folder, but quickly loaded via the intranet between the NAS and the user during secondary access), and a sharing function is provided to facilitate users to share cached video resources within the same NAS's home (or enterprise) account. This effectively prevents the use of this tool for illegal video resource downloads, protects the rights of copyright holders, and provides convenience for users.
[0078] This system can be widely used in various scenarios, such as for individual or home users (storing videos on NAS devices for management and viewing), education (teachers can capture and store online educational videos for offline teaching and resource management), media industry (media workers can capture and archive online video content for content creation and research), enterprise applications (enterprises can use this system to capture and store training videos, meeting recordings, and other enterprise resources), and content creators (content creators can collect and analyze online video content for creative reference and inspiration).
[0079] In summary, the application embodiments provide a video stream download system and method based on browser extensions and NAS integration. A browser is installed in the terminal, and the plugin includes a front-end service and a back-end service. The front-end service is deployed in the browser, and the back-end service is deployed in the NAS server, thereby realizing NAS integration. The plugin's front-end service is loaded when the browser is launched on the terminal. It identifies video resources (by parsing the webpage's DOM structure and monitoring network requests via a back-end service, capturing .m3u8 and .mp4 requests, extracting request headers, and parsing the m3u8 index file). Upon identifying a video resource, it generates a floating button on the terminal's display (providing users with a legitimate and convenient download function). When the terminal initiates a download command based on the user's interaction with the floating button, it generates a download request (including video address, request headers, storage path, etc.) and sends it to the plugin's back-end service. The plugin's back-end service, upon receiving a download request, submits a download task request to the NAS server. The NAS server, based on the download task request submitted by the back-end service, creates a download task and reports the task status back to the back-end service. The plugin's back-end service also sends the task status information to the plugin's front-end service upon receiving feedback from the NAS server. Furthermore, the plugin's front-end service generates a task status notification on the terminal's display for the user to view. This solution can automatically capture all downloadable video streams on web pages (not necessarily providing download functionality, but legal download is possible), eliminating the need for users to manually copy links and perform tedious download operations using third-party download tools. This solution not only identifies static video stream resources by analyzing web pages but also monitors network requests in real time to capture dynamically generated video streams (such as live streams). Compared to users using screen recording (with built-in screen recording software or third-party screen recording software) to save video streams, this solution provides complete video streams at the original resolution, with higher video quality. This solution provides an intuitive user interface on the terminal, facilitating user selection and management of video streams. This solution integrates seamlessly with NAS devices, supporting remote downloading and storage, achieving seamless integration between cloud and local storage. Furthermore, it supports multiple video formats and protocols (mp4, m3u8, etc.), including m3u8 live streams, and can capture video streams within iframes. This solves the problem that traditional plugins cannot capture video within nested frames (browser plugins support two methods: code injection within the webpage and browser background services. Code injection primarily involves static analysis, while background services can intercept all browser traffic data, not just tabs, thus capturing all iframe data and resolving the issue of traditional plugins being unable to capture video within nested frames).Furthermore, this solution enables secure processing of request header information and URL verification. It is primarily used to reuse original browser requests, filter illegal characters, reject dangerous protocols and internal network addresses, and improve the security and anti-tampering capabilities of resource requests. This solution does not forge request headers, bypass anti-hotlinking, DRM, access control, etc., and is a legitimate use of sniffing technology.
[0080] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.< / action>
Claims
1. A video streaming download system based on browser extensions and NAS integration, characterized in that, This includes a terminal and a NAS server. The terminal has a built-in browser, and plugins include front-end and back-end services. The front-end service is deployed in the browser, and the back-end service is deployed on the NAS server. The plugin's front-end service is loaded when the browser is launched on the terminal. It is used to identify video resources. When a video resource is identified, a floating button is generated on the terminal's display interface. When the terminal initiates a download command based on the user's operation on the floating button, a download request is generated and sent to the plugin's back-end service. The download request includes the video address, request header, and storage path. The plugin's background service is used to submit a download task request to the NAS server after receiving a download request; The NAS server is used to create download tasks based on download task requests submitted by the background service and to report the task status back to the background service. The plugin's background service is also used to send the task status to the plugin's front-end service after receiving the task status feedback from the NAS server. The plugin's front-end service is also used to generate task status prompts on the terminal's display interface after receiving the task status, so that users can view the task status prompts.
2. The video streaming download system based on browser extension and NAS integration according to claim 1, characterized in that, The plugin's front-end service identifies video resources in the following ways: By analyzing the DOM structure of web pages, video links and video resources can be identified.
3. The video streaming download system based on browser extension and NAS integration according to claim 1, characterized in that, The plugin's background service identifies video resources in the following ways: The browser's webRequest API monitors all network requests, captures .m3u8 and .mp4 requests, extracts request headers, parses the m3u8 index file, and sends the obtained video address and header information to the plugin's front-end service.
4. The video streaming download system based on browser extensions and NAS integration according to claim 1, characterized in that, The plugin's background service is specifically used for: Receive download requests sent by the plugin's front-end service, and parse the task instructions, video request headers, video source address, and file save path carried in the request; For m3u8 format video stream tasks, all parameters are forwarded to the specified interface of the NAS server via a POST request to complete the submission of the download task request.
5. The video streaming download system based on browser extension and NAS integration according to claim 4, characterized in that, NAS servers are specifically used for: Receive task requests and parse out the start command, video request header, video source address, and save path; Verify the validity and completeness of the video address, save path, and request headers; Use a network request with a request header to access the video source address and obtain the content of the m3u8 file; Parse the m3u8 file to generate a structured list of video streams; Download all video segments from the video stream list and merge the video segments into a complete MP4 file; Write the final generated MP4 file to the specified save path; Return the task status to the plugin's background service.
6. The video streaming download system based on browser extensions and NAS integration according to claim 5, characterized in that, The plugin's background service is specifically used for: Listen for the task status returned by the NAS server and parse the task creation results; If the task creation result is a successful status, then the successful status is standardized and encapsulated as a task status. If the task creation result is a failure, the reason for failure is extracted, and the failure status and the reason for failure are combined and standardized and encapsulated into a task status. The task status is sent back to the plugin's front-end service.
7. The video streaming download system based on browser extensions and NAS integration according to claim 6, characterized in that, The plugin's front-end service is specifically used for: After receiving the task status from the backend service, the task status is parsed. Generate corresponding task status prompts based on whether the task is successful or failed. A visual task status indicator pops up on the browser page, allowing users to view the task status of the download task.
8. A video stream download method based on browser extensions and NAS integration, characterized in that, A front-end service for a plugin applied to a video streaming download system based on browser extensions and NAS integration as described in any one of claims 1-7, wherein the front-end service is loaded when the browser is launched on the terminal, the method comprising: By analyzing the DOM structure of a webpage, video links and video resources are identified, and / or, video addresses and header information sent by a backend service are received, wherein the video addresses and header information are identified by the backend service through monitoring network requests; When a video resource is detected, a floating button is generated on the terminal's display interface; When the terminal initiates a download command based on the user's operation of the floating button, a download request is generated and sent to the plugin's background service. The download request includes the video address, request header, and storage path. Receive the task status returned by the background service and generate task status prompts on the terminal display interface for users to view.
9. A video stream download method based on browser extensions and NAS integration, characterized in that, A background service for a plugin applied to a video streaming download system based on browser extensions and NAS integration as described in any one of claims 1-7, the method comprising: Monitor all network requests through the browser's webRequest API, capture .m3u8 and .mp4 requests, extract request headers, parse the m3u8 index file, and send the obtained video address and header information to the plugin's front-end service; After receiving the download request from the front-end service, submit the download task request to the NAS server; After receiving the task status feedback from the NAS server, the task status is sent to the front-end service of the plugin.
10. A video stream download method based on browser extensions and NAS integration, characterized in that, The method applied to the NAS server in the video streaming download system based on browser extensions and NAS integration as described in any one of claims 1-7 includes: Receive download task requests sent by the plugin's background service, and parse out the start command, video request header, video source address, and save path; Verify the validity and completeness of the video address, save path, and request headers; Use a network request with a request header to access the video source address and obtain the content of the m3u8 file; Parse the m3u8 file to generate a structured list of video streams; Download all video segments from the video stream list and merge the video segments into a complete MP4 file; Write the final generated MP4 file to the specified save path; Return the task status to the plugin's background service.