This commit is contained in:
felinae98
2021-09-07 17:44:32 +08:00
parent 9c7b3a49bc
commit 8e61e27127
7 changed files with 58 additions and 8 deletions
@@ -45,9 +45,9 @@ class NcmArtist(TargetMixin, NewMessage):
def get_date(self, post: RawPost) -> int:
return post['publishTime'] // 1000
def parse(self, raw_post: RawPost) -> Post:
text = '新专辑发布:{}'.format(raw_post.name)
target_name = raw_post.artist.name
async def parse(self, raw_post: RawPost) -> Post:
text = '新专辑发布:{}'.format(raw_post['name'])
target_name = raw_post['artist']['name']
pics = [raw_post['picUrl']]
url = "https://music.163.com/#/album?id={}".format(raw_post['id'])
return Post('ncm-artist', text=text, url=url, pics=pics, target_name=target_name)
@@ -114,9 +114,9 @@ class MessageProcessMixin(PlatformNameMixin, CategoryMixin, ParsePostMixin, abst
self.parse_cache[post_id] = await self.parse(raw_post)
break
except Exception as err:
retry_times -= 1
if not retry_times:
raise err
retry_times -= 1
return self.parse_cache[post_id]
@abstractmethod