当前位置:   article > 正文

某tv直播_sign算法_mgtv sign算法

mgtv sign算法

1、request参数排序

2、连接特殊字符串

3、md5


关键字:tv、_sign、HAL$#%^RTYDFGdktsf_)(*^%$


有点意思的是,登录之后返回的cookie保活,然后共享cookie,切ip做心跳访问。人气就起来了,统计ip点不太好。

  1. string makeRequest(string strRoomNumber, string strToken, string strIdent, string strCookie)
  2. {
  3. VMPBegin("fasd");
  4. string strPartOne = "&_appSource=417&_appVersion=2.1.2.5178&_appkey=CSAndroid&_fromPos=5&_fromView=1&_identifier=%s";
  5. string strPartTwo = "&_timestamp=%I64d&roomId=%s&token=%s";
  6. CHAR szPartOneFormat[1000] = { 0 };
  7. wsprintf(szPartOneFormat,
  8. "&_appSource=417&_appVersion=2.1.2.5178&_appkey=CSAndroid&_fromPos=5&_fromView=1&_identifier=%s",
  9. strIdent.c_str());
  10. time64 timestamp = getCurrentTimestamp();
  11. time64 timestamp_gelin = transformToTimestamp(1970, 1, 1, 8, 0, 0, 0);
  12. timestamp -= timestamp_gelin;
  13. CHAR szPartTwoFormat[1000] = { 0 };
  14. wsprintf(szPartTwoFormat,
  15. "&_timestamp=%I64d&roomId=%s&token=%s",
  16. timestamp, strRoomNumber.c_str(), strToken.c_str());
  17. //GET http ://api.chushou.tv/api/room/heartbeat.htm?&_appSource=417&_appVersion=2.1.2.5178&_appkey=CSAndroid&_fromPos=5&_fromView=1&_identifier=4579914607&_sign=29bb59f9c0850af0fcde14b7568efb3b&_timestamp=1479016231601&roomId=2832077&token=c75baf46b7b12dd9gfd89a27 HTTP/1.1
  18. //User - Agent : okhttp / 2.7.2
  19. //Cookie : aliyungf_tc = AQAAAOY2Ohe / SwMAOWhncmGlw5oMDbzm; _i7 = 39ac9a7a7f614eb4bf3d512b4acb3b39
  20. //Accept: */*
  21. //Host: api.chushou.tv
  22. //Proxy-Connection: Keep-Alive
  23. //string strHash = "HAL$#%^RTYDFGdktsf_)(*^%$";
  24. //strHash += szPartOneFormat;
  25. //strHash += szPartTwoFormat;
  26. string strSign = getHashFromNet(string(szPartOneFormat) + szPartTwoFormat);
  27. //unsigned char md5[16] = { 0 };
  28. //string strSign;
  29. //GetMd5((unsigned char *)strHash.c_str(), strHash.length(), strSign, md5);
  30. string strHttpRequest;
  31. strHttpRequest += "GET http://api.chushou.tv/api/room/heartbeat.htm?";
  32. strHttpRequest += szPartOneFormat;
  33. strHttpRequest += "&_sign=";
  34. strHttpRequest += strSign;
  35. strHttpRequest += szPartTwoFormat;
  36. strHttpRequest += " HTTP/1.1\r\n";
  37. strHttpRequest += "User-Agent: okhttp/2.7.2\r\n";
  38. strHttpRequest += "Cookie:"; strHttpRequest += strCookie; strHttpRequest += "\r\n";
  39. strHttpRequest += "Host: api.chushou.tv\r\n";
  40. strHttpRequest += "Proxy-Connection: Keep-Alive\r\n";
  41. strHttpRequest += "\r\n";
  42. VMPEnd();
  43. return strHttpRequest;
  44. }

原文链接



声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/神奇cpp/article/detail/750036
推荐阅读
相关标签
  

闽ICP备14008679号