tags:

views:

378

answers:

1

im just interested how firefox plugins like DownloadHelper, is able to automatically find .flv URL

+2  A: 

There are a bunch of possible approaches and DownloadHelper seems to implement a couple of them. If you extract the .xpi file (which is a ZIP file) and look in the components folder, you'll see a bunch of different handlers for getting videos. I haven't looked at it thoroughly but you'll notice that dhYoutubeProbe.js basically extracts the video ID from the DOM and then plugs that into a standard YouTube URL pattern for fetching FLVs.

dhNetworkProbe seems to implement a more sneaky and interesting approach - it monitors the browser cache and/or HTTP requests for transfers of media files to get the underlying file's URL.

You could also look at how Firebug or similar monitor HTTP requests and responses. Playing an FLV via Flash player logs to Firebug like any other (non-streaming) request.

Ben