Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of method and apparatus of loading videos from webpage, is intended to solve the problem that must know the title of video at existing downloading mode, makes user without knowing that video name can carry out video web page download.
The embodiment of the present invention is achieved in that a kind of method of loading videos from webpage, and described method comprises the steps:
For web browser adds the scripted code of the information of the video on analyzing web page;
When web browser is linked to a new web page, the information of video on described scripted code automatic analysis webpage, and in the play area of video, generate download button according to described information;
Video on downloading web pages.
Another technical matters of the present invention solves like this, constructs a kind of device of loading videos from webpage, and described device comprises:
Scripted code adding device, is used to web browser to add the scripted code of the information of the video on analyzing web page;
Video web page information analysis unit, when being linked to a new web page at web browser, the information of video on the scripted code analyzing web page adding by described scripted code adding device;
Download button generation unit, for according to the information of the video of described video web page information analysis element analysis, generates download button in the play area of video;
Video download unit, the download button generating for clicking described download button generation unit, the video on downloading web pages.
Implement the present invention and embodiment, for web browser adds the plug-in unit of automatic analysis video information, when being linked to new web page, described plug-in unit automatic analysis video information also generates download button according to described video information, click download button and select the video of suitable coded format to download, realized and directly from webpage, downloaded the object of the video of liking.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
In embodiments of the present invention, for web browser adds the plug-in unit of automatic analysis video information, when being linked to new web page, described plug-in unit automatic analysis video information also generates download button according to described video information, click download button and select the video of suitable coded format to download, realized and directly from webpage, downloaded the object of the video of liking.
Embodiment mono-:
Fig. 1 shows the realization flow of the loading videos from webpage method that the embodiment of the present invention provides, and details are as follows:
In step S10, for web browser adds the scripted code of the information of the video on analyzing web page.
In embodiments of the present invention, as: the scripted code that an information for embedded video on can analyzing web page is installed on the web browsers such as IE, firefox, every kind of browser has the function of expansion plugin, this scripted code is just equivalent to a plug-in unit, can add to very easily in each browser, described video includes but not limited to: video, audio frequency; Described information comprises: the download address of video and the video area information in webpage, the i.e. physical location of video on webpage.
In step S102, when web browser is opened a webpage, the information of video on described scripted code automatic analysis webpage, and in the play area of video, generate download button according to described information.
In embodiments of the present invention, when web browser is opened a webpage, described scripted code is just analyzed the video on webpage automatically, if comprise Downloadable video on webpage, obtain described information that can foradownloaded video, and in the play area of video, generate download button according to described information.
On analyzing web page, the step of the information of video is specially: the download address and the area information of video on webpage that obtain described audio or video.
In step S103, the video on downloading web pages.
In embodiments of the present invention, the step of the video on downloading web pages is specially: the download button generating in webpage clicking, in download button, include the download address of video, and click download button and just can connect described download address foradownloaded video; Select the video of suitable coded format and resolution, can select according to the speed of the performance of equipment of itself, network speed the video of most suitable coded format and resolution particularly; Download the video of described suitable coded format.
The step of the download button generating in webpage clicking is specially: set up the associated of mouse and download button, download button is set up associated with mouse afterwards in generation; When mouse moves to play area, show download button, download button is in hidden state at ordinary times; Click the download button of described demonstration.
Described selection comprises: artificial selection, selection automatically.Under artificial selection pattern, user can select according to the use state of present computer, if present user is in idle condition, can select downloading mode at full speed, all Internet videos, for downloading, as in use state, can be arranged to a speed threshold values, do not affecting under the prerequisite of work foradownloaded video.Automatic mode, is the current system process of comprehensive analysis, and the Internet Use of each process, selects suitable speed of download, or according to video format and the resolution of analysis result prompting custom system recommendations for selection.
Described coded format is divided into again video code model and audio coding form.
Described video code model comprises MP4, Flv, WebM etc.
Described resolution comprises 1080p, 720p, 450p, 360p etc.
The embodiment of the present invention, for web browser adds the plug-in unit of automatic analysis video information, when being linked to new web page, described plug-in unit automatic analysis video information also generates download button according to described video information, click download button and select the video of suitable coded format to download, realized and directly from webpage, downloaded the object of the video of liking.
Embodiment bis-:
The structural drawing that is illustrated in figure 2 the loading videos from webpage device that the embodiment of the present invention provides, for convenience of explanation, only illustrates the part relevant to the embodiment of the present invention, comprising:
Scripted code adding device 21, is used to web browser to add the scripted code of the information of the video on analyzing web page.
Video web page information analysis unit 22, when opening a webpage at web browser, the scripted code adding by described scripted code adding device 21 is analyzed the information of video on described webpage.
Download button generation unit 23, for the information of the video analyzed according to described video web page information analysis unit 22, generates download button in the play area of video.
Video download unit 24, the download button generating for clicking described download button generation unit 23, the video on downloading web pages.
Wherein, described video web page information analysis unit 22 specifically comprises:
Video information analysis module 221, for analyzing the download address of video and video at the area information of webpage.
Wherein, described video download unit 24 specifically comprises:
Download button is clicked module 241, for clicking video in the download button of the play area generation of webpage.
Video code model is selected module 242, for click module 241 click download button in described download button after, selects suitable video code model and resolution.
In embodiments of the present invention, user can use artificial or automatic two kinds of modes to select downloading mode, under artificial selection pattern, user can select according to the use state of present computer, if present user is in idle condition, can select downloading mode at full speed, all Internet videos, for downloading, as in use state, can be arranged to a speed threshold values, do not affecting under the prerequisite of work foradownloaded video.Automatic mode, is the current system process of comprehensive analysis, and the Internet Use of each process, selects suitable speed of download, or according to video format and the resolution of analysis result prompting custom system recommendations for selection.
Video download module 243, for selecting the coded format foradownloaded video of the video of module 242 selections according to described video code model.
Wherein said download button is clicked module 241 and is specifically comprised:
The associated submodule 2411 of mouse, for setting up the associated of download button and mouse.
Download button display sub-module 2412, for according to the associated submodule 2411 of described mouse, when mouse moves to the play area of video, shows described download button.
Download button is clicked submodule 2413, the download button showing for clicking described download button display sub-module 2412.
In embodiments of the present invention, described video code model comprises MP4, Flv, WebM etc.; Described resolution comprises 1080p, 720p, 450p, 360p etc.
The embodiment of the present invention, for web browser adds the plug-in unit of automatic analysis video information, when being linked to new web page, described plug-in unit automatic analysis video information also generates download button according to described video information, click download button and select the video of suitable coded format to download, realized and directly from webpage, downloaded the object of the video of liking.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any modifications of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.