qd_mall.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # -*- coding: utf-8 -*-
  2. # Author : Charley
  3. # Python : 3.10.8
  4. # Date : 2025/7/2 16:02
  5. from loguru import logger
  6. from qd_toy_spider.utils import request_get_data
  7. # url = "https://api.qiandao.com/shelf-web/list-home-recommender"
  8. # params = {
  9. # "offset": "0",
  10. # "limit": "20",
  11. # "cmd": "b2c_homepage_feed",
  12. # "name": "",
  13. # "project": "",
  14. # "recommendTagIds%5B%5D": [
  15. # "307",
  16. # "682",
  17. # "302",
  18. # "305",
  19. # "1163995",
  20. # "50124",
  21. # "303",
  22. # "1153225",
  23. # "525",
  24. # "57703",
  25. # "1285426",
  26. # "313",
  27. # "671",
  28. # "589",
  29. # "590",
  30. # "10210",
  31. # "1206",
  32. # "1387773",
  33. # "1424125",
  34. # "1270645",
  35. # "1285466",
  36. # "42474"
  37. # ],
  38. # "fixedShelfId": "568851822601738191",
  39. # "withLive": "true"
  40. # }
  41. # [
  42. # 307,
  43. # 682,
  44. # 302,
  45. # 305,
  46. # 1163995,
  47. # 50124,
  48. # 303,
  49. # 1153225,
  50. # 525,
  51. # 57703,
  52. # 1285426,
  53. # 313,
  54. # 671,
  55. # 589,
  56. # 590,
  57. # 10210,
  58. # 1206,
  59. # 1387773,
  60. # 1424125,
  61. # 1270645,
  62. # 1285466,
  63. # 42474
  64. # ]
  65. #
  66. # # 请求参数
  67. # params = {
  68. # "offset": 0,
  69. # "limit": 20,
  70. # "cmd": "b2c_homepage_feed",
  71. # "name": "",
  72. # "project": "",
  73. # "recommendTagIds": [
  74. # 49695,
  75. # 1572285,
  76. # 1542944,
  77. # 1541805,
  78. # 1515843,
  79. # 1436291,
  80. # 1422849,
  81. # 1398583,
  82. # 1132249,
  83. # 1000375
  84. # ],
  85. # "fixedShelfId": 568851822601738191,
  86. # "withLive": "true"
  87. # }
  88. #
  89. # url = "https://api.qiandao.com/shelf-web/list-home-recommender"
  90. url = "https://api.qiandao.com/shelf-web/list-home-recommender"
  91. params = {
  92. "limit": 10,
  93. "offset": 0,
  94. "cmd": "b2c_homepage_feed",
  95. "project": "channel",
  96. "name": "manghe",
  97. "type": [
  98. "BLIND_BOX_MACHINE",
  99. "KUJI",
  100. "NEW_LUCKY_BAG",
  101. "B2C"
  102. ],
  103. "typeIds": 15,
  104. "channelId": 397228442736842784,
  105. "screenName": "推荐"
  106. }
  107. # 发送 GET 请求
  108. try:
  109. response = request_get_data(logger, url, params)
  110. print(response)
  111. except Exception as e:
  112. logger.error(f"Request failed: {e}")