test.py 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. from flask import Flask
  2. import pycurl
  3. from io import StringIO
  4. import time
  5. from DBSession import session_maker
  6. from model import InstanceList
  7. app = Flask(__name__)
  8. from utils import *
  9. def test():
  10. return ipaddr
  11. def h5_curl():
  12. c = pycurl.Curl()
  13. c.setopt(pycurl.URL, "https://longvideoh5.piaoquantv.com/core/share?shareSource=customerMessage&fromAppType=0&qrAppType=0&versionCode=321&shareUid=12463024&shareMachineCode=weixin_openid_o0w175fPwp8yrtOGihYJhvnT9Ag4&h5WxrootPageSource=vlog-pages___category&videoId=2689415&isRecommendShare=1&h5ShareId=backend493cd67dd28f4ee395781d59881567211625976055926&shareDepth=0&state=/")
  14. c.setopt(pycurl.HTTPHEADER, ["Accept:"])
  15. c.setopt(pycurl.WRITEFUNCTION, StringIO.write)
  16. c.setopt(pycurl.FOLLOWLOCATION, 1)
  17. c.setopt(pycurl.MAXREDIRS, 5)
  18. c.perform()
  19. info = c.getinfo(pycurl.INFO_FILETIME)
  20. print(info)
  21. if __name__ == '__main__':
  22. # with session_maker() as session:
  23. # instance_info = session.query(InstanceList).filter(InstanceList.status==0).all()
  24. # for index in range(len(instance_info)):
  25. # print( instance_info[index].ipadd)
  26. requestUri_list = [
  27. 'longvideoapi/sys/config',
  28. 'longvideoapi/video/played',
  29. 'longvideoapi/video/shared/weixin/friend',
  30. 'longvideoapi/user/login/v2',
  31. 'longvideoapi/user/info/getUserInfoExt',
  32. 'longvideoapi/user/token/check',
  33. 'longvideoapi/user/token/refresh',
  34. 'longvideoapi/user/info/homepageHead',
  35. 'longvideoapi/user/share/homepage/circle',
  36. 'longvideoapi/user/idols',
  37. 'longvideoapi/user/fans',
  38. 'longvideoapi/user/recommend/list/v4',
  39. 'longvideoapi/user/outside/subscribeBatch',
  40. 'longvideoapi/user/info/getBaseUserInfo',
  41. 'longvideoapi/user/info/getTargetBaseUserInfo',
  42. 'longvideoapi/user/getWxUserInfoByCode',
  43. 'longvideoapi/user/follow',
  44. 'longvideoapi/user/unfollow',
  45. 'longvideoapi/video/favorite',
  46. 'longvideoapi/video/unfavorite',
  47. 'longvideoapi/video/shared/weixin/circle',
  48. 'longvideoapi/videoCollection/loadUserVideoCollections',
  49. 'longvideoapi/video/v2/sharePage/queryVideosByCollectionId',
  50. 'longvideoapi/video/v2/detailPage/queryVideosByCollectionId',
  51. 'longvideoapi/videoCollection/loadUserVideoCollectionsForShareOrDetailPage',
  52. 'longvideoapi/video/distribute/getAppInfo',
  53. 'longvideoapi/video/distribute/category/videoList/v2',
  54. 'longvideoapi/video/v2/followed',
  55. 'longvideoapi/video/v2/loadHotVideosByCollectionId',
  56. 'longvideoapi/video/v2/loadLatelyVideosByCollectionId',
  57. 'longvideoapi/video/v2/detail',
  58. 'longvideoapi/video/v2/sharePageDetail',
  59. 'longvideoapi/video/send',
  60. 'longvideoapi/video/getCoverImagePaths',
  61. 'longvideoapi/video/updateVideo',
  62. 'longvideoapi/video/deleteVideo',
  63. 'longvideoapi/video/barrage/send',
  64. 'longvideoapi/video/barrage/switch',
  65. 'longvideoapi/video/videoActionReport',
  66. 'longvideoapi/video/barrage/v2/list',
  67. 'longvideoapi/video/shared/h5"',
  68. 'longvideoapi/user/share/report',
  69. 'longvideoapi/oss/signature',
  70. 'longvideoapi/oss/completeUpload',
  71. 'longvideoapi/oss/producevideo/getStsToken',
  72. 'longvideoapi/operate/message/list',
  73. 'longvideoapi/video/message/list',
  74. 'longvideoapi/sys/message/list',
  75. 'longvideoapi/user/station/message/statistics/info',
  76. 'longvideoapi/user/station/message/statistics/read',
  77. 'longvideoapi/user/station/message/totalCount/v2',
  78. 'longvideoapi/user/station/message/totalRead',
  79. 'longvideoapi/user/station/notice/list',
  80. 'longvideoapi/user/station/message/share/list',
  81. 'longvideoapi/user/station/message/prise/list',
  82. 'longvideoapi/user/station/message/favorite/list',
  83. 'longvideoapi/user/station/message/comment/list',
  84. 'longvideoapi/user/station/message/barrage/list',
  85. 'longvideoapi/operation/message/list',
  86. 'longvideoapi/search/userandvideo/list',
  87. 'longvideoapi/search/tips',
  88. 'longvideoapi/search/user/list',
  89. 'longvideoapi/search/video/list',
  90. 'longvideoapi/search/hot/words',
  91. 'longvideoapi/search/hot/videos',
  92. 'longvideoapi/video/distribute/search/recommendVideoes/v2',
  93. 'longvideoapi/comment/top/save',
  94. 'longvideoapi/comment/top/page',
  95. 'longvideoapi/comment/praise',
  96. 'longvideoapi/comment/second/save',
  97. 'longvideoapi/comment/second/page',
  98. 'longvideoapi/comment/delete',
  99. 'longvideoapi/comment/updelete',
  100. 'longvideoapi/comment/hots',
  101. 'longvideoapi/bank/withdraw/getBankWithdrawConfig',
  102. 'longvideoapi/bank/withdraw/getBankWithdrawRecordList',
  103. 'longvideoapi/bank/withdraw/wxSamllapp/requestWithdraw',
  104. 'longvideoapi/purchase/video/list',
  105. 'longvideoapi/profits/myself/head',
  106. 'longvideoapi/profits/myself/list',
  107. 'longvideoapi/profits/myself/recordList/v2',
  108. 'longvideoapi/profits/reward/recordListAccordingToUser',
  109. 'longvideoapi/profits/reward/recordListAccordingToVideo',
  110. 'longvideoapi/video/reward/getVideoRewardHeadInfo',
  111. 'longvideoapi/video/reward/getVideoRewardRecordList',
  112. 'longvideoapi/video/reward/getVideoRewardConfig',
  113. 'longvideoapi/video/reward/getVideoRewardConfig/v2',
  114. 'longvideoapi/order/updateClientPayStatus',
  115. 'longvideoapi/order/purchase',
  116. 'longvideoapi/profits/videoPay/head',
  117. 'longvideoapi/profits/videoPay/list',
  118. 'longvideoapi/video/getPayedVideoPath',
  119. 'longvideoapi/order/reward',
  120. 'longvideoapi/video/reward/getVideoDetailRewardInfo',
  121. 'longvideoapi/video/recommend/detailPage/list',
  122. 'longvideoapi/video/recommend/sharePage/list',
  123. 'longvideoapi/measure/report/view',
  124. 'longvideoapi/video/validatePwd"',
  125. 'longvideoapi/video/validatePwdAuth"',
  126. 'longvideoapi/video/v2/getCutVideo',
  127. 'longvideoapi/frontConfig/getWxFrontConfig',
  128. 'longvideoapi/frontConfig/getVideoPlayConfig',
  129. 'longvideoapi/frontConfig/getUserFrontConfig',
  130. 'longvideoapi/rhythmapp/homepage/getAllVideos',
  131. 'longvideoapi/ad/position/info'
  132. ]
  133. # for i in range(len(instance_info["Instances"]["Instance"])):
  134. # instance_id = instance_info["Instances"]["Instance"][i]["InstanceId"]
  135. # ipaddr = instance_info["Instances"]["Instance"][i]["VpcAttributes"]["PrivateIpAddress"]["IpAddress"][0]
  136. # server_name = instance_info["Instances"]["Instance"][i]["Tags"]["Tag"][0]["TagValue"]
  137. # status = instance_info["Instances"]["Instance"][i]["Status"]
  138. # instance_name = instance_info["Instances"]["Instance"][i]["HostName"]
  139. # if status == "running":
  140. # # status = 1
  141. # for url in requestUri_list:
  142. # IntfaceInfo = None
  143. # IntfaceInfo = IntfaceList()
  144. # with session_maker() as session:
  145. # IntfaceInfo.app_type = "1"
  146. # IntfaceInfo.interface_url = url
  147. # session.add(IntfaceInfo)
  148. # #
  149. # c = pycurl.Curl()
  150. # c.setopt(pycurl.URL, "https://longvideoh5.piaoquantv.com/core/share?shareSource=customerMessage&fromAppType=0&qrAppType=0&versionCode=321&shareUid=12463024&shareMachineCode=weixin_openid_o0w175fPwp8yrtOGihYJhvnT9Ag4&h5WxrootPageSource=vlog-pages___category&videoId=2689415&isRecommendShare=1&h5ShareId=backend493cd67dd28f4ee395781d59881567211625976055926&shareDepth=0&state=/")
  151. # c.setopt(pycurl.HTTPHEADER, ["Accept:"])
  152. # b = StringIO.StringIO()
  153. # c.setopt(pycurl.WRITEFUNCTION, b.write)
  154. # c.setopt(pycurl.FOLLOWLOCATION, 1)
  155. # c.setopt(pycurl.MAXREDIRS, 5)
  156. # c.perform()
  157. #
  158. #
  159. # info = c.getinfo(pycurl.INFO_FILETIME)
  160. #
  161. # print(info)
  162. # with open("/t3.txt", "r") as f: # 打开文件
  163. # data = f.read() # 读取文件
  164. # # print(data)
  165. # 20210716000000000111111
  166. # 20210726200800000000000
  167. # start_time = int(time.strftime("%Y%m%d%H%M", time.localtime())) * 100000000000
  168. # end_time = (int(time.strftime("%Y%m%d%H%M", time.localtime())) + 5) * 100000000000
  169. # print(start_time , end_time)
  170. appType = ['0', '4', '5', '6', '12' ,'15']
  171. for index in range(len(appType)):
  172. # qps = count_qps(url, appType[index])
  173. print(appType[index])