Support for MP4 Downloader has been discontinued.
I don't have the time anymore to keep up with all the breaking changes that Mozilla is making in add-on development for Firefox, in addition to reacting to changes in YouTube, Dailymotion, and Vimeo that affect video downloading. Since Mozilla dropped support for traditional add-ons in November 2017, MP4 Downloader has stopped working entirely in new versions of Firefox.
The codebase has been left in the middle of a complete rewrite (see the Source Code section of the Development page), although this rewrite is not anywhere close to what is required to support new versions of Firefox. That codebase, and this website, are left here for archival purposes.
To all MP4 Downloader fans, thanks for many years of support.
Reemplazo de contenido selectiva de MP4 Downloader allows certain preferences to be written in a special syntax in which certain values are substituted in for generic variable names. It also allows the use of “if statements” to control content.
If you are looking for a method of parsing strings using Selective Content Replacement, see the parseString
function in: http://www.mozdev.org/source/browse/mp4downloader/src/1.3.x/modules/util.jsm
%%VAR
(two percent signs (%%) followed by the variable name).Variables for the Default Filename preference:
%%TITLE
- replaced with the current video title%%HQ
- replaced with 1 if the video is currently being downloaded in high-quality/high-definition or 0 if it is not (NOTE: The variable is %%HQ
, not %%HD
)%%SITE
- replaced with the current site from which the video is being downloaded%%DOWNURL
- replaced with the direct URL of the video%%PAGEURL
- replaced with the URL of the video page that the video was on (ie. http://www.youtube.com/watch?v=…)%%DTA
- replaced with 1 if DownThemAll is being used to download the video or 0 if it is notAdded in MP4 Downloader version 1.3.3 (still under development):
%%YEAR
- replaced with the current year (4 digits)%%SHORTYEAR
- replaced with the current year (2 digits)%%MONTH
- replaced with the current month (numerical - 1 or 2 digits)%%FULLMONTH
- replaced with the current month (full name - January, February, etc.)%%SHORTMONTH
- replaced with a 3-letter abbreviation for the current month (Jan, Feb, Mar, etc.)%%DAY
- replaced with the current day of the month (1 or 2 digits)%%HOUR
- replaced with the current 2-digit hour from a 12-hour clock (1 - 12)%%FULLHOUR
- replaced with the current 2-digit hour from a 24-hour clock (0 - 23)%%MINUTE
- replaced with the current 2-digit minute%%SECOND
- replaced with the current 2-digit second%%NUM
- replaced with the count of how many videos were downloaded so far today (ie. the 5th video downloaded today would be “5”) - NOT YET IMPLEMENTED[[if %%FULLHOUR matches ^(1[2-9]|2[0-3])$]]PM[[else]]AM[[endif]]
These variables (added in version 1.3.3 - still under development) may not contain data on some videos:
%%AUTHOR
- replaced with the video authorAn if statement can be used to only show text if a certain variable has a certain value or matches a certain regular expression.
Syntax: [[if %%VAR OPERAND VALUE]]stuff[[else]]other stuff[[endif]]
%%VAR
is a variable (see variables)OPERAND
is an operand (either “is”, “isnot”, “matches”, or “imatches” - see below)VALUE
is a string (or regular expression if OPERAND
is “matches” or “imatches”) that is compared to %%VAR
All if statements should match this regular expression: \[\[if %%[A-Z]+ (is|isnot|i?matches) .+\]\].*(\[\[else\]\].*)?\[\[endif\]\]
If statements compare a variable (%%VAR
) to a value (VALUE
) using the specified operand (OPERAND
). The if statement ends when it reaches [[endif]]
. An optional [[else]]
statement can be used to display something in the event that the if statement is evaluated to false.
Basic rules:
[[
and ]]
can have unexpected results).]]
should not appear ANYWHERE inside if statements. This can also produce unexpected results.[[if %%VAR is %%ANOTHERVAR]]stuff[[endif]]
is invalid, although [[if %%VAR is VALUE]]%%ANOTHERVAR[[endif]]
is still OK).[[if %%VAR is VALUE]]stuff to display[[endif]]
[[if %%VAR isnot VALUE]]stuff to display[[endif]]
[[if %%VAR matches REGEXP]]stuff to display[[endif]]
REGEXP
is a standard JavaScript regular expression that is plugged into JavaScript’s string.match function. Do NOT include the leading or trailing “/” when specifying the regular expression. To use case-insensitive matching, specify “imatches” instead of “matches”: [[if %%VAR imatches REGEXP]]
NOTE: Be sure to escape any backslashes in if statements! Example: [[if %%VAR matches .*\.js]]
should be [[if %%VAR matches .*\\.js]]
%%TITLE ([[if %%HQ is 1]]HD from [[endif]]%%SITE)
will transform into My Awesome Video (YouTube) for a standard YouTube video or My Awesome Video (HD from YouTube) for an HD version of that video.[[if %%TITLE matches (from|by) Bob$]]A video from my friend[[else]]%%TITLE[[endif]]
will transform into A video from my friend for a video titled “blah blah from Bob” or “blah blah by Bob” or just the video title for any other video.