mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 13:35:16 +03:00
Merge branch 'khan' of https://github.com/rumith/you-get into rumith-khan
Conflicts: src/you_get/downloader/__init__.py
This commit is contained in:
commit
cea7560242
@ -39,5 +39,6 @@ from .yinyuetai import *
|
||||
from .youku import *
|
||||
from .youtube import *
|
||||
from .ted import *
|
||||
from .khan import *
|
||||
|
||||
from .__main__ import *
|
||||
|
@ -60,6 +60,7 @@ def url_to_module(url):
|
||||
'youku': youku,
|
||||
'youtu': youtube,
|
||||
'youtube': youtube,
|
||||
'khanacademy': khan,
|
||||
#TODO
|
||||
}
|
||||
if k in downloads:
|
||||
|
15
src/you_get/downloader/khan.py
Executable file
15
src/you_get/downloader/khan.py
Executable 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, output_dir=output_dir, merge=merge, info_only=info_only)
|
||||
|
||||
site_info = "khanacademy.org"
|
||||
download = khan_download
|
||||
download_playlist = playlist_not_supported('khan')
|
Loading…
Reference in New Issue
Block a user