fuo-qqmusic 1.0.11__tar.gz → 1.0.13__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.

Files changed (21) hide show
  1. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/PKG-INFO +1 -1
  2. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/README.md +6 -0
  3. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic/api.py +15 -0
  4. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic/provider.py +30 -0
  5. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic/provider_ui.py +1 -3
  6. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic.egg-info/PKG-INFO +1 -1
  7. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/setup.py +1 -1
  8. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic/__init__.py +0 -0
  9. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic/assets/icon.svg +0 -0
  10. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic/consts.py +0 -0
  11. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic/excs.py +0 -0
  12. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic/login.py +0 -0
  13. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic/schemas.py +0 -0
  14. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic.egg-info/SOURCES.txt +0 -0
  15. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic.egg-info/dependency_links.txt +0 -0
  16. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic.egg-info/entry_points.txt +0 -0
  17. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic.egg-info/requires.txt +0 -0
  18. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/fuo_qqmusic.egg-info/top_level.txt +0 -0
  19. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/setup.cfg +0 -0
  20. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/tests/test_api.py +0 -0
  21. {fuo_qqmusic-1.0.11 → fuo_qqmusic-1.0.13}/tests/test_provider.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fuo_qqmusic
3
- Version: 1.0.11
3
+ Version: 1.0.13
4
4
  Summary: feeluown qqmusic plugin
5
5
  Home-page: https://github.com/feeluown/feeluown-qqmusic
6
6
  Author: Cosven
@@ -20,6 +20,12 @@ pip3 install fuo-qqmusic
20
20
  [操作示例](https://github.com/feeluown/feeluown-qqmusic/issues/6)。
21
21
 
22
22
  ## changelog
23
+ ### 1.0.13 (2025-09-26)
24
+ - 移除对 PyQt5 的依赖
25
+
26
+ ### 1.0.12 (2025-09-22)
27
+ - 支持展示歌曲评论
28
+
23
29
  ### 1.0.11 (2025-08-12)
24
30
  - 尝试修复wx登录有时会失败的问题
25
31
 
@@ -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
@@ -1,8 +1,6 @@
1
1
  import logging
2
2
  import os
3
3
 
4
- from PyQt5.QtWidgets import QMenu
5
-
6
4
  from feeluown.utils.dispatch import Signal
7
5
  from feeluown.utils.aio import run_fn
8
6
  from feeluown.gui.widgets.login import CookiesLoginDialog, InvalidCookies
@@ -71,7 +69,7 @@ class ProviderUI(AbstractProviderUi):
71
69
  def login_event(self):
72
70
  return self._login_event
73
71
 
74
- def context_menu_add_items(self, menu: QMenu):
72
+ def context_menu_add_items(self, menu):
75
73
  action = menu.addAction('重新登录')
76
74
  action.triggered.connect(self._re_login)
77
75
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fuo_qqmusic
3
- Version: 1.0.11
3
+ Version: 1.0.13
4
4
  Summary: feeluown qqmusic plugin
5
5
  Home-page: https://github.com/feeluown/feeluown-qqmusic
6
6
  Author: Cosven
@@ -5,7 +5,7 @@ from setuptools import setup
5
5
 
6
6
  setup(
7
7
  name='fuo_qqmusic',
8
- version='1.0.11',
8
+ version='1.0.13',
9
9
  description='feeluown qqmusic plugin',
10
10
  author='Cosven',
11
11
  author_email='yinshaowen241@gmail.com',
File without changes