CN101645815B - Video and audio file download prompt method - Google Patents

Video and audio file download prompt method Download PDF

Info

Publication number
CN101645815B
CN101645815B CN 200810117879 CN200810117879A CN101645815B CN 101645815 B CN101645815 B CN 101645815B CN 200810117879 CN200810117879 CN 200810117879 CN 200810117879 A CN200810117879 A CN 200810117879A CN 101645815 B CN101645815 B CN 101645815B
Authority
CN
China
Prior art keywords
file
information
audio
video
interface function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN 200810117879
Other languages
Chinese (zh)
Other versions
CN101645815A (en
Inventor
钟华
鲁维
刘明海
王云鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu Online Network Technology Beijing Co Ltd
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN 200810117879 priority Critical patent/CN101645815B/en
Publication of CN101645815A publication Critical patent/CN101645815A/en
Application granted granted Critical
Publication of CN101645815B publication Critical patent/CN101645815B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a video and audio file download prompt method, which comprises the following steps: in a process of a browser of an internet, intercepting a file to open an interface function to acquire a link address of a file to be accessed and the handle information of the file, and correspondence information of the link address and the handle information; if the file type of the file is judged to be a video and audio file type according to the link address, generating file download prompt information according to the link address; and if the file type of the file cannot be judged to be the video and audio file type according to the link address, judging the file type of the file again according to file content information acquired by intercepting the file and reading the interface function, and if the file type of the file is the video and audio file type, searching the link address corresponding to the handle information acquired by intercepting the file and reading the interface function according to the correspondence information, and generating file download prompt information according to the searched link address. The method can provide a download address of the video and audio file to realize direct download.

Description

Video and audio file download prompt method
Technical field
The present invention relates to Internet technical field, relate in particular to a kind of video and audio file download prompt method.
Background technology
Along with the development of Internet technology, the multimedia resource of Internet-based also becomes increasingly abundant.Existing audio frequency and video website all provides audio/video information online playing function, but a part of audio frequency and video website does not provide the clear and definite download address about audio-video document, and comparatively strict download limits and encryption have been done for the download address of this class audio-video document, make the user can't directly download rapidly required audio-video document, and can only select to watch online.
Realize in prior art that the method that the website audio-video document is downloaded is to carry out data analysis by obtaining the transmitted data on network bag by network-driven packet capturing on network interface card, monitoring and analysis HTTP request bag, need first identification " tcp " packet, then identification " http " request, identify at last the targeted website, obtain the download address of audio-video document.In the method that the existing techniques in realizing audio-visual file is downloaded, operate or realize during the download address of acquisition audio-video document equal more complicated therefore to cause downloading process comparatively loaded down with trivial details, reduce user's network performance; But also may reason can't accurately obtain download address because download address is encrypted etc., appearance can't be downloaded the situation of required file, affects service quality.
Summary of the invention
The invention provides a kind of video and audio file download prompt method, obtain because of download address the defective that difficulty can't directly be downloaded required file in order to solve in prior art, being embodied as the user provides download address to carry out the audio-video document download.
The invention provides a kind of video and audio file download prompt method, comprising:
In the Internet-browser process, the chained address of the file that the acquisition of interception File Open interface function will be accessed and the handle information of described file, and the correspondence relationship information of described chained address and handle information;
If judging the file type of described file according to described chained address is the audio-video document type, according to described chained address spanned file prompting download information;
If the file type that can not judge described file according to described chained address is the audio-video document type, judge again the file type of described file according to the document content information that obtains by interception file fetch interface function, if the file type of described file is the audio-video document type, according to described correspondence relationship information search with by tackling chained address corresponding to handle information that described file fetch interface function obtains, and according to the chained address spanned file prompting download information that finds.
Video and audio file download prompt method provided by the invention, in the Internet-browser process, by interception File Open interface function and file fetch interface function, the chained address of the audio-video document that acquisition will be accessed, and generate to be used for the prompting download information that the prompting user directly downloads this document, do not affect the normal realization that the information of carrying out of IE Using API Function represents.For the user, after opening a webpage, if there is the online audio-video document of playing on this webpage, can download interested file according to the file download prompt information on the Internet-browser menu, the defective of having avoided the user to want to download audio-video document and can't having obtained easily the download link address has improved service quality; And obtaining with spanned file prompting download information of download link address information all carried out on the backstage, do not affect the normal flow of user's browsing page resource information.
Description of drawings
Fig. 1 is video and audio file download prompt method flow chart of the present invention;
Fig. 2 obtains the chained address flow chart in video and audio file download prompt method of the present invention.
Embodiment
Further illustrate the technical scheme of the embodiment of the present invention below in conjunction with the drawings and specific embodiments.
Fig. 1 is video and audio file download prompt method flow chart of the present invention, and as shown in Figure 1, the method comprises the steps:
Step 100, in the Internet-browser process, the chained address of the file that the acquisition of interception File Open interface function will be accessed and the handle information of described file, and the correspondence relationship information of described chained address and handle information;
Internet-browser for example the IE of Microsoft (Internet Explorer) browser when starting, when having the audio/video information that can play online in the resource information that forms webpage, at first IE needs to call " http " demand file and opens function creation handle information.IE will send to the File Open interface function as input parameter the chained address (URL address) of the file that will access when sending call request to the File Open interface function, and wherein said File Open interface function is a kind of API (ApplicationProgramming Interface; Be called for short: API) function, can return according to the chained address that receives and call result and namely generate corresponding handle and as a result of return.Method provided by the invention is exactly on this basis, by in the Internet-browser process, interception File Open interface function, obtain the chained address of the file that IE will access and the handle information of described file, and set up the correspondence relationship information of the handle information of described chained address and described file.The embodiment of the present invention can adopt API interception (hook) technology to realize, by " bho " (Browser Helper Object) interface, dynamic base is loaded into the IE process space when IE starts in, several functions of taking over " winInet " by " API hook " technology comprise File Open interface function for example " httpOpenRequest " or " InternetOpenUrl ", file fetch interface function " InternetReadFile " or " InternetReadFileEx ".The IE browser when carrying out the file download at every turn, can call these functions, when the meaning of taking over API is that IE calls these api functions, can skip to the processing function of our predefined correspondence, and call corresponding real API by our alignment processing function.In the method that the embodiment of the present invention provides, " API hook " technology can specifically select " detour " technology to implement interception and adapter to api function.Can be after opening Internet-browser in the present embodiment method trigger the operation of tackling api function during the accesses network resource, thereby obtain information needed.
For the URL address of the file that obtains IE access, by interception File Open interface function, therefrom obtain needed URL address in the inventive method, performing step comprises as shown in Figure 2:
Step 1001 in the Internet-browser process, is tackled described File Open interface function, the chained address of the file that acquisition will be accessed;
Step 1002 forwards described chained address to described File Open interface function, and obtains the handle information that described File Open interface function generates according to described chained address;
Step 1003 is set up the corresponding relation between described chained address and described handle information.
Particularly, when IE for example calls the File Open interface function of " httpOpenRequest ", to send a request message to " httpOpenRequest " function, send to " httpOpenRequest " function as input parameter the address of the file that will access, the present embodiment is by " API hook " technical intercept request message, and therefrom obtain needed URL address information, again with the URL address information obtained as parameter, real " httpOpenRequest " function of calling system." httpOpenRequest " function responds the request message that comprises the URL address information, generates handle information, and handle information is returned; After getting handle information, handle information is transmitted to IE again; By IE being called the interception of File Open interface function, behind URL address and handle information that acquisition IE will access, set up corresponding relation both.
Step 101, whether the file type of the file that will access according to the judgement of described chained address is the audio-video document type, if execution in step 102; If not execution in step 103;
Can directly judge according to link address information the type of file owing to existing, therefore after the link address information of the file that the acquisition of interception File Open interface function will be accessed, can be at first judge according to the type of this link address information to the file that will access, do different processing according to judged result.
Step 102 is according to described chained address spanned file prompting download information;
If learn that according to the judgement of described chained address the file that will access is the audio frequency and video type file, generate described file download prompt information according to described chained address, for example downloading " xxx.flv ", just can to judge this document be video file, can directly generate prompting download information, this prompting download information is according to the URL address generation, information can be the menu option of a correspondence of appearance on IE etc., just can directly download the file on local hard drive when the user clicks this menu.In the time can directly judging the file type of file according to the chained address, although the follow-up operation that also will tackle file fetch interface function, but can not do special processing, and the audio-video document of downloading on flow process downloading web pages resource according to normal file gets final product.Like this, Internet-browser is downloaded the audio-video document resource information completing, and when the played file type is the file of audio-video document type in Internet-browser, has also correspondingly provided the information of downloading this document, selects to download for the user.
Step 103, according to the file type of the described file of document content information judgement that obtains by interception file fetch interface function, if the audio-video document type, execution in step 104; If not the audio-video document type, execution in step 105;
If the file type that can not judge described file according to described chained address is the audio-video document type, can obtain the document content information of the file that will access when interception file fetch interface function, and again the type of file is judged according to this document content information, and handle accordingly.
Step 104, according to described correspondence relationship information search with by tackling chained address corresponding to handle information that described file fetch interface function obtains, and according to the chained address spanned file prompting download information that finds;
Internet-browser after receiving the handle information of File Open interface function according to the chained address generation, call the download that file fetch interface function is completed file data at complete call File Open interface function according to the handle information that obtains.IE to the File Open interface function for example " InternetReadFile " function send a request message, wherein carry the handle information of wanting to some extent access file corresponding, the request get file content by this api function.pass through in the Internet-browser process in the present embodiment, interception File Open interface function is " InternetReadFile " function for example, obtain handle information and document content information, can not do under the estimate of situation that outfile is the audio frequency and video type file according to the link address information of file before, at first judge whether the described handle recording of information that obtains by tackling described file fetch interface function, if have, can judge file type according to document content information again, can be specifically to be that certain known audio-video document data format judges according to the file content data format that reads, after obtaining file and being the judged result of audio frequency and video type file, in the chained address and the correspondence relationship information between handle information set up before, the locating file type is the corresponding chained address of handle information of the file of audio-video document type, and according to the chained address spanned file prompting download information that finds.Also handle information to be sent to for example " InternetReadFile " function of file fetch interface function in spanned file prompting download information, " InternetReadFile " function is completed normal file data read operation according to handle information, realizes the online broadcast on IE.Like this, Internet-browser is downloaded the audio-video document resource information completing, and when the played file type is the file of audio-video document type in Internet-browser, has also correspondingly provided the information of downloading this document, selects to download for the user.
If do not record chained address corresponding to this handle information in the chained address of setting up before and the correspondence relationship information between handle information, or just there is no any record about this handle information before, directly call real " http " data function reading, and function is returned results return to IE, and do not do other processing.
Step 105, the video and audio file download prompt handling process finishes.
If there is no audio-video document in the web page resources that IE opens, open handling process execution info web according to normal Internet resources and represent operation, certainly also needn't spanned file prompting download information.
Video and audio file download prompt method provided by the invention, in the Internet-browser process, by interception File Open interface function and file fetch interface function, the chained address of the audio-video document that acquisition will be accessed, and generate to be used for the prompting download information that the prompting user directly downloads this document, do not affect the normal realization that the information of carrying out of IE Using API Function represents.For the user, after opening a webpage, if there is the online audio-video document of playing on this webpage, can download interested file according to the file download prompt information on the Internet-browser menu, the defective of having avoided the user to want to download audio-video document and can't having obtained easily the download link address has improved service quality; And the prompting download information of obtaining and generate of download link address information is all carried out on the backstage, do not affect the normal flow of user's browsing page resource information.What tackle in the inventive method is " http " access request of current I E browser, and is the packet for the request of sending, and with respect to existing random packet capturing on network, the information scratching of this method has more directionality, and efficient is higher.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be completed by the hardware that program command is correlated with, aforesaid program can be stored in a computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: the various media that can be program code stored such as ROM, RAM, magnetic disc or CD.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment, the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme that aforementioned each embodiment puts down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (4)

1. a video and audio file download prompt method, is characterized in that, comprising:
In the Internet-browser process, the chained address of the file that the acquisition of interception File Open interface function will be accessed, forward described chained address and obtain described File Open interface function according to the handle information that described chained address generates to described File Open interface function, set up the corresponding relation between described chained address and described handle information;
If judging the file type of described file according to described chained address is the audio-video document type, according to described chained address spanned file prompting download information;
If the file type that can not judge described file according to described chained address is the audio-video document type, judge again the file type of described file according to the document content information that obtains by interception file fetch interface function, if the file type of described file is the audio-video document type, according to described correspondence relationship information search with by tackling chained address corresponding to handle information that described file fetch interface function obtains, and according to the chained address spanned file prompting download information that finds.
2. video and audio file download prompt method according to claim 1, is characterized in that, also comprises to described Internet-browser returning to the handle information that described File Open interface function generates according to described chained address.
3. video and audio file download prompt method according to claim 1, is characterized in that comprising before the file type according to the described file of document content information judgement that obtains by interception file fetch interface function: learn the described handle recording of information that obtains by tackling described file fetch interface function by judgement.
4. video and audio file download prompt method according to claim 1, characterized by further comprising: the played file type is the file of audio-video document type in described Internet-browser.
CN 200810117879 2008-08-06 2008-08-06 Video and audio file download prompt method Active CN101645815B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200810117879 CN101645815B (en) 2008-08-06 2008-08-06 Video and audio file download prompt method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200810117879 CN101645815B (en) 2008-08-06 2008-08-06 Video and audio file download prompt method

Publications (2)

Publication Number Publication Date
CN101645815A CN101645815A (en) 2010-02-10
CN101645815B true CN101645815B (en) 2013-05-08

Family

ID=41657540

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200810117879 Active CN101645815B (en) 2008-08-06 2008-08-06 Video and audio file download prompt method

Country Status (1)

Country Link
CN (1) CN101645815B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102169486A (en) * 2010-02-25 2011-08-31 腾讯科技(深圳)有限公司 File downloading method and device
CN102360349B (en) * 2011-07-21 2014-12-03 深圳万兴信息科技股份有限公司 Method and device for acquiring audio/video link address in webpage
CN102306077A (en) * 2011-08-04 2012-01-04 深圳市万兴软件有限公司 Method for downloading video in Macintosh (MAC) platform browser and browser
CN103577427A (en) * 2012-07-25 2014-02-12 中国移动通信集团公司 Browser kernel based web page crawling method and device and browser containing device
CN104581401B (en) * 2013-10-10 2019-02-01 腾讯科技(深圳)有限公司 The method and device of data playback
CN104796785A (en) * 2015-03-31 2015-07-22 北京奇虎科技有限公司 Video playing method and device in application program
CN107102937B (en) * 2016-02-19 2021-03-02 腾讯科技(深圳)有限公司 User interface testing method and device
CN107256276A (en) * 2017-08-01 2017-10-17 北京合天智汇信息技术有限公司 A kind of mobile App content safeties acquisition methods and equipment based on cloud platform
CN108829708A (en) * 2018-05-02 2018-11-16 广州金山安全管理系统技术有限公司 File security judgment method and device
CN111212418A (en) * 2019-12-31 2020-05-29 北京指掌易科技有限公司 Device and method for safely downloading mobile terminal application

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1713573A (en) * 2004-06-22 2005-12-28 腾讯科技(深圳)有限公司 Realization and realizing device for selective download from webpage inserted piece
CN101158978A (en) * 2007-11-14 2008-04-09 深圳市迅雷网络技术有限公司 Method, system and device for accessing network resource

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1713573A (en) * 2004-06-22 2005-12-28 腾讯科技(深圳)有限公司 Realization and realizing device for selective download from webpage inserted piece
CN101158978A (en) * 2007-11-14 2008-04-09 深圳市迅雷网络技术有限公司 Method, system and device for accessing network resource

Also Published As

Publication number Publication date
CN101645815A (en) 2010-02-10

Similar Documents

Publication Publication Date Title
CN101645815B (en) Video and audio file download prompt method
JP6999657B2 (en) Information push method and information push device
CN110366041B (en) Media data sharing method, device and equipment
US8886009B2 (en) Creation of video bookmarks via scripted interactivity in advanced digital television
CN101784011A (en) Control device and method for releasing advertisements in mobile terminal according to triggering information
WO2018157743A1 (en) Media data processing method, device, system and storage medium
WO2015024743A1 (en) Method and arrangement for processing and providing media content
CN102110124A (en) Method, device and system for subscribing RSS
CN112532490A (en) Regression testing system and method and electronic equipment
CN111901695B (en) Video content interception method, device and equipment and computer storage medium
CN111246302A (en) Method, device and terminal for downloading data by browser
CN103945259A (en) Online video playing method and device
WO2009009123A2 (en) Method for media discovery
CN105611422A (en) Online live broadcast method based on multi-media list and apparatus thereof
US20090083141A1 (en) Methods, systems, and computer program products for detecting and predicting user content interest
CN106331876A (en) Method and device for playing web video
US7844748B2 (en) Method and apparatus for presenting entity not supporting UPnP as UPnP device or content
CN113360413A (en) Code testing method and device
JP2009163595A (en) Information processing system, information processor, information processing method, and computer program
US8478822B2 (en) Device and method of sharing contents based on time synchronization
CN108241748B (en) Method, device, medium and equipment for acquiring live broadcast music name
CN108564971B (en) Audio playing method and device
CN105897852A (en) Advertisement downloading method, client and server
CN114157991B (en) Recording and playing method and equipment for group call
CN112579952B (en) Page display method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant