mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 08:43:58 +03:00
[heavymusic] new site support
This commit is contained in:
parent
75798861c2
commit
a52c50e8aa
@ -1034,6 +1034,7 @@ def url_to_module(url):
|
|||||||
freesound,
|
freesound,
|
||||||
funshion,
|
funshion,
|
||||||
google,
|
google,
|
||||||
|
heavymusic,
|
||||||
ifeng,
|
ifeng,
|
||||||
instagram,
|
instagram,
|
||||||
iqilu,
|
iqilu,
|
||||||
@ -1117,6 +1118,7 @@ def url_to_module(url):
|
|||||||
'freesound': freesound,
|
'freesound': freesound,
|
||||||
'fun': funshion,
|
'fun': funshion,
|
||||||
'google': google,
|
'google': google,
|
||||||
|
'heavy-music': heavymusic,
|
||||||
'iask': sina,
|
'iask': sina,
|
||||||
'ifeng': ifeng,
|
'ifeng': ifeng,
|
||||||
'in': alive,
|
'in': alive,
|
||||||
|
@ -20,6 +20,7 @@ from .flickr import *
|
|||||||
from .freesound import *
|
from .freesound import *
|
||||||
from .funshion import *
|
from .funshion import *
|
||||||
from .google import *
|
from .google import *
|
||||||
|
from .heavymusic import *
|
||||||
from .ifeng import *
|
from .ifeng import *
|
||||||
from .instagram import *
|
from .instagram import *
|
||||||
from .iqilu import *
|
from .iqilu import *
|
||||||
|
23
src/you_get/extractors/heavymusic.py
Normal file
23
src/you_get/extractors/heavymusic.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__all__ = ['heavymusic_download']
|
||||||
|
|
||||||
|
from ..common import *
|
||||||
|
|
||||||
|
def heavymusic_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
||||||
|
html = get_html(url)
|
||||||
|
tracks = re.findall(r'href="(online2\.php[^"]+)"', html)
|
||||||
|
for track in tracks:
|
||||||
|
band = r1(r'band=([^&]*)', track)
|
||||||
|
album = r1(r'album=([^&]*)', track)
|
||||||
|
title = r1(r'track=([^&]*)', track)
|
||||||
|
file_url = 'http://www.heavy-music.ru/online2.php?band=%s&album=%s&track=%s' % (parse.quote(band), parse.quote(album), parse.quote(title))
|
||||||
|
_, _, size = url_info(file_url)
|
||||||
|
|
||||||
|
print_info(site_info, title, 'mp3', size)
|
||||||
|
if not info_only:
|
||||||
|
download_urls([file_url], title[:-4], 'mp3', size, output_dir, merge=merge)
|
||||||
|
|
||||||
|
site_info = "heavy-music.ru"
|
||||||
|
download = heavymusic_download
|
||||||
|
download_playlist = heavymusic_download
|
Loading…
Reference in New Issue
Block a user