-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support video platform #27
Comments
can use yt-dlp _match_valid_url |
from yt_dlp.extractor import gen_extractor_classes, GenericIE
def is_supported(url):
for ie in gen_extractor_classes():
if ie != GenericIE and ie.suitable(url):
return True
return False
is_supported("https://www.youtube.com/watch?v=i_xBWhJB6VM")
is_supported("https://tv.naver.com/v/31992728/list/67096")
is_supported("https://static1.bigstockphoto.com/thumbs/2/3/2/large2/23261459.jpg") advised by yt-dlp maintainer |
sadly seems to slow, will need something more approximate |
but actually also it seems high recall but low precision |
better idea: collect a bunch of positive and negative links, and build regexes or a very cheap predictor to know which are good |
Best way to do this
|
https://github.com/v2fly/domain-list-community/tree/master/data might be interesting |
limited version for 3 platforms (but which works) : import re
def is_dailymotion_video(url):
if re.match('^https?://www.dailymotion.com/video/.+$', url):
return True
return False
def is_vimeo_video(url):
if re.match('^https?://vimeo.com/[0-9]+$', url):
return True
if re.match('^https?://player.vimeo.com/video/[0-9]+.*$', url):
return True
return False
def is_youtube_video(url):
if re.match('^https?://(www.)?youtube.com/watch\?v=.+$', url):
return True
if re.match('^https?://(www.)?youtube.com/v/.+$', url):
return True
if re.match('^https?://(www.)?youtube.com/embed/.+$', url):
return True
if re.match('^https?://(www.)?youtu.be/.+$', url):
return True
return False |
https://ytdl-org.github.io/youtube-dl/supportedsites.html
The text was updated successfully, but these errors were encountered: