@@ -273,7 +273,6 @@ const RedirectEngine = function() {
273
273
274
274
RedirectEngine . prototype . reset = function ( ) {
275
275
this . rules = new Map ( ) ;
276
- this . ruleTypes = new Set ( ) ;
277
276
this . ruleSources = new Set ( ) ;
278
277
this . ruleDestinations = new Set ( ) ;
279
278
this . modifyTime = Date . now ( ) ;
@@ -384,7 +383,6 @@ RedirectEngine.prototype.toURL = function(fctxt) {
384
383
RedirectEngine . prototype . addRule = function ( src , des , type , pattern , redirect ) {
385
384
this . ruleSources . add ( src ) ;
386
385
this . ruleDestinations . add ( des ) ;
387
- this . ruleTypes . add ( type ) ;
388
386
const key = `${ src } ${ des } ${ type } ` ,
389
387
entries = this . rules . get ( key ) ;
390
388
if ( entries === undefined ) {
@@ -475,6 +473,10 @@ RedirectEngine.prototype.compileRuleFromStaticFilter = function(line) {
475
473
redirect = 'empty' ;
476
474
continue ;
477
475
}
476
+ if ( option === 'mp4' ) {
477
+ redirect = 'noopmp4-1s' ;
478
+ continue ;
479
+ }
478
480
if ( option . startsWith ( 'domain=' ) ) {
479
481
srchns = option . slice ( 7 ) . split ( '|' ) ;
480
482
continue ;
@@ -496,8 +498,13 @@ RedirectEngine.prototype.compileRuleFromStaticFilter = function(line) {
496
498
497
499
// Need one single type -- not negated.
498
500
if ( type === undefined ) {
499
- if ( redirect !== 'empty' ) { return ; }
500
- type = '*' ;
501
+ if ( redirect === 'empty' ) {
502
+ type = '*' ;
503
+ } else if ( redirect === 'noopmp4-1s' ) {
504
+ type = 'media' ;
505
+ } else {
506
+ return ;
507
+ }
501
508
}
502
509
503
510
if ( deshn === '' ) {
@@ -562,7 +569,6 @@ RedirectEngine.prototype.toSelfie = function(path) {
562
569
`${ path } /main` ,
563
570
JSON . stringify ( {
564
571
rules : rules ,
565
- ruleTypes : Array . from ( this . ruleTypes ) ,
566
572
ruleSources : Array . from ( this . ruleSources ) ,
567
573
ruleDestinations : Array . from ( this . ruleDestinations )
568
574
} )
@@ -580,7 +586,6 @@ RedirectEngine.prototype.fromSelfie = function(path) {
580
586
}
581
587
if ( selfie instanceof Object === false ) { return false ; }
582
588
this . rules = new Map ( selfie . rules ) ;
583
- this . ruleTypes = new Set ( selfie . ruleTypes ) ;
584
589
this . ruleSources = new Set ( selfie . ruleSources ) ;
585
590
this . ruleDestinations = new Set ( selfie . ruleDestinations ) ;
586
591
this . modifyTime = Date . now ( ) ;
0 commit comments