mirror of
https://github.com/soimort/you-get.git
synced 2025-02-09 03:37:52 +03:00
Merge branch 'feature/magisto-support' into develop
This commit is contained in:
commit
050b8a577d
@ -21,6 +21,7 @@ from .joy import *
|
|||||||
from .jpopsuki import *
|
from .jpopsuki import *
|
||||||
from .ku6 import *
|
from .ku6 import *
|
||||||
from .letv import *
|
from .letv import *
|
||||||
|
from .magisto import *
|
||||||
from .miomio import *
|
from .miomio import *
|
||||||
from .mixcloud import *
|
from .mixcloud import *
|
||||||
from .netease import *
|
from .netease import *
|
||||||
|
@ -41,6 +41,7 @@ def url_to_module(url):
|
|||||||
'kankanews': bilibili,
|
'kankanews': bilibili,
|
||||||
'ku6': ku6,
|
'ku6': ku6,
|
||||||
'letv': letv,
|
'letv': letv,
|
||||||
|
'magisto': magisto,
|
||||||
'miomio': miomio,
|
'miomio': miomio,
|
||||||
'mixcloud': mixcloud,
|
'mixcloud': mixcloud,
|
||||||
'nicovideo': nicovideo,
|
'nicovideo': nicovideo,
|
||||||
|
22
src/you_get/extractor/magisto.py
Normal file
22
src/you_get/extractor/magisto.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__all__ = ['magisto_download']
|
||||||
|
|
||||||
|
from ..common import *
|
||||||
|
|
||||||
|
def magisto_download(url, output_dir='.', merge=True, info_only=False):
|
||||||
|
html = get_html(url)
|
||||||
|
|
||||||
|
title1 = r1(r'<meta name="twitter:title" content="([^"]*)"', html)
|
||||||
|
title2 = r1(r'<meta name="twitter:description" content="([^"]*)"', html)
|
||||||
|
title = "%s %s" % (title1, title2)
|
||||||
|
url = r1(r'<source type="[^"]+" src="([^"]*)"', html)
|
||||||
|
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 = "Magisto.com"
|
||||||
|
download = magisto_download
|
||||||
|
download_playlist = playlist_not_supported('magisto')
|
@ -17,6 +17,11 @@ class YouGetTests(unittest.TestCase):
|
|||||||
"http://www.freesound.org/people/Corsica_S/sounds/184419/",
|
"http://www.freesound.org/people/Corsica_S/sounds/184419/",
|
||||||
])
|
])
|
||||||
|
|
||||||
|
def test_magisto(self):
|
||||||
|
test_urls([
|
||||||
|
"http://www.magisto.com/album/video/f3x9AAQORAkfDnIFDA",
|
||||||
|
])
|
||||||
|
|
||||||
def test_mixcloud(self):
|
def test_mixcloud(self):
|
||||||
test_urls([
|
test_urls([
|
||||||
"http://www.mixcloud.com/beatbopz/beat-bopz-disco-mix/",
|
"http://www.mixcloud.com/beatbopz/beat-bopz-disco-mix/",
|
||||||
|
Loading…
Reference in New Issue
Block a user