Added Khan Academy support (videos downloaded from YouTube)

This commit is contained in:
David Parunakian 2013-08-08 20:10:21 +04:00
parent eb0ab45ac8
commit 07a698887a
3 changed files with 17 additions and 0 deletions

View File

@ -39,5 +39,6 @@ from .yinyuetai import *
from .youku import *
from .youtube import *
from .ted import *
from .khan import *
from .__main__ import *

View File

@ -60,6 +60,7 @@ def url_to_module(url):
'youtu': youtube,
'youtube': youtube,
'ted': ted,
'khanacademy': khan,
#TODO
}
if k in downloads:

View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
__all__ = ['khan_download']
from ..common import *
from .youtube import youtube_download_by_id
def khan_download(url, output_dir = '.', merge = True, info_only = False):
page = get_html(url)
id = page[page.find('src="https://www.youtube.com/embed/') + len('src="https://www.youtube.com/embed/') :page.find('?enablejsapi=1&wmode=transparent&modestbranding=1&rel=0&fs=1&showinfo=0')]
youtube_download_by_id(id)
site_info = "khanacademy.org"
download = khan_download
download_playlist = playlist_not_supported('khan')