Skip to content

Commit

Permalink
Merge pull request soimort#1147 from jmargeta/EmbeddedVimeoSupport
Browse files Browse the repository at this point in the history
[Vimeo]Support for embedded Vimeo videos
  • Loading branch information
cnbeining committed May 19, 2016
2 parents 5e42827 + e6af1c6 commit c2eed05
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/you_get/extractors/embed.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .qq import qq_download_by_vid
from .sina import sina_download_by_vid
from .tudou import tudou_download_by_id
from .vimeo import vimeo_download_by_id
from .yinyuetai import yinyuetai_download_by_id
from .youku import youku_download_by_vid

Expand Down Expand Up @@ -39,6 +40,9 @@

netease_embed_patterns = [ '(http://\w+\.163\.com/movie/[^\'"]+)' ]

vimeo_embed_patters = [ 'player\.vimeo\.com/video/(\d+)' ]


def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwargs):
content = get_content(url, headers=fake_headers)
found = False
Expand Down Expand Up @@ -69,6 +73,11 @@ def embed_download(url, output_dir = '.', merge = True, info_only = False ,**kwa
found = True
netease_download(url, title=title, output_dir=output_dir, merge=merge, info_only=info_only)

urls = matchall(content, vimeo_embed_patters)
for url in urls:
found = True
vimeo_download_by_id(url, title=title, output_dir=output_dir, merge=merge, info_only=info_only)

if not found:
raise NotImplementedError(url)

Expand Down

0 comments on commit c2eed05

Please sign in to comment.