Browse Source

Update MITM Hostname sgmodule

SukkaW 4 years ago
parent
commit
0b5d9f3e8b
3 changed files with 20 additions and 12 deletions
  1. 11 4
      Build/build-mitm-hostname.js
  2. 9 8
      List/non_ip/reject.conf
  3. 0 0
      Modules/sukka_mitm_hostnames.sgmodule

+ 11 - 4
Build/build-mitm-hostname.js

@@ -6,8 +6,6 @@ let table;
 const PRESET_MITM_HOSTNAMES = [
   '*baidu.com',
   '*ydstatic.com',
-  'bdsp-x.jd.com',
-  'dsp-x.jd.com',
   '*snssdk.com',
   '*musical.com',
   '*musical.ly',
@@ -53,9 +51,10 @@ try {
           .replaceAll('^https?://', '')
           .replaceAll('^https://', '')
           .replaceAll('^http://', '')
+          .split('/')[0]
           .replaceAll('\\.', '.')
           .replaceAll('.+', '*')
-          .replace(/(.*)\//, (_, $1) => $1)
+          .replaceAll('(.*)', '*')
       }))
   );
 
@@ -91,6 +90,13 @@ try {
             .replaceAll('^http://', '')
             .replaceAll('\\.', '.')
             .replaceAll('.+', '*')
+            .replaceAll('\\d', '*')
+            .replaceAll('([a-z])', '*')
+            .replaceAll('[a-z]', '*')
+            .replaceAll('([0-9])', '*')
+            .replaceAll('[0-9]', '*')
+            .replaceAll(/{.+?}/g, '')
+            .replaceAll(/\*+/g, '*')
         }))
     );
   }));
@@ -143,7 +149,8 @@ try {
   });
 
   console.log('Mitm Hostnames:');
-  console.log(mitmDomains.join(', '));
+  console.log('hostname = %APPEND% ' + mitmDomains.join(', '));
+  console.log('--------------------');
   console.log('Parsed Sucessed:');
   console.log(table.table(parsedDomainsData, {
     border: table.getBorderCharacters('void'),

+ 9 - 8
List/non_ip/reject.conf

@@ -53,7 +53,7 @@ URL-REGEX,^https?://cover.baidu.com/cover/page/dspSwitchAds/
 URL-REGEX,^https?://c\.tieba\.baidu\.com/c/s/splashSchedule
 URL-REGEX,^https?://issuecdn\.baidupcs\.com/issue/netdisk/guanggao/
 URL-REGEX,^https?://update\.pan\.baidu\.com/statistics
-URL-REGEX,^http://[\s\S]*baidu\.com/.*ad[xs]\.php
+URL-REGEX,^http://.*baidu\.com/.*ad[xs]\.php
 URL-REGEX,^http://c\.tieba\.baidu\.com/c/s/splashSchedule$
 
 # >> Bilibili
@@ -92,7 +92,8 @@ URL-REGEX,^https?://service\.iciba\.com/popo/open/screens/v\d\?adjson
 
 # >> Netease
 URL-REGEX,^http://p\d\.music\.126\.net/\w+==/\d+\.jpg$
-URL-REGEX,^http://iad.*mat\.[a-z]*\.12[67]\.net/\w+\.(jpg|mp4)$
+URL-REGEX,^http://iad.*mat\.[a-z]*\.126\.net/\w+\.(jpg|mp4)$
+URL-REGEX,^http://iad.*mat\.[a-z]*\.127\.net/\w+\.(jpg|mp4)$
 URL-REGEX,^https?://.+/eapi/(ad|log)/
 URL-REGEX,^https?://client\.mail\.163\.com/apptrack/confinfo/searchMultiAds
 URL-REGEX,^https?://c\.m\.163\.com/nc/gl/
@@ -114,8 +115,7 @@ URL-REGEX,^https?://edit\.sinaapp\.com/ua\?t=adv
 # >> Sina Weather
 URL-REGEX,^https?://tqt\.weibo\.cn/.+advert\.index
 URL-REGEX,^https?://tqt\.weibo\.cn/api/advert/
-URL-REGEX,^https?://tqt\.weibo\.cn/overall/redirect\.php\?r=tqtad
-URL-REGEX,^https?://tqt\.weibo\.cn/overall/redirect\.php\?r=tqt_sdkad
+URL-REGEX,^https?://tqt\.weibo\.cn/overall/redirect\.php\?r=(tqtad|tqt_sdkad)
 
 # >> Sina Weibo
 URL-REGEX,^https?://sdkapp\.uve\.weibo\.com/interface/sdk/sdkad\.php
@@ -131,12 +131,13 @@ URL-REGEX,^https?://s1\.api\.tv\.itc\.cn/v\d/mobile/control/switch\.json
 
 # >> JD
 URL-REGEX,^http://api\.m\.jd\.com/client\.action\?functionId=start$
-URL-REGEX,^https?://(bdsp-x|dsp-x)\.jd\.com/adx/
+URL-REGEX,^https?://dsp-x\.jd\.com/adx/
+URL-REGEX,^https?://bdsp-x\.jd\.com/adx/
 URL-REGEX,^https?://api\.m\.jd.com/client\.action\?functionId=start
 URL-REGEX,^https?://ms\.jr\.jd\.com/gw/generic/base/na/m/adInfo
 
 # >> TikTok (include China / Internation Version)
-URL-REGEX,^https://[a-zA-Z]{2}\.snssdk\.com/api/ad/
+URL-REGEX,^https://[a-z]{2}\.snssdk\.com/api/ad/
 
 # >> UC
 URL-REGEX,^https?://huichuan\.sm\.cn/jsad
@@ -353,8 +354,8 @@ URL-REGEX,^https?://mob\.mddcloud\.com\.cn/api/(ad|advert)/
 URL-REGEX,^https?://mangaapi\.manhuaren\.com/v\d/public/getStartPageAds
 # >> Meituan
 URL-REGEX,^https?://img\.meituan\.net/midas/
-URL-REGEX,^https?://p([0-9])\.meituan\.net/(mmc|wmbanner)/
-URL-REGEX,^https?://p\d{1}\.meituan\.net/(adunion|display|linglong|mmc|wmbanner)/
+URL-REGEX,^https?://p\d\.meituan\.net/(mmc|wmbanner)/
+URL-REGEX,^https?://p\d\.meituan\.net/(adunion|display|linglong|mmc|wmbanner)/
 URL-REGEX,^https?://s3plus\.meituan\.net/.+/linglong/
 # >> Meiweibuyongdeng
 URL-REGEX,^https?://capi.mwee.cn/app-api/V12/app/getstartad

File diff suppressed because it is too large
+ 0 - 0
Modules/sukka_mitm_hostnames.sgmodule


Some files were not shown because too many files changed in this diff