From a534c11e947be993dd8e44a30cb83467376ade96 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Mon, 11 Sep 2017 13:23:02 +0200 Subject: [PATCH] [embed] add dailymotion patterns --- src/you_get/extractors/embed.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/you_get/extractors/embed.py b/src/you_get/extractors/embed.py index eb758431..8b1c4555 100644 --- a/src/you_get/extractors/embed.py +++ b/src/you_get/extractors/embed.py @@ -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