Wiki

Clone wiki

flv_download / AddSite

Adding a new site

The basic idea is to find/guess/determine the URL of the movie file to download, i.e. the .flv or .mp4 file, from the page where it is being viewed.

General description

In the simplest case a simple regular expression allows to extract the URL from the source of the page.

In some other cases it is not easy to find "inside" the original page, but can be determined by some transformation of the original URL.

In most cases, unfortunately, one intermediary file needs to be downloaded in order to find some (temporary) URL where the video file is hosted.

To determine precisely where the file comes from, basic tools include the Right Click > Inspect Element > Resources in order to find where the video file is.

Patching the source

Simplest case

If the video file URL appears in the viewing page, only a simple modification will allow to add the site to the extension.

The necessary modification is to add a block to the background.html file. The block contains three elements:

  • a regular expression determining on which pages we should display the OK badge,
  • a string describing the name of the site,
  • another regular expression, necessarily using the g flag (so that it will provide all matching groups) and defining the matches in the source of the viewing page where the video file URL is provided.

For instance:

         {
            regex: /http:\/\/.*evilangel.com\/.*\/dvd\/*/,
            name: 'Evil Angel',
            vidUrl: /file=(http:\/\/.*trailers.*tr_.*.mp4)/g
         },

This block will display the badge OK on pages of the evilangel website, provides the corresponding name, but most of all says that we can download URLs found after file= and starting with http://, including some other stuff, and ending in mp4.

Slightly more complicated

In some other cases, the video file/ URL is there, but encoded so as to be given as parameter in another URL (with the %this and %that stuff).

In that case, just do as above, but include

        normalize: true,

in the record.

More complex case

TODO...

When all else fails

Any help explaining, even in informal terms, how/where to find the video file for a given original URL would be a great help.

Updated