[embed] add dailymotion patterns

This commit is contained in:
Mort Yao 2017-09-11 13:23:02 +02:00
parent 251857407b
commit a534c11e94
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -5,6 +5,7 @@ import urllib.parse
from ..common import *
from .bilibili import bilibili_download
from .dailymotion import dailymotion_download
from .iqiyi import iqiyi_download_by_vid
from .le import letvcloud_download_by_vu
from .netease import netease_download
@ -47,6 +48,8 @@ netease_embed_patterns = [ '(http://\w+\.163\.com/movie/[^\'"]+)' ]
vimeo_embed_patters = [ 'player\.vimeo\.com/video/(\d+)' ]
dailymotion_embed_patterns = [ 'www\.dailymotion\.com/embed/video/(\w+)' ]
"""
check the share button on http://www.bilibili.com/video/av5079467/
"""
@ -99,6 +102,11 @@ def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwa
found = True
vimeo_download_by_id(url, title=title, output_dir=output_dir, merge=merge, info_only=info_only, referer=url)
urls = matchall(content, dailymotion_embed_patterns)
for url in urls:
found = True
dailymotion_download(url, title=title, output_dir=output_dir, merge=merge, info_only=info_only)
aids = matchall(content, bilibili_embed_patterns)
for aid in aids:
found = True