Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 4, 2023
2 parents 5766232 + b3b8449 commit 4d8fe27
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@ IDE: Windows Notepad
1. Windows用户可能体验不是很好,因为很多适配坑。
2. QQ音乐搜不到,是因为搜索频率过快。别问我为什么才搜两次就频繁了,你问qq。
3. 下载歌曲后前端页面没有提示,看命令行窗口就知道有没有下载成功了。
4. 昨天碰到有人因为MIME严格模式导致无法正常加载js文件,最终页面打开空白的bug,这里声明一下:垃圾Windows是这样的。解决办法如下:
报错信息类似于:
![image](https://user-images.githubusercontent.com/24793281/235321487-6593d996-a616-4236-ae1f-4fa10211671e.png)

给后面用Windows碰到一样报错问题的同学解决方法:
flak框架下运行仍然报错,这是因为加载xxx.js文件默认为text/plain格式,不能正常解析,解决方法如下图所示,修改注册表即可,将图中Content
Type由原来的text/plain改为 application/javascript,然后重新打开项目即可:
![image](https://user-images.githubusercontent.com/24793281/235321358-2888adb3-d571-48e0-88fc-a2836211232d.png)

另外再次赞美windows的天才设计

## 关于网易云登录功能的声明:

Expand Down
7 changes: 6 additions & 1 deletion flaskSystem/App.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def executeFn(a1: str, a2: bool):
return a1 + "a2 True" if a2 else "a2 False"


# SocketIO
# SocketIO

socketio = SocketIO()
socketio.init_app(app, cors_allowed_origins='*')
Expand All @@ -136,6 +136,11 @@ def mtest_message(message):
print(message)
emit('my_response', {'data': message['data'], 'count': 1})

@app.after_request
def add_header(response):
if 'text/plain' in response.headers['Content-Type']:
response.headers['Content-Type'] = 'application/javascript; charset=utf-8'
return response


def Start(port):
Expand Down
8 changes: 6 additions & 2 deletions flaskSystem/src/Common/Tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,11 @@ def fulfillMusicMetaData(musicFile, metaDataInfo):
# 唱片公司
label = meta['albumCollection']['company']['name']
# GENRE 流派
gener = [it['name'] for it in meta['albumCollection']['basicInfo']['genres']]
# genres 可能为 None
gener = meta.get('albumCollection', {}).get('basicInfo', {}).get('genres')
if gener is not None:
for it in gener:
gener.append(it['name'])
# 专辑艺术家
albumartist = [it['name'] for it in meta['albumCollection']['singer']['singerList']]

Expand Down Expand Up @@ -741,7 +745,7 @@ def write_metadata_information(

music["TIT2"] = TIT2(encoding=3, text=title)

# 提取时间戳和歌词
# 提取时间戳和歌词
if lyric: music.setall("USLT", [USLT(encoding=Encoding.UTF8, lang='chi', format=2, type=1, text=lyric)])

# 写入流派
Expand Down

0 comments on commit 4d8fe27

Please sign in to comment.