mirror of
https://github.com/soimort/you-get.git
synced 2025-02-10 12:12:26 +03:00
Merge branch 'addehow' of https://github.com/greatdg/you-get into greatdg-addehow
This commit is contained in:
commit
4e804de7fe
@ -9,6 +9,7 @@ from .cntv import *
|
|||||||
from .coursera import *
|
from .coursera import *
|
||||||
from .dailymotion import *
|
from .dailymotion import *
|
||||||
from .douban import *
|
from .douban import *
|
||||||
|
from .ehow import *
|
||||||
from .facebook import *
|
from .facebook import *
|
||||||
from .fivesing import *
|
from .fivesing import *
|
||||||
from .freesound import *
|
from .freesound import *
|
||||||
|
@ -28,6 +28,7 @@ def url_to_module(url):
|
|||||||
'coursera': coursera,
|
'coursera': coursera,
|
||||||
'dailymotion': dailymotion,
|
'dailymotion': dailymotion,
|
||||||
'douban': douban,
|
'douban': douban,
|
||||||
|
'ehow': ehow,
|
||||||
'facebook': facebook,
|
'facebook': facebook,
|
||||||
'freesound': freesound,
|
'freesound': freesound,
|
||||||
'google': google,
|
'google': google,
|
||||||
|
38
src/you_get/downloader/ehow.py
Normal file
38
src/you_get/downloader/ehow.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__all__ = ['ehow_download']
|
||||||
|
|
||||||
|
from ..common import *
|
||||||
|
|
||||||
|
def ehow_download(url, output_dir = '.', merge = True, info_only = False):
|
||||||
|
|
||||||
|
assert re.search(r'http://www.ehow.com/video_', url), "URL you entered is not supported"
|
||||||
|
|
||||||
|
html = get_html(url)
|
||||||
|
contentid = r1(r'<meta name="contentid" scheme="DMINSTR2" content="([^"]+)" />', html)
|
||||||
|
vid = r1(r'"demand_ehow_videoid":"([^"]+)"', html)
|
||||||
|
assert vid
|
||||||
|
|
||||||
|
xml = get_html('http://www.ehow.com/services/video/series.xml?demand_ehow_videoid=%s' % vid)
|
||||||
|
|
||||||
|
from xml.dom.minidom import parseString
|
||||||
|
doc = parseString(xml)
|
||||||
|
tab = doc.getElementsByTagName('related')[0].firstChild
|
||||||
|
|
||||||
|
for video in tab.childNodes:
|
||||||
|
if re.search(contentid, video.attributes['link'].value):
|
||||||
|
url = video.attributes['flv'].value
|
||||||
|
break
|
||||||
|
|
||||||
|
title = video.attributes['title'].value
|
||||||
|
assert title
|
||||||
|
|
||||||
|
type, ext, size = url_info(url)
|
||||||
|
print_info(site_info, title, type, size)
|
||||||
|
|
||||||
|
if not info_only:
|
||||||
|
download_urls([url], title, ext, size, output_dir, merge = merge)
|
||||||
|
|
||||||
|
site_info = "ehow.com"
|
||||||
|
download = ehow_download
|
||||||
|
download_playlist = playlist_not_supported('ehow')
|
Loading…
Reference in New Issue
Block a user