Skip to content

Commit

Permalink
修复名字出现斜杠导致下载路径错误
Browse files Browse the repository at this point in the history
  • Loading branch information
周仲浩 committed Mar 19, 2019
1 parent 2a2a869 commit 1de4e26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -6,7 +6,7 @@

<groupId>com.zonas</groupId>
<artifactId>music163Download</artifactId>
<version>1.1</version>
<version>1.11</version>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/zonas/App.java
Expand Up @@ -34,7 +34,7 @@ public static void main(String[] args) throws ExecutionException, InterruptedExc
for (Map<String, Object> map : playlist) {
if (map.get("url") != null) {
byte[] data = Util.fileDownload(map.get("url").toString());
FileOutputStream outputStream = new FileOutputStream(new File("music163" + File.separator + map.get("name") + ".mp3"));
FileOutputStream outputStream = new FileOutputStream(new File("music163" + File.separator + map.get("name").toString().replaceAll("/","") + ".mp3"));
outputStream.write(data);
System.out.println("已下载歌曲:" + map.get("name"));
outputStream.close();
Expand Down

0 comments on commit 1de4e26

Please sign in to comment.