Tests for suitable URLs for tikwm

This commit is contained in:
Patrick Robertson
2025-03-18 09:59:59 +00:00
parent 8ec053ed1b
commit 89e387030d
4 changed files with 31 additions and 3 deletions

View File

@@ -75,6 +75,8 @@ class GenericExtractor(Extractor):
dropin: GenericDropin = self.dropin_for_name(info_extractor.ie_key())
if dropin and dropin.suitable(url, info_extractor):
yield info_extractor
elif info_extractor.suitable(url):
yield info_extractor
def suitable(self, url: str) -> bool:
"""

View File

@@ -16,7 +16,7 @@ class Tiktok(GenericDropin):
TIKWM_ENDPOINT = "https://www.tikwm.com/api/?url={url}"
def suitable(self, url, info_extractor):
def suitable(self, url, info_extractor) -> bool:
"""This dropin (which uses Tikvm) is suitable for *all* Tiktok type URLs - videos, lives, VMs, and users.
Return the 'suitable' method from the TikTokIE class."""
return any(extractor().suitable(url) for extractor in (TikTokIE, TikTokLiveIE, TikTokVMIE, TikTokUserIE))