Skip to content

Commit

Permalink
[embed] support embedded yinyuetai patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
soimort committed Nov 11, 2015
1 parent 4d8e6e5 commit ee06e3a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/you_get/extractors/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from .qq import qq_download_by_vid
from .sina import sina_download_by_vid
from .tudou import tudou_download_by_id
from .yinyuetai import yinyuetai_download_by_id
from .youku import youku_download_by_vid

"""
Expand All @@ -30,6 +31,8 @@
"""
tudou_api_patterns = [ ]

yinyuetai_embed_patterns = [ 'player\.yinyuetai\.com/video/swf/(\d+)' ]

def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwargs):
content = get_content(url)
found = False
Expand All @@ -44,6 +47,11 @@ def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwa
found = True
tudou_download_by_id(vid, title=title, output_dir=output_dir, merge=merge, info_only=info_only)

vids = matchall(content, yinyuetai_embed_patterns)
for vid in vids:
found = True
yinyuetai_download_by_id(vid, title=title, output_dir=output_dir, merge=merge, info_only=info_only)

if not found:
raise NotImplementedError(url)

Expand Down

0 comments on commit ee06e3a

Please sign in to comment.