Skip to content

Commit

Permalink
AIPC 2023依然在正常的运作
Browse files Browse the repository at this point in the history
  • Loading branch information
xe5700 committed Jul 4, 2023
1 parent 0f71284 commit 21ccad9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions MusicCacheParser/MusicParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,24 @@ public MusicParser(Form1 f1)
init();
}
private MusicCacheParserConfig.MusicParserConfig config;
private static readonly HttpClient client = new HttpClient(new HttpClientHandler() {
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
private static readonly HttpClient client = new HttpClient(new HttpClientHandler()
{
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate,
});
private Form1 form1;
private ConcurrentDictionary<String,MusicFileInfo> neteaseInfoMap=new ConcurrentDictionary<string, MusicFileInfo>();
private ConcurrentDictionary<String, MusicFileInfo> neteaseInfoMap = new ConcurrentDictionary<string, MusicFileInfo>();
public const byte NETEASE_CODE = 0xA3;
public const string NETEASE_DETAIL_INFO = "http://music.163.com/api/song/detail/?ids=%5B{0:G}%5D";
public const string NETEASE_LRYRIC = "http://music.163.com/api/song/lyric?os=pc&id={0:G}&lv=-1&kv=-1&tv=-1";
private string tmpPath = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".tmp";
private string neteaseCachePath = @"%LocalAppData%\\Netease\\CloudMusic\\Cache";
private byte[] encrypt163key = Utils.Hex2Binary("2331346C6A6B5F215C5D2630553C2728");
public string NeteaseCachePath { get => neteaseCachePath; set => neteaseCachePath = value; }
private FileSystemWatcher neteaseFSW=new FileSystemWatcher();
private FileSystemWatcher neteaseFSW = new FileSystemWatcher();
static MusicParser(){
client.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36");
client.DefaultRequestHeaders.Add("X-Real-IP", "59.111.181.60");
}
private void init()
{
config = form1.Config;
Expand Down Expand Up @@ -180,11 +185,6 @@ private void doAutoParseNeteaseFile(string path)
}catch(Exception e){
form1.addToFList(e.ToString());
}
if (time++ > 10)
{
form1.addToFList(Path.GetFileName(path) + " is not download complete" + ret);
return;
}
}
form1.addToFList(Path.GetFileName(path) + "'s result is " + ret);
}catch(Exception e)
Expand Down Expand Up @@ -415,12 +415,12 @@ private void ParseNeteaseFile(string path,MusicFileInfo info)
}
var arts = song1.Artists.Select(i => i.Name).ToArray();
tag.AlbumArtists = arts;

tag.Performers = arts;
//开始构建163Key
if (config.NeteaseMusic.Enable163Key)
{
var key163 = mk163Key(info, songDetail);
tag.Description = key163;
//tag.Description = key163;
tag.Comment = key163;
}
//结束构建163Key
Expand Down

0 comments on commit 21ccad9

Please sign in to comment.