fuo-qqmusic 1.0.3__tar.gz → 1.0.4__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fuo_qqmusic
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: feeluown qqmusic plugin
5
5
  Home-page: https://github.com/feeluown/feeluown-qqmusic
6
6
  Author: Cosven
@@ -20,6 +20,10 @@ pip3 install fuo-qqmusic
20
20
  [操作示例](https://github.com/feeluown/feeluown-qqmusic/issues/6)。
21
21
 
22
22
  ## changelog
23
+ ### 1.0.4 (2024-05-21)
24
+ - 歌手歌曲排序切换为”按热度排序”
25
+ - 修复推荐歌单接口
26
+
23
27
  ### 1.0.3 (2024-04-21)
24
28
  - 适配 feeluown 4.1.3 的新主页功能
25
29
 
@@ -247,6 +247,7 @@ class API(object):
247
247
  'singerid': artist_id,
248
248
  'begin': (page - 1) * page_size,
249
249
  'num': page_size,
250
+ 'order': 1, # 热门/新,不带这个字段就是按歌曲新旧排序
250
251
  # 有 newsong 字段时,服务端会返回含有 file 字段的字典
251
252
  'newsong': 1
252
253
  }},
@@ -240,7 +240,7 @@ class QQProvider(AbstractProvider, ProviderV2):
240
240
  songs = self._model_cache_get_or_fetch(playlist, "songs")
241
241
  return create_reader(songs)
242
242
 
243
- def rec_list_daily_playlists(self):
243
+ def __rec_hot_playlists(self):
244
244
  user = self.get_current_user()
245
245
  if user is None:
246
246
  return []
@@ -253,16 +253,45 @@ class QQProvider(AbstractProvider, ProviderV2):
253
253
  pl["logo"] = pl["cover"]
254
254
  return [_deserialize(playlist, QQPlaylistSchema) for playlist in playlists]
255
255
 
256
+ def rec_list_daily_playlists(self):
257
+ # TODO: cache API result
258
+ feed = self.api.get_recommend_feed()
259
+ shelf = None
260
+ for shelf_ in feed['v_shelf']:
261
+ # I guess 10046 means 'song'.
262
+ if shelf_['extra_info'].get('moduleID', '').startswith('playlist'):
263
+ shelf = shelf_
264
+ break
265
+ if shelf is None:
266
+ return []
267
+ playlists = []
268
+ for batch in shelf['v_niche']:
269
+ for card in batch['v_card']:
270
+ print(card['title'], card['jumptype'])
271
+ if card['jumptype'] == 10014: # 10014->playlist
272
+ playlists.append(
273
+ PlaylistModel(identifier=str(card['id']),
274
+ source=SOURCE,
275
+ name=card['title'],
276
+ cover=card['cover'],
277
+ description=card['miscellany']['rcmdtemplate'])
278
+ )
279
+ return playlists
280
+
256
281
  def rec_a_collection_of_songs(self):
257
282
  # TODO: cache API result
258
283
  feed = self.api.get_recommend_feed()
259
284
  shelf = None
260
- for shelf in feed['v_shelf']:
285
+ for shelf_ in feed['v_shelf']:
261
286
  # I guess 10046 means 'song'.
262
- if shelf['miscellany'].get('jumptype') == 10046:
263
- shelf = shelf
287
+ if int(shelf_['miscellany'].get('jumptype', 0)) == 10046:
288
+ shelf = shelf_
289
+ break
264
290
  if shelf is None:
265
- return '', []
291
+ return Collection(name='',
292
+ type_=CollectionType.only_songs,
293
+ models=[],
294
+ description='')
266
295
  title = shelf['title_content'] or shelf['title_template']
267
296
  song_ids = []
268
297
  for batch in shelf['v_niche']:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fuo-qqmusic
3
- Version: 1.0.3
3
+ Version: 1.0.4
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.3',
8
+ version='1.0.4',
9
9
  description='feeluown qqmusic plugin',
10
10
  author='Cosven',
11
11
  author_email='yinshaowen241@gmail.com',
File without changes