manual_request_json.py 2.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import datetime
  2. import json
  3. import requests
  4. import simplejson
  5. from ai_strategy_request_func import ai_strategy_request_parse
  6. def main():
  7. # request_dict = {'video': [{'material_type': 1, 'video_url': 'http://ali-ad.a.yximgs.com/mediacloud/ad_creator/ad_creator_video/peaGh_2xKcxNW4Gtmb210cfbUb3QEbkCA8YaDwl6onc8_qPjHwVFLL_WQc-lHNzH.mp4', 'photo_id': 5229242159171981492, 'signature': '2442bf1940777ec04440b1d9f4d1d66c', 'stat_date': '2020-12-11 20:03:32', 'creative_count': 0, 'channel_type': 1, 'imageList': ['e2e2d8b64c3da90a32ba6d7f1396ae01', '1c193dbcc72a1ead668b4c399c94142f', 'fda49b6fc95451d211c7339a0d361bff', '720bbc330fc61c54167feef0426adb42', 'de74f062c1433ea3340f19a88a3a3628', 'bb7aee58a2d07ba33910dac216d58bd3', '87574be5b74c50c70ebb9014187f779c', '186eaac7ecfe0be1aecd569ac19349b8']}, {'material_type':2, 'video_url': 'http://ali-ad.a.yximgs.com/mediacloud/ad_creator/ad_creator_video/4j0wlTiFe-TKwAD-8W8whzYZ3ghtSPlx4hYRU212iV7cFw7M36OxSflONsDGEN4c.mp4', 'photo_id': 5202783510598791765, 'signature': '7eacc92a7bf7120868d8c84b0ccad670', 'stat_date': '2020-12-11 20:03:35', 'creative_count': 0, 'channel_type': 1, 'imageList': ['6fc228a2d403f3ab7ff085d8c64b0202', 'e565a5284cb6459f50c108cab46b4d42', '2c817cfd791a34329e3aa351fb494b23', 'c41ccce20eec32b1761d871c6055d61b', 'b48ed29861ce67bea8cca855ef4968c7', '29c6d796c798e809cacc39e5ceb5b68e', '28f32370904f7a990e6285d8c3fb071e', '4211456622d068e1a9689d510f212016']}],
  8. # 'operation_type': 1,
  9. # 'account_id': 9743727,
  10. # 'ai_strategy_remark': '程序化跑量素材',
  11. # 'campaign_info': {'campaign_id': None,
  12. # 'campaign_name': '户9-上下滑&信息流-程序化跑量素材-剪辑-低价-低价包邮-活动-年龄18岁以上-单出价-' + str(datetime.datetime.now())},
  13. # 'group_info': {'group_name': '户9-上下滑&信息流-程序化跑量素材-剪辑-低价-低价包邮-活动-年龄18岁以上-单出价-' + str(datetime.datetime.now()),
  14. # 'begin_time': '2021-01-30',
  15. # 'unit_type': 7},
  16. # 'creative_info': {'is_sticky': 0}}
  17. #
  18. # res = ai_strategy_request_parse(request_dict)
  19. # print(res)
  20. # data = json.dumps({"account_id": 23212})
  21. data = json.dumps({"account_id": 9864909})
  22. url = 'http://192.168.1.193:31012/ai_programme_new_material'
  23. # url = 'http://192.168.1.193:31012/ai_programme_high_quality_material'
  24. # url = 'http://192.168.1.193:31012/ai_historical_missing_material'
  25. request = requests.post(url, data)
  26. print(request.text)
  27. res_data = simplejson.loads(request.text)
  28. print(res_data)
  29. if __name__ == '__main__':
  30. print(main())