Commit d631b13

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-02-02 01:57:15
fix(ytdlp): disable telegram message link
1 parent cf4b914
Changed files (1)
src/utils.py
@@ -207,6 +207,9 @@ def match_urls(text: str) -> list[str]:
 
 
 def is_supported_by_ytdlp(url: str) -> bool:
+    """Check if this url is supported by ytdlp."""
+    if "t.me" in url:  # tg link
+        return False
     extractors = gen_extractors()
     return any(extractor.suitable(url) for extractor in extractors)
 
@@ -252,3 +255,4 @@ if __name__ == "__main__":
     print(ascii_to_unicode("test"))
     print(match_urls("http://a.com/BmT8gZ 匹配不到就删除了https://b.com/MxRdMO"))
     print(is_supported_by_ytdlp("https://www.bilibili.com/video/BV15n61YtEmk"))
+    print(is_supported_by_ytdlp("https://t.me/c/1744444199/2475260"))