musicdl 2.1.11__py3-none-any.whl → 2.7.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- musicdl/__init__.py +5 -5
- musicdl/modules/__init__.py +10 -3
- musicdl/modules/common/__init__.py +2 -0
- musicdl/modules/common/gdstudio.py +204 -0
- musicdl/modules/js/__init__.py +1 -0
- musicdl/modules/js/youtube/__init__.py +2 -0
- musicdl/modules/js/youtube/botguard.js +1 -0
- musicdl/modules/js/youtube/jsinterp.py +902 -0
- musicdl/modules/js/youtube/runner.js +2 -0
- musicdl/modules/sources/__init__.py +41 -10
- musicdl/modules/sources/apple.py +207 -0
- musicdl/modules/sources/base.py +256 -28
- musicdl/modules/sources/bilibili.py +118 -0
- musicdl/modules/sources/buguyy.py +148 -0
- musicdl/modules/sources/fangpi.py +153 -0
- musicdl/modules/sources/fivesing.py +108 -0
- musicdl/modules/sources/gequbao.py +148 -0
- musicdl/modules/sources/jamendo.py +108 -0
- musicdl/modules/sources/joox.py +104 -68
- musicdl/modules/sources/kugou.py +129 -76
- musicdl/modules/sources/kuwo.py +188 -68
- musicdl/modules/sources/lizhi.py +107 -0
- musicdl/modules/sources/migu.py +172 -66
- musicdl/modules/sources/mitu.py +140 -0
- musicdl/modules/sources/mp3juice.py +264 -0
- musicdl/modules/sources/netease.py +163 -115
- musicdl/modules/sources/qianqian.py +125 -77
- musicdl/modules/sources/qq.py +232 -94
- musicdl/modules/sources/tidal.py +342 -0
- musicdl/modules/sources/ximalaya.py +256 -0
- musicdl/modules/sources/yinyuedao.py +144 -0
- musicdl/modules/sources/youtube.py +238 -0
- musicdl/modules/utils/__init__.py +12 -4
- musicdl/modules/utils/appleutils.py +563 -0
- musicdl/modules/utils/data.py +107 -0
- musicdl/modules/utils/logger.py +211 -58
- musicdl/modules/utils/lyric.py +73 -0
- musicdl/modules/utils/misc.py +335 -23
- musicdl/modules/utils/modulebuilder.py +75 -0
- musicdl/modules/utils/neteaseutils.py +81 -0
- musicdl/modules/utils/qqutils.py +184 -0
- musicdl/modules/utils/quarkparser.py +105 -0
- musicdl/modules/utils/songinfoutils.py +54 -0
- musicdl/modules/utils/tidalutils.py +738 -0
- musicdl/modules/utils/youtubeutils.py +3606 -0
- musicdl/musicdl.py +184 -86
- musicdl-2.7.3.dist-info/LICENSE +203 -0
- musicdl-2.7.3.dist-info/METADATA +704 -0
- musicdl-2.7.3.dist-info/RECORD +53 -0
- {musicdl-2.1.11.dist-info → musicdl-2.7.3.dist-info}/WHEEL +5 -5
- musicdl-2.7.3.dist-info/entry_points.txt +2 -0
- musicdl/modules/sources/baiduFlac.py +0 -69
- musicdl/modules/sources/xiami.py +0 -104
- musicdl/modules/utils/downloader.py +0 -80
- musicdl-2.1.11.dist-info/LICENSE +0 -22
- musicdl-2.1.11.dist-info/METADATA +0 -82
- musicdl-2.1.11.dist-info/RECORD +0 -24
- {musicdl-2.1.11.dist-info → musicdl-2.7.3.dist-info}/top_level.txt +0 -0
- {musicdl-2.1.11.dist-info → musicdl-2.7.3.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
musicdl/__init__.py,sha256=3i8-vqzGirFms_Jk-IeZh42w_uSlo5tWesePmVLIlqg,454
|
|
2
|
+
musicdl/musicdl.py,sha256=tpGPiwMhzVGDh0Kr-pdUSbIRmV4kQ9HTcwF98Byst0U,11586
|
|
3
|
+
musicdl/modules/__init__.py,sha256=K3pJ0vg7ImP7_9b7Y5aNGeDukhZR_84SYmoA1vn5Gbc,574
|
|
4
|
+
musicdl/modules/common/__init__.py,sha256=_5fb2aiJRoeopQfxlOOVdogzggiz514rtwGDzZ8Z1z4,59
|
|
5
|
+
musicdl/modules/common/gdstudio.py,sha256=_MyujKZOJ07_cv886dY2W8Cmv0GuLTEJYds_MaT6d3Y,12951
|
|
6
|
+
musicdl/modules/js/__init__.py,sha256=tsahs_aOJlKX9yqHwxK1ap-HjYCmXdESy4hRe1JJFUc,16
|
|
7
|
+
musicdl/modules/js/youtube/__init__.py,sha256=D9B9zGbS_aDm3Il2hB0HjlLhLJ5ZBgRCHV2n6V78z6E,79
|
|
8
|
+
musicdl/modules/js/youtube/botguard.js,sha256=mxqV1d9-HRivLOvk_8RtU7cCF8B9ncvfmByeYOA3xwU,2745196
|
|
9
|
+
musicdl/modules/js/youtube/jsinterp.py,sha256=L2HlZMn5LdyBXnTq5TzYTzaEW3GTBIQL0HiQOyqUfX8,42949
|
|
10
|
+
musicdl/modules/js/youtube/runner.js,sha256=N3d8f0OhewmbswiwvwiJDCwfxE1ErdpEy1SlB0QA3WE,2837148
|
|
11
|
+
musicdl/modules/sources/__init__.py,sha256=wbzKRE0kcjUcroIHCHCdWfrTQfGS9X_zJ0alCMzmHIo,2079
|
|
12
|
+
musicdl/modules/sources/apple.py,sha256=qBsG053CuUWykPodlcn9L4Wk5NthPPcyZCdbqhGFsBU,14141
|
|
13
|
+
musicdl/modules/sources/base.py,sha256=ve5HXyal_UnWxzhJfEEZf-YBADZ-ofGZ9F_rttm218w,15608
|
|
14
|
+
musicdl/modules/sources/bilibili.py,sha256=ENiZZTbnRaAas_aZcUVI_y1haqtqWmj2t-n2csM6bHs,8529
|
|
15
|
+
musicdl/modules/sources/buguyy.py,sha256=ZjHLux1TBALLpNfcZ6dhnRQSGoKjQMC4AKKtgNHLrR0,8724
|
|
16
|
+
musicdl/modules/sources/fangpi.py,sha256=b7HLNpKXRzzAFyRIY6fHTy6PYEpT9daHrEfwtMjgDBY,9133
|
|
17
|
+
musicdl/modules/sources/fivesing.py,sha256=kS-R25CnfT5ng4Usj_9FN9SKOWyYEYmTQwDA46YSyL8,5992
|
|
18
|
+
musicdl/modules/sources/gequbao.py,sha256=6eeYr-XzdGpNZHmerkU03eAN0eLyPP5C5XMNvOtyuf0,8922
|
|
19
|
+
musicdl/modules/sources/jamendo.py,sha256=Ty7Ia_yPGW1-kDtP3V1lDLwiKzuoIwrHdclCzsS8274,6083
|
|
20
|
+
musicdl/modules/sources/joox.py,sha256=JQOxqcaYP20OV7k7zQfZFqcDmcVhkM8eCGoPmd-RNRM,6649
|
|
21
|
+
musicdl/modules/sources/kugou.py,sha256=GCIglmRySoD5yg_jlm0jSN_wir473IU2sBijxIljGo4,8274
|
|
22
|
+
musicdl/modules/sources/kuwo.py,sha256=leWDzM_Chr-x7PqOg5jGP3P_h9HZV1dGDqoanc68Fvs,13052
|
|
23
|
+
musicdl/modules/sources/lizhi.py,sha256=CnGHt2KxhhEBU7F9H_ujozEnaaUuvXotvF-rJIi_m5E,6022
|
|
24
|
+
musicdl/modules/sources/migu.py,sha256=4-NFbjOP3rRb7QCxtIG1rJic-5mSe5m8JEk2RH8HwkQ,11049
|
|
25
|
+
musicdl/modules/sources/mitu.py,sha256=WWJhtssZLEHPHim_F-bV4VehfIHTqv_1Xu690he75Wo,8192
|
|
26
|
+
musicdl/modules/sources/mp3juice.py,sha256=rrNo7cfjJ6qidWQU-TijZpAftP3C0MrrFM0IFt8Hs_M,14645
|
|
27
|
+
musicdl/modules/sources/netease.py,sha256=BmbCbMGE16eNKkNsFVywWiqEUEKjq3KjQnwZSLr6m4k,10660
|
|
28
|
+
musicdl/modules/sources/qianqian.py,sha256=WHcVUwDd8zXVQ0qGxa0s70He5yv9vm45LFe4jeSOOJ4,7474
|
|
29
|
+
musicdl/modules/sources/qq.py,sha256=eJhU7vmS2DenxAq0XGBXkGuyvbU6X3nAhmiM1l__iNI,16559
|
|
30
|
+
musicdl/modules/sources/tidal.py,sha256=k2ieHqlcmRs2XyrTliEPlxUlhbFO4Xen-aXalIz_Wok,18424
|
|
31
|
+
musicdl/modules/sources/ximalaya.py,sha256=9zj_l5lyQ4Is_f_mLbTFVu6IwI6VHGHf2a4wTOqUa-s,15728
|
|
32
|
+
musicdl/modules/sources/yinyuedao.py,sha256=2pTfjuPe3O1s63zqyQmeJU4ATDY7yJPJHrm3GrZp9gc,8732
|
|
33
|
+
musicdl/modules/sources/youtube.py,sha256=bpBw3g3JAGbs7HTgPikvcLB2zc-98iDrT48Vis8aOUk,15410
|
|
34
|
+
musicdl/modules/utils/__init__.py,sha256=sBD-F9hXI3OX59r03XemVdwOXHyTzSiR9joas4rCWP8,632
|
|
35
|
+
musicdl/modules/utils/appleutils.py,sha256=cGoLzzPoL4mLX9BDXbBrJ4vHvZF79nITUmatSSkNATA,32841
|
|
36
|
+
musicdl/modules/utils/data.py,sha256=FPwXo2y3uQzHbnStN5dHBrCNncQPVSQ6zPH8BJo3lzY,4081
|
|
37
|
+
musicdl/modules/utils/logger.py,sha256=rUSeplEecXvJivjKSmUdrSyyWs_hEMSO6IfrA7bs5f0,7326
|
|
38
|
+
musicdl/modules/utils/lyric.py,sha256=2SgMTyPydJg57GxMJTbIUqYlxzRdcFUKMBEziOFyjV0,4093
|
|
39
|
+
musicdl/modules/utils/misc.py,sha256=WXKjoQTFGvfjeoWRiWW4FPO1sxm6msm3Dza3HfMY9vs,14218
|
|
40
|
+
musicdl/modules/utils/modulebuilder.py,sha256=vTCusunzgJ-unjLgLYrcuMxFFXfth369WiPV24p2hlA,2663
|
|
41
|
+
musicdl/modules/utils/neteaseutils.py,sha256=HT_PWE40Xj4WGOF3pI84g2JbhwCNBQCRivFafxkQJtI,3483
|
|
42
|
+
musicdl/modules/utils/qqutils.py,sha256=MvZmOZxpoC-iRzEQS_u-UJeHGOHhcmV9rIajs02lwlU,8709
|
|
43
|
+
musicdl/modules/utils/quarkparser.py,sha256=UybYWB8lnZv9ZqeOMi_APHsy-ltQdCCPD2XRiVmxGyE,6035
|
|
44
|
+
musicdl/modules/utils/songinfoutils.py,sha256=-Ws6EeCS6hUotWVmu-ZOSYbP7-G1xcFPTdntE7gj_d0,2082
|
|
45
|
+
musicdl/modules/utils/tidalutils.py,sha256=QElLZKejvBHknQ4QjMRcz_AmhSAscnbVRH92Q787IiY,26612
|
|
46
|
+
musicdl/modules/utils/youtubeutils.py,sha256=DtP_EIzjPwk1hFJDRnV-LA1Qz5z9Q0CVhB9kxnhpU0E,176081
|
|
47
|
+
musicdl-2.7.3.dist-info/LICENSE,sha256=gJTCSLScqpLFxo7Y4v6CIgYxW03ZBBoL_3-wN15eMOc,11611
|
|
48
|
+
musicdl-2.7.3.dist-info/METADATA,sha256=1XVk8HfbUIKAMdhyA7cg2NHbnRfsB1Gpz-XGjjLzMKo,41749
|
|
49
|
+
musicdl-2.7.3.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
|
50
|
+
musicdl-2.7.3.dist-info/entry_points.txt,sha256=Ix6aMgaRSx16Aj8R8avsw7ko5t31sg8t0L5zgJVjczE,59
|
|
51
|
+
musicdl-2.7.3.dist-info/top_level.txt,sha256=HOD_b1JeusbPJ3NHxGn2Qba9GWiMc7zQTsyz44fedkA,8
|
|
52
|
+
musicdl-2.7.3.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
53
|
+
musicdl-2.7.3.dist-info/RECORD,,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Wheel-Version: 1.0
|
|
2
|
-
Generator:
|
|
3
|
-
Root-Is-Purelib: true
|
|
4
|
-
Tag: py3-none-any
|
|
5
|
-
|
|
1
|
+
Wheel-Version: 1.0
|
|
2
|
+
Generator: setuptools (72.1.0)
|
|
3
|
+
Root-Is-Purelib: true
|
|
4
|
+
Tag: py3-none-any
|
|
5
|
+
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
'''
|
|
2
|
-
Function:
|
|
3
|
-
百度无损音乐下载: http://music.baidu.com/
|
|
4
|
-
Author:
|
|
5
|
-
Charles
|
|
6
|
-
微信公众号:
|
|
7
|
-
Charles的皮卡丘
|
|
8
|
-
'''
|
|
9
|
-
import requests
|
|
10
|
-
from .base import Base
|
|
11
|
-
from ..utils.misc import *
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'''百度无损音乐下载类'''
|
|
15
|
-
class baiduFlac(Base):
|
|
16
|
-
def __init__(self, config, logger_handle, **kwargs):
|
|
17
|
-
super(baiduFlac, self).__init__(config, logger_handle, **kwargs)
|
|
18
|
-
self.source = 'baiduFlac'
|
|
19
|
-
self.__initialize()
|
|
20
|
-
'''歌曲搜索'''
|
|
21
|
-
def search(self, keyword):
|
|
22
|
-
self.logger_handle.info('正在%s中搜索 ——> %s...' % (self.source, keyword))
|
|
23
|
-
cfg = self.config.copy()
|
|
24
|
-
params = {
|
|
25
|
-
'query': keyword,
|
|
26
|
-
'method': 'baidu.ting.search.common',
|
|
27
|
-
'format': 'json',
|
|
28
|
-
'page_no': '1',
|
|
29
|
-
'page_size': cfg['search_size_per_source']
|
|
30
|
-
}
|
|
31
|
-
response = self.session.get(self.search_url, headers=self.headers, params=params)
|
|
32
|
-
all_items = response.json()['song_list']
|
|
33
|
-
songinfos = []
|
|
34
|
-
for item in all_items:
|
|
35
|
-
params = {
|
|
36
|
-
'songIds': str(item['song_id']),
|
|
37
|
-
'type': 'flac'
|
|
38
|
-
}
|
|
39
|
-
response = self.session.get(self.fmlink_url, headers=self.headers, params=params)
|
|
40
|
-
response_json = response.json()
|
|
41
|
-
if response_json.get('errorCode') != 22000: continue
|
|
42
|
-
download_url = response_json['data']['songList'][0]['songLink']
|
|
43
|
-
if not download_url: continue
|
|
44
|
-
filesize = str(round(int(response_json['data']['songList'][0]['size'])/1024/1024, 2)) + 'MB'
|
|
45
|
-
ext = response_json['data']['songList'][0]['format']
|
|
46
|
-
duration = int(response_json['data']['songList'][0]['time'])
|
|
47
|
-
songinfo = {
|
|
48
|
-
'source': self.source,
|
|
49
|
-
'songid': str(item['song_id']),
|
|
50
|
-
'singers': filterBadCharacter(item.get('author', '-')),
|
|
51
|
-
'album': filterBadCharacter(item.get('album_title', '-')),
|
|
52
|
-
'songname': filterBadCharacter(item.get('title', '-')).split('–')[0].strip(),
|
|
53
|
-
'savedir': cfg['savedir'],
|
|
54
|
-
'savename': '_'.join([self.source, filterBadCharacter(item.get('title', '-')).split('–')[0].strip()]),
|
|
55
|
-
'download_url': download_url,
|
|
56
|
-
'filesize': filesize,
|
|
57
|
-
'ext': ext,
|
|
58
|
-
'duration': seconds2hms(duration)
|
|
59
|
-
}
|
|
60
|
-
songinfos.append(songinfo)
|
|
61
|
-
return songinfos
|
|
62
|
-
'''初始化'''
|
|
63
|
-
def __initialize(self):
|
|
64
|
-
self.headers = {
|
|
65
|
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36',
|
|
66
|
-
'Referer': 'http://music.baidu.com/'
|
|
67
|
-
}
|
|
68
|
-
self.search_url = 'http://musicapi.qianqian.com/v1/restserver/ting'
|
|
69
|
-
self.fmlink_url = 'http://music.qianqian.com/data/music/fmlink'
|
musicdl/modules/sources/xiami.py
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
'''
|
|
2
|
-
Function:
|
|
3
|
-
虾米音乐下载: https://www.xiami.com/
|
|
4
|
-
Author:
|
|
5
|
-
Charles
|
|
6
|
-
微信公众号:
|
|
7
|
-
Charles的皮卡丘
|
|
8
|
-
'''
|
|
9
|
-
import re
|
|
10
|
-
import time
|
|
11
|
-
import json
|
|
12
|
-
import requests
|
|
13
|
-
from .base import Base
|
|
14
|
-
from hashlib import md5
|
|
15
|
-
from ..utils.misc import *
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
'''虾米音乐下载类'''
|
|
19
|
-
class xiami(Base):
|
|
20
|
-
def __init__(self, config, logger_handle, **kwargs):
|
|
21
|
-
super(xiami, self).__init__(config, logger_handle, **kwargs)
|
|
22
|
-
self.source = 'xiami'
|
|
23
|
-
self.__initialize()
|
|
24
|
-
'''歌曲搜索'''
|
|
25
|
-
def search(self, keyword):
|
|
26
|
-
self.logger_handle.info('正在%s中搜索 ——> %s...' % (self.source, keyword))
|
|
27
|
-
cfg = self.config.copy()
|
|
28
|
-
token = self.__getToken()
|
|
29
|
-
search_url = self.base_url.format(action=self.actions['searchsongs'])
|
|
30
|
-
params = {
|
|
31
|
-
'key': keyword,
|
|
32
|
-
'pagingVO': {'page': '1', 'pageSize': str(cfg['search_size_per_source'])}
|
|
33
|
-
}
|
|
34
|
-
response = self.session.get(search_url, headers=self.headers, params=self.__xiamiSign(params, token))
|
|
35
|
-
all_items = response.json()['data']['data']['songs']
|
|
36
|
-
songinfos = []
|
|
37
|
-
for item in all_items:
|
|
38
|
-
download_url = ''
|
|
39
|
-
for file in item['listenFiles']:
|
|
40
|
-
if not file['downloadFileSize']: continue
|
|
41
|
-
filesize = str(round(int(file['downloadFileSize'])/1024/1024, 2)) + 'MB'
|
|
42
|
-
download_url = file['listenFile']
|
|
43
|
-
ext = file['format']
|
|
44
|
-
duration = int(file.get('length', 0)) / 1000
|
|
45
|
-
break
|
|
46
|
-
if not download_url: continue
|
|
47
|
-
songinfo = {
|
|
48
|
-
'source': self.source,
|
|
49
|
-
'songid': str(item['songId']),
|
|
50
|
-
'singers': filterBadCharacter(item.get('artistName', '-')),
|
|
51
|
-
'album': filterBadCharacter(item.get('albumName', '-')),
|
|
52
|
-
'songname': filterBadCharacter(item.get('songName', '-')).split('–')[0].strip(),
|
|
53
|
-
'savedir': cfg['savedir'],
|
|
54
|
-
'savename': '_'.join([self.source, filterBadCharacter(item.get('songName', '-')).split('–')[0].strip()]),
|
|
55
|
-
'download_url': download_url,
|
|
56
|
-
'filesize': filesize,
|
|
57
|
-
'ext': ext,
|
|
58
|
-
'duration': seconds2hms(duration)
|
|
59
|
-
}
|
|
60
|
-
songinfos.append(songinfo)
|
|
61
|
-
return songinfos
|
|
62
|
-
'''虾米签名'''
|
|
63
|
-
def __xiamiSign(self, params, token=''):
|
|
64
|
-
appkey = '23649156'
|
|
65
|
-
t = str(int(time.time() * 1000))
|
|
66
|
-
request_str = {
|
|
67
|
-
'header': {'appId': '200', 'platformId': 'h5'},
|
|
68
|
-
'model': params
|
|
69
|
-
}
|
|
70
|
-
data = json.dumps({'requestStr': json.dumps(request_str)})
|
|
71
|
-
sign = '%s&%s&%s&%s' % (token, t, appkey, data)
|
|
72
|
-
sign = md5(sign.encode('utf-8')).hexdigest()
|
|
73
|
-
params = {
|
|
74
|
-
't': t,
|
|
75
|
-
'appKey': appkey,
|
|
76
|
-
'sign': sign,
|
|
77
|
-
'data': data
|
|
78
|
-
}
|
|
79
|
-
return params
|
|
80
|
-
'''获得请求所需的token'''
|
|
81
|
-
def __getToken(self):
|
|
82
|
-
action = self.actions['getsongdetail']
|
|
83
|
-
url = self.base_url.format(action=action)
|
|
84
|
-
params = {'songId': '1'}
|
|
85
|
-
response = self.session.get(url, params=self.__xiamiSign(params))
|
|
86
|
-
cookies = response.cookies.get_dict()
|
|
87
|
-
return cookies['_m_h5_tk'].split('_')[0]
|
|
88
|
-
'''初始化'''
|
|
89
|
-
def __initialize(self):
|
|
90
|
-
self.headers = {
|
|
91
|
-
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36',
|
|
92
|
-
'Referer': 'http://h.xiami.com',
|
|
93
|
-
'Connection': 'keep-alive',
|
|
94
|
-
'Accept-Language': 'zh-CN,zh;q=0.8,gl;q=0.6,zh-TW;q=0.4',
|
|
95
|
-
'Accept-Encoding': 'gzip,deflate,sdch',
|
|
96
|
-
'Accept': '*/*'
|
|
97
|
-
}
|
|
98
|
-
self.base_url = 'https://acs.m.xiami.com/h5/{action}/1.0/'
|
|
99
|
-
self.actions = {
|
|
100
|
-
'searchsongs': 'mtop.alimusic.search.searchservice.searchsongs',
|
|
101
|
-
'getsongdetail': 'mtop.alimusic.music.songservice.getsongdetail',
|
|
102
|
-
'getsongs': 'mtop.alimusic.music.songservice.getsongs',
|
|
103
|
-
'getsonglyrics': 'mtop.alimusic.music.lyricservice.getsonglyrics'
|
|
104
|
-
}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
'''
|
|
2
|
-
Function:
|
|
3
|
-
下载器类
|
|
4
|
-
Author:
|
|
5
|
-
Charles
|
|
6
|
-
微信公众号:
|
|
7
|
-
Charles的皮卡丘
|
|
8
|
-
'''
|
|
9
|
-
import click
|
|
10
|
-
import warnings
|
|
11
|
-
import requests
|
|
12
|
-
from .misc import *
|
|
13
|
-
from contextlib import closing
|
|
14
|
-
warnings.filterwarnings('ignore')
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'''下载器类'''
|
|
18
|
-
class Downloader():
|
|
19
|
-
def __init__(self, songinfo, session=None, **kwargs):
|
|
20
|
-
self.songinfo = songinfo
|
|
21
|
-
self.session = requests.Session() if session is None else session
|
|
22
|
-
self.__setheaders(songinfo['source'])
|
|
23
|
-
'''外部调用'''
|
|
24
|
-
def start(self):
|
|
25
|
-
songinfo, session, headers = self.songinfo, self.session, self.headers
|
|
26
|
-
checkDir(songinfo['savedir'])
|
|
27
|
-
try:
|
|
28
|
-
is_success = False
|
|
29
|
-
with closing(session.get(songinfo['download_url'], headers=headers, stream=True, verify=False)) as response:
|
|
30
|
-
total_size = int(response.headers['content-length'])
|
|
31
|
-
chunk_size = 1024
|
|
32
|
-
if response.status_code == 200:
|
|
33
|
-
label = '[FileSize]: %0.2fMB' % (total_size / 1024 / 1024)
|
|
34
|
-
with click.progressbar(length=total_size, label=label) as progressbar:
|
|
35
|
-
with open(os.path.join(songinfo['savedir'], songinfo['savename']+'.'+songinfo['ext']), 'wb') as fp:
|
|
36
|
-
for chunk in response.iter_content(chunk_size=chunk_size):
|
|
37
|
-
if chunk:
|
|
38
|
-
fp.write(chunk)
|
|
39
|
-
progressbar.update(chunk_size)
|
|
40
|
-
is_success = True
|
|
41
|
-
except:
|
|
42
|
-
is_success = False
|
|
43
|
-
return is_success
|
|
44
|
-
'''设置请求头'''
|
|
45
|
-
def __setheaders(self, source):
|
|
46
|
-
self.qq_headers = {
|
|
47
|
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36',
|
|
48
|
-
'Referer': 'http://y.qq.com',
|
|
49
|
-
}
|
|
50
|
-
self.migu_headers = {
|
|
51
|
-
'Referer': 'https://m.music.migu.cn/',
|
|
52
|
-
'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Mobile Safari/537.36',
|
|
53
|
-
}
|
|
54
|
-
self.kuwo_headers = {
|
|
55
|
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36',
|
|
56
|
-
}
|
|
57
|
-
self.joox_headers = {
|
|
58
|
-
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko)',
|
|
59
|
-
}
|
|
60
|
-
self.xiami_headers = {
|
|
61
|
-
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36',
|
|
62
|
-
}
|
|
63
|
-
self.kugou_headers = {
|
|
64
|
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36',
|
|
65
|
-
'Host': 'webfs.yun.kugou.com',
|
|
66
|
-
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
|
|
67
|
-
'Accept-Encoding': 'gzip, deflate, br',
|
|
68
|
-
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
|
|
69
|
-
'Cache-Control': 'max-age=0',
|
|
70
|
-
'Connection': 'keep-alive',
|
|
71
|
-
}
|
|
72
|
-
self.netease_headers = {}
|
|
73
|
-
self.qianqian_headers = {
|
|
74
|
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36',
|
|
75
|
-
}
|
|
76
|
-
self.baiduFlac_headers = {
|
|
77
|
-
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36',
|
|
78
|
-
'Referer': 'http://music.baidu.com/',
|
|
79
|
-
}
|
|
80
|
-
self.headers = getattr(self, f'{source}_headers')
|
musicdl-2.1.11.dist-info/LICENSE
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
22
|
-
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: musicdl
|
|
3
|
-
Version: 2.1.11
|
|
4
|
-
Summary: A lightweight music downloader written by pure python
|
|
5
|
-
Home-page: https://github.com/CharlesPikachu/musicdl
|
|
6
|
-
Author: Charles
|
|
7
|
-
Author-email: charlesblwx@gmail.com
|
|
8
|
-
License: MIT License
|
|
9
|
-
Platform: UNKNOWN
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Classifier: Operating System :: OS Independent
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
Requires-Dist: requests (>=2.22.0)
|
|
16
|
-
Requires-Dist: pycryptodome (>=3.8.1)
|
|
17
|
-
Requires-Dist: click (>=7.0)
|
|
18
|
-
Requires-Dist: prettytable (>=0.7.2)
|
|
19
|
-
|
|
20
|
-
# Music Downloader
|
|
21
|
-
```
|
|
22
|
-
A lightweight music downloader written by pure python.
|
|
23
|
-
You can star this repository to keep track of the project if it's helpful for you, thank you for your support.
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
# Documents
|
|
27
|
-
#### In Chinese
|
|
28
|
-
https://musicdl.readthedocs.io/
|
|
29
|
-
|
|
30
|
-
# Statement
|
|
31
|
-
```
|
|
32
|
-
This repository is created just for learning python(Commercial prohibition).
|
|
33
|
-
All the apis used in this repository are from public network. So, if you want to download the paid songs,
|
|
34
|
-
please open a paid member on corresponding music platform by yourself (respect the music copyright please).
|
|
35
|
-
Finally, if there are any infringements, please contact me to delete this repository.
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
# Support List
|
|
39
|
-
| Websites | Support Search? | Support Download? | in Chinese |
|
|
40
|
-
| :----: | :----: | :----: | :----: |
|
|
41
|
-
| [QQ](https://y.qq.com/) | ✓ | ✓ | QQ音乐 |
|
|
42
|
-
| [Kuwo](http://yinyue.kuwo.cn/) | ✓ | ✓ | 酷我音乐 |
|
|
43
|
-
| [Kugou](http://www.kugou.com/) | ✓ | ✓ | 酷狗音乐 |
|
|
44
|
-
| [Xiami](https://www.xiami.com/) | ✓ | ✓ | 虾米音乐 |
|
|
45
|
-
| [Qianqian](http://music.taihe.com/) | ✓ | ✓ | 千千音乐 |
|
|
46
|
-
| [Migu](http://www.migu.cn/) | ✓ | ✓ | 咪咕音乐 |
|
|
47
|
-
| [Netease](https://music.163.com/) | ✓ | ✓ | 网易云音乐 |
|
|
48
|
-
| [baiduFlac](http://music.baidu.com/) | ✓ | ✓ | 百度无损音乐 |
|
|
49
|
-
| [JOOX](https://www.joox.com/limits) | ✓ | ✓ | JOOX音乐 |
|
|
50
|
-
|
|
51
|
-
# Install
|
|
52
|
-
#### Pip install
|
|
53
|
-
```
|
|
54
|
-
run "pip install musicdl"
|
|
55
|
-
```
|
|
56
|
-
#### Source code install
|
|
57
|
-
```sh
|
|
58
|
-
(1) Offline
|
|
59
|
-
Step1: git clone https://github.com/CharlesPikachu/musicdl.git
|
|
60
|
-
Step2: cd musicdl -> run "python setup.py install"
|
|
61
|
-
(2) Online
|
|
62
|
-
run "pip install git+https://github.com/CharlesPikachu/musicdl.git@master"
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
# Quick Start
|
|
66
|
-
```python
|
|
67
|
-
from musicdl import musicdl
|
|
68
|
-
|
|
69
|
-
config = {'logfilepath': 'musicdl.log', 'savedir': 'downloaded', 'search_size_per_source': 5, 'proxies': {}}
|
|
70
|
-
target_srcs = ['baiduFlac', 'kugou', 'kuwo', 'qq', 'qianqian', 'netease', 'migu', 'xiami', 'joox']
|
|
71
|
-
client = musicdl.musicdl(config=config)
|
|
72
|
-
client.run(target_srcs)
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
# Screenshot
|
|
76
|
-

|
|
77
|
-
|
|
78
|
-
# More
|
|
79
|
-
#### WeChat Official Accounts
|
|
80
|
-
*Charles_pikachu*
|
|
81
|
-

|
|
82
|
-
|
musicdl-2.1.11.dist-info/RECORD
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
musicdl/__init__.py,sha256=5cLGCFGa9pZX6cClO4ZVM1pRHV2XAKl1iLf-tAnO8Ew,424
|
|
2
|
-
musicdl/musicdl.py,sha256=8fv9s6ytgc7q9WJ7hFzDajDxJMiXmH5LOlL5kRlGmoE,4223
|
|
3
|
-
musicdl/modules/__init__.py,sha256=zuKuuKiMGxTK6gloRwWLo30nySibvOQgMCRqiz8qwlw,62
|
|
4
|
-
musicdl/modules/sources/__init__.py,sha256=Am8d4mL9QUtQYA2j7jCPAlzyDnXITVe_DfurOhKcaXY,256
|
|
5
|
-
musicdl/modules/sources/baiduFlac.py,sha256=UKG1HGmaI7viKijxFDdoW3d0q4QiwaHo_Y3dDR7aLOU,2975
|
|
6
|
-
musicdl/modules/sources/base.py,sha256=e61yvAX4olzCvtCtwHM6Y1rauDttNnvxSxJ2VtJD3H0,1358
|
|
7
|
-
musicdl/modules/sources/joox.py,sha256=KTW6ui-d18G1lfYEIqCeiIqVFkvdS78Xc25TKMT3Iiw,3417
|
|
8
|
-
musicdl/modules/sources/kugou.py,sha256=CCSTjLu8hHA9dqmanEmpjt2m6ufR_IHzRPRXP_x1VsM,3567
|
|
9
|
-
musicdl/modules/sources/kuwo.py,sha256=E61JWM6Q-oGfgT8vIo07KoWyEW-_z3Xb3xgKQ9VT06k,3080
|
|
10
|
-
musicdl/modules/sources/migu.py,sha256=tYJmtIMZj3E34UK8pMguJccuPjU3hTfZCTGsxJ_u1Xw,3495
|
|
11
|
-
musicdl/modules/sources/netease.py,sha256=-Sxrnu9iAvTa8ISdJjzjBA7uzT2tG703LB41tDO5vl8,5306
|
|
12
|
-
musicdl/modules/sources/qianqian.py,sha256=Z9L3CAyEM2rzpz62W33nG5xk8x_m-WwOHmKGt825aRU,3536
|
|
13
|
-
musicdl/modules/sources/qq.py,sha256=OD05liQcIYpxQLzw7lqas4gBnltBmzErkwwD-GrmloY,5347
|
|
14
|
-
musicdl/modules/sources/xiami.py,sha256=T3iPh4L7eaKJCJF1f3v5xyBxajysFrB-ttw6ZIoKJ_8,4265
|
|
15
|
-
musicdl/modules/utils/__init__.py,sha256=rKKwTZxeR6ELbPOayevffjbaoxTlC08-orlUZOMD8eM,165
|
|
16
|
-
musicdl/modules/utils/downloader.py,sha256=-Vp6kS5CltqPSs0iYfIIT_8Ze5yt4o3QmDAeMaxlZSU,3845
|
|
17
|
-
musicdl/modules/utils/logger.py,sha256=U2QDOC4Ujr7FBioG6vnI5xDlxrM9WfER_dYu_CGlNU4,1832
|
|
18
|
-
musicdl/modules/utils/misc.py,sha256=1S6em9nOP-XWbsrzEpUOXL6mePPMJKJtxiYrBbGO2OY,920
|
|
19
|
-
musicdl-2.1.11.dist-info/LICENSE,sha256=Dm15l7uvtfK-PL5DBp1Ray-hGnA1ZbVQfN4ew0gRmRM,1080
|
|
20
|
-
musicdl-2.1.11.dist-info/METADATA,sha256=EXyTk6N9M2cVz-pCW7J6qXsyHrUxty6qrg5NnWzlfPc,3336
|
|
21
|
-
musicdl-2.1.11.dist-info/WHEEL,sha256=qB97nP5e4MrOsXW5bIU5cUn_KSVr10EV0l-GCHG9qNs,97
|
|
22
|
-
musicdl-2.1.11.dist-info/top_level.txt,sha256=HOD_b1JeusbPJ3NHxGn2Qba9GWiMc7zQTsyz44fedkA,8
|
|
23
|
-
musicdl-2.1.11.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
24
|
-
musicdl-2.1.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|