kumaneru 5 months ago
parent
commit
67f1e7b867
1 changed files with 1 additions and 1 deletions
  1. 1 1
      ytbchat2ass.py

+ 1 - 1
ytbchat2ass.py

@@ -14,7 +14,7 @@ def sec2hms(sec):  # 时间转换
     return hms
 
 def chat2ass(link, name, delay):
-    pattern = re.compile(r"(.*?)youtube\.com/(?:v/|live/|watch\?(?:.*&)?v=)(?P<video_id>[\w-]{11})")
+    pattern = re.compile(r"(?:.*?)youtube\.com/(?:v/|live/|watch\?(?:.*&)?v=)(?P<video_id>[\w-]{11})")
     vid_match = pattern.split(link)
     vid = [x for x in vid_match if x][0]
     url = f"https://www.youtube.com/watch?v={vid}"