fuo-qqmusic 1.0.11__tar.gz → 1.0.12__tar.gz
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.
Potentially problematic release.
This version of fuo-qqmusic might be problematic. Click here for more details.
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/PKG-INFO +1 -1
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/README.md +3 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic/api.py +15 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic/provider.py +30 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic.egg-info/PKG-INFO +1 -1
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/setup.py +1 -1
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic/__init__.py +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic/assets/icon.svg +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic/consts.py +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic/excs.py +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic/login.py +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic/provider_ui.py +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic/schemas.py +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic.egg-info/SOURCES.txt +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic.egg-info/dependency_links.txt +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic.egg-info/entry_points.txt +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic.egg-info/requires.txt +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/fuo_qqmusic.egg-info/top_level.txt +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/setup.cfg +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/tests/test_api.py +0 -0
- {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.12}/tests/test_provider.py +0 -0
|
@@ -17,6 +17,14 @@ logger = logging.getLogger(__name__)
|
|
|
17
17
|
|
|
18
18
|
api_base_url = 'http://c.y.qq.com'
|
|
19
19
|
|
|
20
|
+
class CodeShouldBe200(QQIOError):
|
|
21
|
+
def __init__(self, data):
|
|
22
|
+
self._code = data['code']
|
|
23
|
+
self._data = data
|
|
24
|
+
|
|
25
|
+
def __str__(self):
|
|
26
|
+
return f'json code field should be 200, got {self._code}. data: {self._data}'
|
|
27
|
+
|
|
20
28
|
|
|
21
29
|
def djb2(string):
|
|
22
30
|
''' Hash a word using the djb2 algorithm with the specified base. '''
|
|
@@ -449,6 +457,13 @@ class API(object):
|
|
|
449
457
|
}
|
|
450
458
|
js = self.rpc(data)
|
|
451
459
|
return js['req_0']['data']
|
|
460
|
+
|
|
461
|
+
def get_comment(self, comment_id):
|
|
462
|
+
url = api_base_url + f'/base/fcgi-bin/fcg_global_comment_h5.fcg?biztype=1&cmd=8&topid={comment_id}&pagenum=0&pagesize=25'
|
|
463
|
+
res_data = requests.get(url, headers=self._headers)
|
|
464
|
+
if res_data.status_code == 200:
|
|
465
|
+
return res_data.json()
|
|
466
|
+
raise CodeShouldBe200(res_data)
|
|
452
467
|
|
|
453
468
|
def get_lyric_by_songmid(self, songmid):
|
|
454
469
|
url = api_base_url + '/lyric/fcgi-bin/fcg_query_lyric_new.fcg'
|
|
@@ -3,11 +3,14 @@ from typing import List, Optional, Protocol, Tuple
|
|
|
3
3
|
from feeluown.excs import ModelNotFound
|
|
4
4
|
from feeluown.library import (
|
|
5
5
|
AbstractProvider,
|
|
6
|
+
BriefCommentModel,
|
|
6
7
|
BriefSongModel,
|
|
7
8
|
BriefPlaylistModel,
|
|
9
|
+
BriefUserModel,
|
|
8
10
|
PlaylistModel,
|
|
9
11
|
Collection,
|
|
10
12
|
CollectionType,
|
|
13
|
+
CommentModel,
|
|
11
14
|
ProviderV2,
|
|
12
15
|
ProviderFlags as PF,
|
|
13
16
|
SupportsSongGet,
|
|
@@ -30,6 +33,7 @@ from feeluown.library import (
|
|
|
30
33
|
SupportsCurrentUserChanged,
|
|
31
34
|
SimpleSearchResult,
|
|
32
35
|
SearchType,
|
|
36
|
+
ModelState,
|
|
33
37
|
ModelType,
|
|
34
38
|
UserModel,
|
|
35
39
|
)
|
|
@@ -193,6 +197,32 @@ class QQProvider(AbstractProvider, ProviderV2):
|
|
|
193
197
|
must not return None with a valid quality.
|
|
194
198
|
"""
|
|
195
199
|
return list(self._song_get_q_media_mapping(song))
|
|
200
|
+
|
|
201
|
+
def song_list_hot_comments(self, song):
|
|
202
|
+
logger.info(f'Fetching hot comments for song: {song.title}({song.identifier})')
|
|
203
|
+
data = self.api.get_comment(song.identifier)
|
|
204
|
+
hot_comments_data = data["hot_comment"]["commentlist"]
|
|
205
|
+
hot_comments = []
|
|
206
|
+
for comment_data in hot_comments_data:
|
|
207
|
+
user = BriefUserModel(
|
|
208
|
+
identifier='',
|
|
209
|
+
source=SOURCE,
|
|
210
|
+
name=comment_data['nick'],
|
|
211
|
+
state=ModelState.not_exists,
|
|
212
|
+
)
|
|
213
|
+
comment = CommentModel(
|
|
214
|
+
identifier=str(comment_data["commentid"]),
|
|
215
|
+
source=SOURCE,
|
|
216
|
+
user=user,
|
|
217
|
+
content=comment_data["rootcommentcontent"],
|
|
218
|
+
liked_count=comment_data["praisenum"],
|
|
219
|
+
time=comment_data["time"],
|
|
220
|
+
parent=None,
|
|
221
|
+
root_comment_id=str(comment_data["rootcommentcontent"])
|
|
222
|
+
)
|
|
223
|
+
hot_comments.append(comment)
|
|
224
|
+
return hot_comments
|
|
225
|
+
|
|
196
226
|
|
|
197
227
|
def song_get_media(self, song, quality: Quality.Audio) -> Optional[Media]:
|
|
198
228
|
"""Get song's media by a specified quality
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|