ソースを参照

fix video matching regex

Mike L 3 年 前
コミット
9bc4385e28
2 ファイル変更2 行追加2 行削除
  1. 1 1
      dist/wiki.js
  2. 1 1
      src/wiki.ts

+ 1 - 1
dist/wiki.js

@@ -72,7 +72,7 @@ class default_1 {
                 }
                 logger.warn('unable to find MIME type of fetched media, failing this fetch');
                 throw Error();
-            })((_a = /([^\/]*)\?format=([a-z]+)&/.exec(url)) !== null && _a !== void 0 ? _a : /([^\/]*)\.([^?]+)/.exec(url));
+            })((_a = /([^/]*)\?format=([a-z]+)&/.exec(url)) !== null && _a !== void 0 ? _a : /.*\/([^/]*)\.([^?]+)/.exec(url));
         });
         this.uploadMediaItems = (tweet, fileNamePrefix, indexOffset = 0) => {
             const mediaItems = [];

+ 1 - 1
src/wiki.ts

@@ -85,7 +85,7 @@ export default class {
         }
         logger.warn('unable to find MIME type of fetched media, failing this fetch');
         throw Error();
-      })(/([^\/]*)\?format=([a-z]+)&/.exec(url) ?? /([^\/]*)\.([^?]+)/.exec(url))
+      })(/([^/]*)\?format=([a-z]+)&/.exec(url) ?? /.*\/([^/]*)\.([^?]+)/.exec(url))
     );
 
     private uploadMediaItems = (tweet: Tweet, fileNamePrefix: string, indexOffset = 0) => {