本
文
摘
要
本文目录一览:
- 1、千千静音里搜索歌词的时候说连接服务器失败,该怎么办??
- 2、千千静听为什么下载歌词的时候说内部 *** ??
- 3、千千静听的歌词服务器地址是哪个?
- 4、千千静听下载歌词时,总是“连接服务器失败”??
千千静音里搜索歌词的时候说连接服务器失败,该怎么办??
有可能是你网速问题,或者是千千静听文件损坏了,建议你换一个其他的播放软件,建议使用QQ音乐,那个可以听歌,而且速度不错,还可以搜索歌曲
以及下载歌曲,非常方便,而且还可以和QQ一起使用!(忘记说重要的了,QQ音乐可以看歌词)
分给我吧
^^
[img]千千静听为什么下载歌词的时候说内部 *** ??
最近很多网友反映使用千千静听无法找到歌词,经常显示“连接服务器失败”。经确认,这是因为千千静听的歌词服务器出现了故障,他们正在尽快解决,请大家谅解!
此外,对于酷我的作用的说明,酷我的责任在于帮助识别歌曲的正确信息,然后由千千静听为大家寻找歌词。
千千静听的歌词服务器地址是哪个?
最近想做一个音乐播放器,播放器需要显示歌词,这就需要到网上下载歌词。花了两个晚上搞了一个歌词下载类,通过歌名和歌手算出响应代码到千千静听服务器下载
具体流程如下:
1、通过歌名 Title 和 歌手 Artist ,计算出歌词下载列表地址
先把Title和Artist转换为十六进制,带入下面服务器地址
歌词Id获取地址:{0}Title={1}Flags=0"
然后连接到地址,得到一个Xml文件,可以得到歌词的下载Id
2、通过 Id 和 Title 和 Artist 算出相应的Code,具体看代码(参考自网上)
歌词下载服务器地址:{0}Code={1}
下面是代码
定义两个类:LyricsHelper(辅助获取歌词Id)LrcInfo(歌词下载相应信息)
public class LyricsHelper
{
//歌词Id获取地址
private static readonly string SearchPath = "{0}Title={1}Flags=0";
//根据artist和title获取歌词信息
public static LrcInfo[] GetLrcList(string artist, string title, string filepath)
{
string artistHex = GetHexString(artist, Encoding.Unicode);
string titleHex = GetHexString(title, Encoding.Unicode);
string resultUrl = string.Format(SearchPath, artistHex, titleHex);
XmlDocument doc = new XmlDocument();
try
{
doc.Load(resultUrl);
XmlNodeList nodelist = doc.SelectNodes("/result/lrc");
ListLrcInfo lrclist = new ListLrcInfo();
foreach (XmlNode node in nodelist)
{
XmlElement element = (XmlElement)node;
string artistItem = element.GetAttribute("artist");
string titleItem = element.GetAttribute("title");
string idItem = element.GetAttribute("id");
lrclist.Add(new LrcInfo(idItem, titleItem, artistItem, filepath));
}
return lrclist.ToArray();
}
catch (XmlException)
{
return null;
}
}
//把字符串转换为十六进制
public static string GetHexString(string str, Encoding encoding)
{
StringBuilder *** = new StringBuilder();
byte[] bytes = encoding.GetBytes(str);
foreach (byte b in bytes)
{
*** .Append(b.ToString("X").PadLeft(2, '0'));
}
return *** .ToString();
}
}
public class LrcInfo
{
//歌词下载地址
private static readonly string DownloadPath = "{0}Code={1}";
public string FilePath { get; set; }
public string Id { get; set; }
public string Artist { get; set; }
public string Title { get; set; }
public string LrcUri { get; set; }
public LrcInfo(string id, string title, string artist, string filepath)
{
this.FilePath = filepath;
this.Id = id.Trim();
this.Title = title;
this.Artist = artist;
//算出歌词的下载地址
this.LrcUri = string.Format(DownloadPath, Id, CreateQianQianCode());
}
public bool DownloadLrc()
{
string file = FilePath;
string directory = Path.GetDirectoryName(file) + "\\Lrc\\";
if (!Directory.Exists(directory))
{
Directory.CreateDirectory(directory);
}
string filepath = directory + Path.GetFileNameWithoutExtension(file) + ".lrc";
WebRequest request = WebRequest.Create(LrcUri);
StringBuilder *** = new StringBuilder();
try
{
using (StreamReader sr = new StreamReader(request.GetResponse().GetResponseStream(), Encoding.UTF8))
{
using (StreamWriter sw = new StreamWriter(filepath, false, Encoding.UTF8))
{
sw.Write(sr.ReadToEnd());
}
}
return true;
}
catch (WebException)
{
}
return false;
}
private string CreateQianQianCode()
{
int lrcId = Convert.ToInt32(Id);
string qqHexStr = LyricsHelper.GetHexString(Artist + Title, Encoding.UTF8);
int length = qqHexStr.Length / 2;
int[] song = new int[length];
for (int i = 0; i length; i++)
{
song[i] = int.Parse(qqHexStr.Substring(i * 2, 2), System.Globalization.NumberStyles.HexNumber);
}
int t1 = 0, t2 = 0, t3 = 0;
t1 = (lrcId 0x0000FF00) 8;
if ((lrcId 0x00FF0000) == 0)
{
t3 = 0x000000FF ~t1;
}
else
{
t3 = 0x000000FF ((lrcId 0x00FF0000) 16);
}
t3 = t3 | ((0x000000FF lrcId) 8);
t3 = t3 8;
t3 = t3 | (0x000000FF t1);
t3 = t3 8;
if ((lrcId 0xFF000000) == 0)
{
t3 = t3 | (0x000000FF (~lrcId));
}
else
{
t3 = t3 | (0x000000FF (lrcId 24));
}
int j = length - 1;
while (j = 0)
{
int c = song[j];
if (c = 0x80) c = c - 0x100;
t1 = (int)((c + t2) 0x00000000FFFFFFFF);
t2 = (int)((t2 (j % 2 + 4)) 0x00000000FFFFFFFF);
t2 = (int)((t1 + t2) 0x00000000FFFFFFFF);
j -= 1;
}
j = 0;
t1 = 0;
while (j = length - 1)
{
int c = song[j];
if (c = 128) c = c - 256;
int t4 = (int)((c + t1) 0x00000000FFFFFFFF);
t1 = (int)((t1 (j % 2 + 3)) 0x00000000FFFFFFFF);
t1 = (int)((t1 + t4) 0x00000000FFFFFFFF);
j += 1;
}
int t5 = (int)Conv(t2 ^ t3);
t5 = (int)Conv(t5 + (t1 | lrcId));
t5 = (int)Conv(t5 * (t1 | t3));
t5 = (int)Conv(t5 * (t2 ^ lrcId));
long t6 = (long)t5;
if (t6 2147483648)
t5 = (int)(t6 - 4294967296);
return t5.ToString();
}
private long Conv(int i)
{
long r = i % 4294967296;
if (i = 0 r 2147483648)
r = r - 4294967296;
if (i 0 r 2147483648)
r = r + 4294967296;
return r;
}
}
千千静听下载歌词时,总是“连接服务器失败”??
分类: 资源共享
问题描述:
之前装的是代理服务器是“网通”的,现在刚装了一个新版本代理服务器是“歌词主服务器”??好多英文歌曲的词都下不到???
烦哪~~
解析:
你确定英文歌的名字准确无误么 有的时候是因为名字上面有网址啦之类的所以才找不到的 我觉得跟服务器没什么关系吧