mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 19:34:04 +03:00
Added TED.com video downloader
This commit is contained in:
parent
82532aa504
commit
eb0ab45ac8
@ -38,5 +38,6 @@ from .xiami import *
|
|||||||
from .yinyuetai import *
|
from .yinyuetai import *
|
||||||
from .youku import *
|
from .youku import *
|
||||||
from .youtube import *
|
from .youtube import *
|
||||||
|
from .ted import *
|
||||||
|
|
||||||
from .__main__ import *
|
from .__main__ import *
|
||||||
|
@ -59,6 +59,7 @@ def url_to_module(url):
|
|||||||
'youku': youku,
|
'youku': youku,
|
||||||
'youtu': youtube,
|
'youtu': youtube,
|
||||||
'youtube': youtube,
|
'youtube': youtube,
|
||||||
|
'ted': ted,
|
||||||
#TODO
|
#TODO
|
||||||
}
|
}
|
||||||
if k in downloads:
|
if k in downloads:
|
||||||
|
0
src/you_get/downloader/baidu.py
Executable file → Normal file
0
src/you_get/downloader/baidu.py
Executable file → Normal file
24
src/you_get/downloader/ted.py
Normal file
24
src/you_get/downloader/ted.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__all__ = ['ted_download']
|
||||||
|
|
||||||
|
from ..common import *
|
||||||
|
|
||||||
|
def ted_download(url, output_dir = '.', merge = True, info_only = False):
|
||||||
|
page = get_html(url).split("\n")
|
||||||
|
for line in page:
|
||||||
|
if line.find("<title>") > -1:
|
||||||
|
title = line.replace("<title>", "").replace("</title>", "").replace("\t", "")
|
||||||
|
title = title[:title.find(' | ')]
|
||||||
|
if line.find("no-flash-video-download") > -1:
|
||||||
|
url = line.replace('<a id="no-flash-video-download" href="', "").replace(" ", "").replace("\t", "").replace(".mp4", "-480p-en.mp4")
|
||||||
|
url = url[:url.find('"')]
|
||||||
|
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)
|
||||||
|
break
|
||||||
|
|
||||||
|
site_info = "ted.com"
|
||||||
|
download = ted_download
|
||||||
|
download_playlist = playlist_not_supported('ted')
|
Loading…
x
Reference in New Issue
Block a user