public void GetAddress(ref VideoInfo vic) { vic.part = via.fregment; vic.alltime = via.alltime; SharpItem vi = via.vi[sharpindex]; vic.type = via.type; if (via.type == 1) { vic.href = via.http[siteindex] + via.fn + ".mp4?type=mp4&fmt=auto&vkey=" + vi.vkey + "";// + vi.fmt; } else { vic.href = via.http[siteindex] + via.fn + vi.pid; vic.vkey = ".mp4?sdtfrom=v1001&type=mp4&fmt=auto&vkey=" + vi.vkey;//+ vi.fmt;//href + part +vkey } int c = via.vi.Length; vic.sharp = new string[c]; for (int i = 0; i < c; i++) { vic.sharp[i] = via.vi[i].sharp; } vic.site = via.http.Length; vic.tilte = via.title; vic.vid = vid; vic.cmd5 = via.cmd5; }
public void ChangeSite(int index, ref VideoInfo vic) { siteindex = index; SharpItem vi = via.vi[sharpindex]; vic.type = via.type; if (via.type == 1) { vic.href = via.http[index] + via.fn + ".mp4?vkey=" + vi.vkey + "&type=mp4&fmt=" + vi.fmt; } else { vic.href = via.http[index] + via.fn + vi.pid; vic.vkey = ".mp4?vkey=" + vi.vkey + "&type=mp4&fmt=" + vi.fmt;//href + part +vkey } }
static async void GetVideoFregment(string vid, string fn, SharpItem vi, Action <int> callback) { string str = "platform=11&otype=xml&vids=" + vid + "&format=" + vi.fid + "&filename=" + fn + vi.pid; int c = 2; l :; string cc = str + c.ToString() + ".mp4"; cc = await WebClass.Post("http://vv.video.qq.com/getkey", cc, "http://imgcache.qq.com/tencentvideo_v1/playerv3/TencentPlayer.swf?max_age=86400&v=20160819"); char[] tc = cc.ToCharArray(); //Debug.WriteLine(new string(DeleteChar(ref tc, '/'))); if (FindCharArray(ref tc, ref Key_key, 0) > 0) { c++; goto l; } c--; callback(c); }
static async void GetVideoKey(string vid, string fn, SharpItem vi, Action <string, int> callback, int part) { string str = "platform=11&otype=xml&vids=" + vid + "&format=" + vi.fid + "&filename=" + fn + vi.pid; str += part.ToString() + ".mp4"; str = await WebClass.Post("http://vv.video.qq.com/getkey", str, "http://imgcache.qq.com/tencentvideo_v1/playerv3/TencentPlayer.swf?max_age=86400&v=20161114"); char[] tc = str.ToCharArray(); int ccc = 0; tc = FindCharArrayA(ref tc, ref Key_key, ref Key_less, ref ccc); if (tc != null) { str = new string(tc); callback(str, part); } else { callback(null, part); } }
public async Task <string> GetPartVkey(int part) { SharpItem vi = via.vi[sharpindex]; string str = "platform=11&otype=xml&vids=" + vid + "&format=" + vi.fid + "&filename=" + via.fn + vi.pid; str += part.ToString() + ".mp4"; str = await WebClass.Post("http://vv.video.qq.com/getkey", str, "http://imgcache.qq.com/tencentvideo_v1/playerv3/TencentPlayer.swf?max_age=86400&v=20161114"); //Debug.WriteLine(str); char[] tc = str.ToCharArray(); int ccc = 0; tc = FindCharArrayA(ref tc, ref Key_key, ref Key_less, ref ccc); if (tc != null) { return(new string(tc)); } else { return(null); } }
static void GetVI(ref char[] source, ref VideoInfoA vi) { int t = FindCharArray(ref source, ref Key_td, 0); char[] tt = FindCharArrayA(ref source, '\"', '\"', ref t); vi.alltime = CharToInt(ref tt); t = FindCharArray(ref source, ref Key_ti, t); tt = FindCharArrayA(ref source, '\"', '\"', ref t); vi.title = new string(tt); t = FindCharArray(ref source, ref Key_fc, 0); tt = FindCharArrayA(ref source, ':', ',', ref t); vi.fregment = CharToInt(ref tt); int s = 0; int a = FindCharArray(ref source, ref Key_fn, 0); char[] fn = FindCharArrayA(ref source, '\"', '.', ref a); vi.fn = new string(fn); a++; if (source[a] != 'p') { vi.type = 1; } else { vi.type = 0; } SharpItem[] temp = new SharpItem[6]; int c = s = 0; for (int i = 0; i < 6; i++) { tt = FindCharArrayA(ref source, '(', ')', ref s); if (tt == null) { SharpItem[] r = new SharpItem[c]; for (int d = 0; d < c; d++) { r[d] = temp[d]; } vi.vi = r; return; } SharpItem VI = new SharpItem(); VI.sharp = new string(tt); VI.sharpA = CharToInt(ref tt); s = FindCharArray(ref source, ref Key_idA, s); tt = FindCharArrayA(ref source, ':', ',', ref s); if (tt != null) { if (tt.Length > 2) { s = FindCharArray(ref source, ref Key_name, s); VI.fmt = new string(FindCharArrayA(ref source, '\"', '\"', ref s)); string str = new string(CopyCharArry(ref tt, tt.Length - 3, 3)); VI.fid = "10" + str; VI.pid = ".p" + str + "."; temp[c] = VI; } else { s = FindCharArray(ref source, ref Key_name, s); VI.fmt = new string(FindCharArrayA(ref source, '\"', '\"', ref s)); a = FindCharArray(ref source, ref Key_fvkey, a); VI.vkey = new string(FindCharArrayA(ref source, '\"', '\"', ref a)); temp[c] = VI; } c++; } } }