Browse Source

fix: bilibili id regex

close #1779
Tienson Qin 4 years ago
parent
commit
0ebb1629b7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/main/frontend/components/block.cljs

+ 2 - 1
src/main/frontend/components/block.cljs

@@ -865,11 +865,12 @@
         ;; TODO: support fullscreen mode, maybe we need a fullscreen dialog?
         (= name "bilibili")
         (when-let [url (first arguments)]
-          (let [id-regex #"https?://www\.bilibili\.com/video/([\w\W]+)"]
+          (let [id-regex #"https?://www\.bilibili\.com/video/([^? ]+)"]
             (when-let [id (cond
                             (<= (count url) 15) url
                             :else
                             (last (re-find id-regex url)))]
+              (prn {:id id})
               (when-not (string/blank? id)
                 (let [width (min (- (util/get-width) 96)
                                  560)