function.py 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. """
  2. @author: luojunhui
  3. """
  4. import json
  5. import requests
  6. ARTICLE_URL = {
  7. "gh_b181786a6c8c": {
  8. "title": "武汉一女教师,新婚不久怀孕,孩子出生后,丈夫竟脸色大变,扭头就走再也没回来",
  9. "coverUrl": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/ibXsPafGBbCFrvlLcKoAg0tLelW3dwC9A8jXibxfuy57smOv3f1qPrteWUBh0yXbIgxu3CHmicq7BvTBYZztUBK4g/640?wx_fmt=jpeg",
  10. "miniAppId": "",
  11. "miniPagePath": "",
  12. "newsDescription": "在一个美丽的夏天,武汉一家幼儿师范学校的女教师邹翃燕与她相恋多年的男友正式结婚,并在蜜月期间怀孕。对于即将到来的新生命,夫妻二人充满了期待。然而,幸福的表面下,却暗藏着即将爆发的危机。",
  13. "msgType": 2,
  14. "miniVideoId": None,
  15. "newsUrl": "http://mp.weixin.qq.com/s?__biz=MzkzMjczNDAwNQ==&mid=2247486513&idx=2&sn=55e084d04b89b0431c2818b5c5de4e06&chksm=c36cd45672253a2f917c876bf96a922c401397c28c7906bc2b232b199ef57b558b1499cfeb1d&scene=126&sessionid=1732181447#rd"
  16. },
  17. "gh_68e7fdc09fe4": {
  18. "title": "吉林大爷挖地窖突遇毒蛇,正要挥锄头猛砸,却发现毒蛇一动不动,仔细一看愣住了",
  19. "coverUrl": "https://mmbiz.qpic.cn/sz_mmbiz_png/Y3FEhQujOMcTHVRPOlMHfGgvVrCemtOyv0k2R4LvacEFGvicNU7WKbllJXGzUCLNcp31XViayxSAgHYPy6qI2kvg/640?wx_fmt=png&from=appmsg",
  20. "miniAppId": "",
  21. "miniPagePath": "",
  22. "newsDescription": "吉林古村落的一个凛冽寒冬清晨,老王爷挑着锄头,准备去后山的一块地里挖地窖,以储备粮食过冬。天空阴沉,冷风凛冽。",
  23. "msgType": 2,
  24. "miniVideoId": None,
  25. "newsUrl": "http://mp.weixin.qq.com/s?__biz=MzkzNDcyMzU5NA==&mid=2247487353&idx=4&sn=f7f76d71ccadfe4d6314be543b65c21c&chksm=c3290771a15f41c744ce0ed170ccb20184a072eccf202954ba55e94dc48733f4998e70b60ecb&scene=126&sessionid=1732181448#rd"
  26. },
  27. "gh_93e00e187787": {
  28. "title": "上海第一批女光棍进了养老院,如今的生活再次印证了费翔所说的话",
  29. "coverUrl": "https://mmbiz.qpic.cn/sz_mmbiz_jpg/cxdiaJictvhMIaTeCqnibicYZ3WmaYcKt4FzmyJVL2OY9HiaOahtppYoKkJYdIpq97ZiblKUK1iaib6MNSS6jIc0iaDbicaQ/640?wx_fmt=jpeg&quot",
  30. "miniAppId": "",
  31. "miniPagePath": "",
  32. "msgType": 2,
  33. "newsDescription": "随着社会的不断发展,越来越多的人开始重新审视婚姻的意义与价值。尤其是在经济发达的大城市,诸如上海,许多女性选择了不婚的生活方式。",
  34. "miniVideoId": None,
  35. "newsUrl": "http://mp.weixin.qq.com/s?__biz=MzkwNTYxNDQ3Ng==&mid=2247490818&idx=6&sn=764d76c364bc8f84ba4d5d31166d0ceb&chksm=c146798be24c7eabad21f771a802d4b49dcbf783fd7ded00081d5e3bb36ad83960581b45f39d&scene=126&sessionid=1732181449#rd"
  36. },
  37. "gh_ac43e43b253b": {
  38. "newsUrl": "http://mp.weixin.qq.com/s?__biz=MzkwNjYxMjM1Mg==&mid=2247493665&idx=6&sn=4ce57ab8b0f95f61f29982bc10a9c783&chksm=c143b9560e3b58ce2709891ef85978b4b16bdcce27eb64bf075d20a8fda39a70b62c37ebecac&scene=126&sessionid=1732181450#rd",
  39. "title": "上海第一批女光棍进了养老院,如今的生活再次印证了费翔所说的话",
  40. "coverUrl": "https://mmbiz.qpic.cn/mmbiz_jpg/3KjSicS7TR1CnuV8biapgTkw9PbmDqpPpJ5Xia4YtSPpbso4yplxrzurKLCgoIcOL09dEJZ87RUgic2uica1D40qFkQ/640?wx_fmt=jpeg&quot",
  41. "miniAppId": "",
  42. "miniPagePath": "",
  43. "msgType": 2,
  44. "newsDescription": "随着社会的不断发展,越来越多的人开始重新审视婚姻的意义与价值。尤其是在经济发达的大城市,诸如上海,许多女性选择了不婚的生活方式。这一代女性在年轻时,追求个人自由和发展,躲避传统婚姻可能带来的复杂家庭关系和经济负担。然而,当这些女性逐渐步入老年时,她们的生活状况引发了社会的广泛关注。",
  45. "miniVideoId": None,
  46. },
  47. "gh_77f36c109fb1": {
  48. "newsUrl": "http://mp.weixin.qq.com/s?__biz=Mzk0OTcyNjYxNg==&mid=2247487671&idx=6&sn=46972f502826ae78b49d38cb8b5734a7&chksm=c21cb24d85eb69df13f601fae1c79b648eb965bbd15202bae09ad45f2e13c090eaded8201ec2&scene=126&sessionid=1732181451#rd",
  49. "title": "上海第一批女光棍进了养老院,如今的生活再次印证了费翔所说的话",
  50. "coverUrl": "https://mmbiz.qpic.cn/mmbiz_jpg/3KjSicS7TR1CnuV8biapgTkw9PbmDqpPpJ5Xia4YtSPpbso4yplxrzurKLCgoIcOL09dEJZ87RUgic2uica1D40qFkQ/640?wx_fmt=jpeg&quot",
  51. "miniAppId": "",
  52. "miniPagePath": "",
  53. "newsDescription": "随着社会的不断发展,越来越多的人开始重新审视婚姻的意义与价值。尤其是在经济发达的大城市,诸如上海,许多女性选择了不婚的生活方式。",
  54. "msgType": 2,
  55. "miniVideoId": None,
  56. },
  57. "gh_1ee2e1b39ccf": {
  58. "newsUrl": "http://mp.weixin.qq.com/s?__biz=MzkzNTUwNzYzMQ==&mid=2247494791&idx=6&sn=3621cd0b0a0e70f242269912280c4e87&chksm=c315ab4535a9286da842c60585367bd5993c44b68a8b14680514f63bb2e0194d73ca6d93a720&scene=126&sessionid=1732181452#rd",
  59. "title": "上海第一批女光棍进了养老院,如今的生活再次印证了费翔所说的话",
  60. "coverUrl": "https://mmbiz.qpic.cn/mmbiz_jpg/3KjSicS7TR1CnuV8biapgTkw9PbmDqpPpJ5Xia4YtSPpbso4yplxrzurKLCgoIcOL09dEJZ87RUgic2uica1D40qFkQ/640?wx_fmt=jpeg&quot",
  61. "miniAppId": "",
  62. "miniPagePath": "",
  63. "newsDescription": "随着社会的不断发展,越来越多的人开始重新审视婚姻的意义与价值。尤其是在经济发达的大城市,诸如上海,许多女性选择了不婚的生活方式。",
  64. "msgType": 2,
  65. "miniVideoId": None
  66. },
  67. "gh_d3f039c9db2b": {
  68. "newsUrl": "https://mp.weixin.qq.com/s?__biz=Mzk0Mjg2NTY3Ng==&mid=2247485826&idx=5&sn=1f5179a1a8606d67ddcab23eb5a877e6&chksm=c20af47014cf9b6a7ae8528ea2b1e4627268adf9b54c0caab32d22fd031ae53585d181d461de&scene=126&sessionid=1732190326#rd",
  69. "title": "孙中山和宋庆铃的一张真实合影!真是太美了,注意看宋庆龄的鞋子",
  70. "coverUrl": "https://mmbiz.qpic.cn/mmbiz_jpg/NsW3mRgdmsjOzxnAnV5AJ2C1ZGInEaZppglccorr9icnfzrquO0kYmiaVPLBZDI3Wo98q05jXlsZncIIIxdOdkOg/640?wx_fmt=jpeg&quot",
  71. "miniAppId": "",
  72. "miniPagePath": "",
  73. "newsDescription": "孙中山和宋庆龄是中国近代史上备受瞩目的历史人物,他们不仅在政治领域有着深远的影响,也因其特殊的个人关系而广为人知。",
  74. "msgType": 2,
  75. "miniVideoId": None
  76. }
  77. }
  78. ACCOUNT_VIDEO = {
  79. "gh_93e00e187787": [
  80. {
  81. "groupIndex": 0,
  82. "groupVideoList": [
  83. {
  84. "videoIndex": 1,
  85. "videoId": "13724870",
  86. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13724870%26fromGzh%3D1%26rootShareId%3Dcadfd934-f3ad-4266-812f-7a693bf079e8%26shareId%3Dcadfd934-f3ad-4266-812f-7a693bf079e8%26rootSourceId%3Dtouliu_tencentgzh_20240909_13724870_1"
  87. },
  88. {
  89. "videoIndex": 2,
  90. "videoId": "20463342",
  91. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20463342%26su%3D66857951%26fromGzh%3D1%26index%3D1%26publishType%3D1%26rootSourceId%3DGzhTouLiu_Articles_gh_93e00e187787_c6fa160eead7e53bcf2fb783f0369b9e"
  92. }
  93. ]
  94. },
  95. {
  96. "groupIndex": 1,
  97. "groupVideoList": [
  98. {
  99. "videoIndex": 1,
  100. "videoId": "13724870",
  101. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13724870%26fromGzh%3D1%26rootShareId%3Dcadfd934-f3ad-4266-812f-7a693bf079e8%26shareId%3Dcadfd934-f3ad-4266-812f-7a693bf079e8%26rootSourceId%3Dtouliu_tencentgzh_20240909_13724870_1"
  102. },
  103. {
  104. "videoIndex": 2,
  105. "videoId": "20463342",
  106. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20463342%26su%3D66857951%26fromGzh%3D1%26index%3D1%26publishType%3D1%26rootSourceId%3DGzhTouLiu_Articles_gh_93e00e187787_c6fa160eead7e53bcf2fb783f0369b9e"
  107. }
  108. ]
  109. },
  110. {
  111. "groupIndex": 2,
  112. "groupVideoList": [
  113. {
  114. "videoIndex": 1,
  115. "videoId": "13724870",
  116. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13724870%26fromGzh%3D1%26rootShareId%3Dcadfd934-f3ad-4266-812f-7a693bf079e8%26shareId%3Dcadfd934-f3ad-4266-812f-7a693bf079e8%26rootSourceId%3Dtouliu_tencentgzh_20240909_13724870_1"
  117. },
  118. {
  119. "videoIndex": 2,
  120. "videoId": "20463342",
  121. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20463342%26su%3D66857951%26fromGzh%3D1%26index%3D1%26publishType%3D1%26rootSourceId%3DGzhTouLiu_Articles_gh_93e00e187787_c6fa160eead7e53bcf2fb783f0369b9e"
  122. }
  123. ]
  124. },
  125. {
  126. "groupIndex": 3,
  127. "groupVideoList": [
  128. {
  129. "videoIndex": 1,
  130. "videoId": "13724870",
  131. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13724870%26fromGzh%3D1%26rootShareId%3Dcadfd934-f3ad-4266-812f-7a693bf079e8%26shareId%3Dcadfd934-f3ad-4266-812f-7a693bf079e8%26rootSourceId%3Dtouliu_tencentgzh_20240909_13724870_1"
  132. },
  133. {
  134. "videoIndex": 2,
  135. "videoId": "20463342",
  136. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20463342%26su%3D66857951%26fromGzh%3D1%26index%3D1%26publishType%3D1%26rootSourceId%3DGzhTouLiu_Articles_gh_93e00e187787_c6fa160eead7e53bcf2fb783f0369b9e"
  137. }
  138. ]
  139. },
  140. {
  141. "groupIndex": 4,
  142. "groupVideoList": [
  143. {
  144. "videoIndex": 1,
  145. "videoId": "13817005",
  146. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13817005%26su%3D3087312%26fromGzh%3D1%26index%3D1%26publishType%3D1%26rootSourceId%3DGzhTouLiu_Articles_gh_93e00e187787_4c4b5ce43d988f7cb524b4dff8c01b9f"
  147. },
  148. {
  149. "videoIndex": 2,
  150. "videoId": "26348326",
  151. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D26348326%26fromGzh%3D1%26rootShareId%3D4135f63d-a35b-4081-e012-744d85426dd5%26shareId%3D4135f63d-a35b-4081-e012-744d85426dd5%26rootSourceId%3Dtouliu_tencentgzh_20240911_26348326_1"
  152. }
  153. ]
  154. }
  155. ],
  156. "gh_ac43e43b253b": [
  157. {
  158. "groupIndex": 0,
  159. "groupVideoList": [
  160. {
  161. "videoIndex": 1,
  162. "videoId": "23177732",
  163. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D23177732%26fromGzh%3D1%26rootShareId%3D13315928-351b-44f5-c7b9-c8734235df9c%26shareId%3D13315928-351b-44f5-c7b9-c8734235df9c%26rootSourceId%3Dtouliu_tencentgzh_20240812_23177732_1"
  164. },
  165. {
  166. "videoIndex": 2,
  167. "videoId": "23231548",
  168. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D23231548%26fromGzh%3D1%26rootShareId%3Da7cfdbcb-43d6-4c6c-cd4c-aafc6e979426%26shareId%3Da7cfdbcb-43d6-4c6c-cd4c-aafc6e979426%26rootSourceId%3Dtouliu_tencentgzh_20240812_23231548_1"
  169. }
  170. ]
  171. },
  172. {
  173. "groupIndex": 1,
  174. "groupVideoList": [
  175. {
  176. "videoIndex": 1,
  177. "videoId": "23177732",
  178. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D23177732%26fromGzh%3D1%26rootShareId%3D13315928-351b-44f5-c7b9-c8734235df9c%26shareId%3D13315928-351b-44f5-c7b9-c8734235df9c%26rootSourceId%3Dtouliu_tencentgzh_20240812_23177732_1"
  179. },
  180. {
  181. "videoIndex": 2,
  182. "videoId": "23231548",
  183. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D23231548%26fromGzh%3D1%26rootShareId%3Da7cfdbcb-43d6-4c6c-cd4c-aafc6e979426%26shareId%3Da7cfdbcb-43d6-4c6c-cd4c-aafc6e979426%26rootSourceId%3Dtouliu_tencentgzh_20240812_23231548_1"
  184. }
  185. ]
  186. },
  187. {
  188. "groupIndex": 2,
  189. "groupVideoList": [
  190. {
  191. "videoIndex": 1,
  192. "videoId": "23177732",
  193. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D23177732%26fromGzh%3D1%26rootShareId%3D13315928-351b-44f5-c7b9-c8734235df9c%26shareId%3D13315928-351b-44f5-c7b9-c8734235df9c%26rootSourceId%3Dtouliu_tencentgzh_20240812_23177732_1"
  194. },
  195. {
  196. "videoIndex": 2,
  197. "videoId": "23231548",
  198. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D23231548%26fromGzh%3D1%26rootShareId%3Da7cfdbcb-43d6-4c6c-cd4c-aafc6e979426%26shareId%3Da7cfdbcb-43d6-4c6c-cd4c-aafc6e979426%26rootSourceId%3Dtouliu_tencentgzh_20240812_23231548_1"
  199. }
  200. ]
  201. },
  202. {
  203. "groupIndex": 3,
  204. "groupVideoList": [
  205. {
  206. "videoIndex": 1,
  207. "videoId": "23177732",
  208. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D23177732%26fromGzh%3D1%26rootShareId%3D13315928-351b-44f5-c7b9-c8734235df9c%26shareId%3D13315928-351b-44f5-c7b9-c8734235df9c%26rootSourceId%3Dtouliu_tencentgzh_20240812_23177732_1"
  209. },
  210. {
  211. "videoIndex": 2,
  212. "videoId": "23231548",
  213. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D23231548%26fromGzh%3D1%26rootShareId%3Da7cfdbcb-43d6-4c6c-cd4c-aafc6e979426%26shareId%3Da7cfdbcb-43d6-4c6c-cd4c-aafc6e979426%26rootSourceId%3Dtouliu_tencentgzh_20240812_23231548_1"
  214. }
  215. ]
  216. },
  217. {
  218. "groupIndex": 4,
  219. "groupVideoList": [
  220. {
  221. "videoIndex": 1,
  222. "videoId": "23177732",
  223. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D23177732%26fromGzh%3D1%26rootShareId%3D13315928-351b-44f5-c7b9-c8734235df9c%26shareId%3D13315928-351b-44f5-c7b9-c8734235df9c%26rootSourceId%3Dtouliu_tencentgzh_20240812_23177732_1"
  224. },
  225. {
  226. "videoIndex": 2,
  227. "videoId": "23231548",
  228. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D23231548%26fromGzh%3D1%26rootShareId%3Da7cfdbcb-43d6-4c6c-cd4c-aafc6e979426%26shareId%3Da7cfdbcb-43d6-4c6c-cd4c-aafc6e979426%26rootSourceId%3Dtouliu_tencentgzh_20240812_23231548_1"
  229. }
  230. ]
  231. }
  232. ],
  233. "gh_68e7fdc09fe4": [
  234. {
  235. "groupIndex": 0,
  236. "groupVideoList": [
  237. {
  238. "videoIndex": 1,
  239. "videoId": "15527307",
  240. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D15527307%26fromGzh%3D1%26rootShareId%3Da9c0837d-ffc1-47a4-8150-36cc3bada3b7%26shareId%3Da9c0837d-ffc1-47a4-8150-36cc3bada3b7%26rootSourceId%3Dtouliu_tencentgzh_20240927_15527307_2"
  241. },
  242. {
  243. "videoIndex": 2,
  244. "videoId": "26348326",
  245. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D26348326%26fromGzh%3D1%26rootShareId%3D616c3fe4-5dd8-4d2a-9567-4e14d344773d%26shareId%3D616c3fe4-5dd8-4d2a-9567-4e14d344773d%26rootSourceId%3Dtouliu_tencentgzh_20240924_26348326_1"
  246. }
  247. ]
  248. },
  249. {
  250. "groupIndex": 1,
  251. "groupVideoList": [
  252. {
  253. "videoIndex": 1,
  254. "videoId": "15527307",
  255. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D15527307%26fromGzh%3D1%26rootShareId%3Da9c0837d-ffc1-47a4-8150-36cc3bada3b7%26shareId%3Da9c0837d-ffc1-47a4-8150-36cc3bada3b7%26rootSourceId%3Dtouliu_tencentgzh_20240927_15527307_2"
  256. },
  257. {
  258. "videoIndex": 2,
  259. "videoId": "12794884",
  260. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D12794884%26fromGzh%3D1%26rootShareId%3D9f1851c8-c663-461f-bfc5-5fbe611289b2%26shareId%3D9f1851c8-c663-461f-bfc5-5fbe611289b2%26rootSourceId%3Dtouliu_tencentgzh_20241020_12794884_1516c852"
  261. }
  262. ]
  263. },
  264. {
  265. "groupIndex": 2,
  266. "groupVideoList": [
  267. {
  268. "videoIndex": 1,
  269. "videoId": "15527307",
  270. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D15527307%26fromGzh%3D1%26rootShareId%3Da9c0837d-ffc1-47a4-8150-36cc3bada3b7%26shareId%3Da9c0837d-ffc1-47a4-8150-36cc3bada3b7%26rootSourceId%3Dtouliu_tencentgzh_20240927_15527307_2"
  271. },
  272. {
  273. "videoIndex": 2,
  274. "videoId": "12794884",
  275. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D12794884%26fromGzh%3D1%26rootShareId%3D9f1851c8-c663-461f-bfc5-5fbe611289b2%26shareId%3D9f1851c8-c663-461f-bfc5-5fbe611289b2%26rootSourceId%3Dtouliu_tencentgzh_20241020_12794884_1516c852"
  276. }
  277. ]
  278. },
  279. {
  280. "groupIndex": 3,
  281. "groupVideoList": [
  282. {
  283. "videoIndex": 1,
  284. "videoId": "15527307",
  285. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D15527307%26fromGzh%3D1%26rootShareId%3Da9c0837d-ffc1-47a4-8150-36cc3bada3b7%26shareId%3Da9c0837d-ffc1-47a4-8150-36cc3bada3b7%26rootSourceId%3Dtouliu_tencentgzh_20240927_15527307_2"
  286. },
  287. {
  288. "videoIndex": 2,
  289. "videoId": "12794884",
  290. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D12794884%26fromGzh%3D1%26rootShareId%3D9f1851c8-c663-461f-bfc5-5fbe611289b2%26shareId%3D9f1851c8-c663-461f-bfc5-5fbe611289b2%26rootSourceId%3Dtouliu_tencentgzh_20241020_12794884_1516c852"
  291. }
  292. ]
  293. },
  294. {
  295. "groupIndex": 4,
  296. "groupVideoList": [
  297. {
  298. "videoIndex": 1,
  299. "videoId": "1275943",
  300. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D1275943%26su%3D6457928%26fromGzh%3D1%26index%3D1%26publishType%3D1%26rootSourceId%3DGzhTouLiu_Articles_gh_68e7fdc09fe4_87aa757fa00fd1d9d1b77a3d93fd0d95"
  301. },
  302. {
  303. "videoIndex": 2,
  304. "videoId": "26348326",
  305. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D26348326%26fromGzh%3D1%26rootShareId%3D616c3fe4-5dd8-4d2a-9567-4e14d344773d%26shareId%3D616c3fe4-5dd8-4d2a-9567-4e14d344773d%26rootSourceId%3Dtouliu_tencentgzh_20240924_26348326_1"
  306. }
  307. ]
  308. }
  309. ],
  310. "gh_77f36c109fb1": [
  311. {
  312. "groupIndex": 0,
  313. "groupVideoList": [
  314. {
  315. "videoIndex": 1,
  316. "videoId": "20463342",
  317. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20463342%26su%3D66857951%26fromGzh%3D1%26index%3D1%26publishType%3D1%26rootSourceId%3DGzhTouLiu_Articles_gh_77f36c109fb1_93c9eae581f8f26ecd3fb4348e8a3c42"
  318. },
  319. {
  320. "videoIndex": 2,
  321. "videoId": "12794884",
  322. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D12794884%26fromGzh%3D1%26rootShareId%3D7e3482bf-0ee2-493c-8857-b603dbd8c19f%26shareId%3D7e3482bf-0ee2-493c-8857-b603dbd8c19f%26rootSourceId%3Dtouliu_tencentgzh_20241012_12794884_6"
  323. }
  324. ]
  325. },
  326. {
  327. "groupIndex": 1,
  328. "groupVideoList": [
  329. {
  330. "videoIndex": 1,
  331. "videoId": "20463342",
  332. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20463342%26su%3D66857951%26fromGzh%3D1%26index%3D1%26publishType%3D1%26rootSourceId%3DGzhTouLiu_Articles_gh_77f36c109fb1_93c9eae581f8f26ecd3fb4348e8a3c42"
  333. },
  334. {
  335. "videoIndex": 2,
  336. "videoId": "12794884",
  337. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D12794884%26fromGzh%3D1%26rootShareId%3D7e3482bf-0ee2-493c-8857-b603dbd8c19f%26shareId%3D7e3482bf-0ee2-493c-8857-b603dbd8c19f%26rootSourceId%3Dtouliu_tencentgzh_20241012_12794884_6"
  338. }
  339. ]
  340. },
  341. {
  342. "groupIndex": 2,
  343. "groupVideoList": [
  344. {
  345. "videoIndex": 1,
  346. "videoId": "12177006",
  347. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D12177006%26fromGzh%3D1%26rootShareId%3Db65f7dcd-a048-4f2d-bffd-b19d78d3e369%26shareId%3Db65f7dcd-a048-4f2d-bffd-b19d78d3e369%26rootSourceId%3Dtouliu_tencentgzh_20241011_12177006_4"
  348. },
  349. {
  350. "videoIndex": 2,
  351. "videoId": "20657746",
  352. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20657746%26fromGzh%3D1%26rootShareId%3D955afc67-1424-4e0c-9ef7-a15da2dc5b85%26shareId%3D955afc67-1424-4e0c-9ef7-a15da2dc5b85%26rootSourceId%3Dtouliu_tencentgzh_20241025_20657746_afb516f7"
  353. }
  354. ]
  355. },
  356. {
  357. "groupIndex": 3,
  358. "groupVideoList": [
  359. {
  360. "videoIndex": 1,
  361. "videoId": "12177006",
  362. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D12177006%26fromGzh%3D1%26rootShareId%3Db65f7dcd-a048-4f2d-bffd-b19d78d3e369%26shareId%3Db65f7dcd-a048-4f2d-bffd-b19d78d3e369%26rootSourceId%3Dtouliu_tencentgzh_20241011_12177006_4"
  363. },
  364. {
  365. "videoIndex": 2,
  366. "videoId": "20657746",
  367. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20657746%26fromGzh%3D1%26rootShareId%3D955afc67-1424-4e0c-9ef7-a15da2dc5b85%26shareId%3D955afc67-1424-4e0c-9ef7-a15da2dc5b85%26rootSourceId%3Dtouliu_tencentgzh_20241025_20657746_afb516f7"
  368. }
  369. ]
  370. },
  371. {
  372. "groupIndex": 4,
  373. "groupVideoList": [
  374. {
  375. "videoIndex": 1,
  376. "videoId": "12177006",
  377. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D12177006%26fromGzh%3D1%26rootShareId%3Db65f7dcd-a048-4f2d-bffd-b19d78d3e369%26shareId%3Db65f7dcd-a048-4f2d-bffd-b19d78d3e369%26rootSourceId%3Dtouliu_tencentgzh_20241011_12177006_4"
  378. },
  379. {
  380. "videoIndex": 2,
  381. "videoId": "12028615",
  382. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D12028615%26fromGzh%3D1%26rootShareId%3D67720b37-0553-4332-9455-370c7fb72b6c%26shareId%3D67720b37-0553-4332-9455-370c7fb72b6c%26rootSourceId%3Dtouliu_tencentgzh_20241025_12028615_d2b55a5c"
  383. }
  384. ]
  385. }
  386. ],
  387. "gh_b181786a6c8c": [
  388. {
  389. "groupIndex": 0,
  390. "groupVideoList": [
  391. {
  392. "videoIndex": 1,
  393. "videoId": "13817005",
  394. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13817005%26fromGzh%3D1%26rootShareId%3Dfd539b5c-8f28-49a9-c6dd-a9ecb57d8582%26shareId%3Dfd539b5c-8f28-49a9-c6dd-a9ecb57d8582%26rootSourceId%3Dtouliu_tencentgzh_20240925_13817005_2"
  395. },
  396. {
  397. "videoIndex": 2,
  398. "videoId": "20657746",
  399. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20657746%26fromGzh%3D1%26rootShareId%3Df73b12db-d0d8-4af4-9935-f9888ce6b7bd%26shareId%3Df73b12db-d0d8-4af4-9935-f9888ce6b7bd%26rootSourceId%3Dtouliu_tencentgzh_20240731_20657746_1"
  400. }
  401. ]
  402. },
  403. {
  404. "groupIndex": 1,
  405. "groupVideoList": [
  406. {
  407. "videoIndex": 1,
  408. "videoId": "13817005",
  409. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13817005%26fromGzh%3D1%26rootShareId%3Dfd539b5c-8f28-49a9-c6dd-a9ecb57d8582%26shareId%3Dfd539b5c-8f28-49a9-c6dd-a9ecb57d8582%26rootSourceId%3Dtouliu_tencentgzh_20240925_13817005_2"
  410. },
  411. {
  412. "videoIndex": 2,
  413. "videoId": "20657746",
  414. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20657746%26fromGzh%3D1%26rootShareId%3Df73b12db-d0d8-4af4-9935-f9888ce6b7bd%26shareId%3Df73b12db-d0d8-4af4-9935-f9888ce6b7bd%26rootSourceId%3Dtouliu_tencentgzh_20240731_20657746_1"
  415. }
  416. ]
  417. },
  418. {
  419. "groupIndex": 2,
  420. "groupVideoList": [
  421. {
  422. "videoIndex": 1,
  423. "videoId": "13817005",
  424. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13817005%26fromGzh%3D1%26rootShareId%3Dfd539b5c-8f28-49a9-c6dd-a9ecb57d8582%26shareId%3Dfd539b5c-8f28-49a9-c6dd-a9ecb57d8582%26rootSourceId%3Dtouliu_tencentgzh_20240925_13817005_2"
  425. },
  426. {
  427. "videoIndex": 2,
  428. "videoId": "20657746",
  429. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20657746%26fromGzh%3D1%26rootShareId%3Df73b12db-d0d8-4af4-9935-f9888ce6b7bd%26shareId%3Df73b12db-d0d8-4af4-9935-f9888ce6b7bd%26rootSourceId%3Dtouliu_tencentgzh_20240731_20657746_1"
  430. }
  431. ]
  432. },
  433. {
  434. "groupIndex": 3,
  435. "groupVideoList": [
  436. {
  437. "videoIndex": 1,
  438. "videoId": "13817005",
  439. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13817005%26fromGzh%3D1%26rootShareId%3Dfd539b5c-8f28-49a9-c6dd-a9ecb57d8582%26shareId%3Dfd539b5c-8f28-49a9-c6dd-a9ecb57d8582%26rootSourceId%3Dtouliu_tencentgzh_20240925_13817005_2"
  440. },
  441. {
  442. "videoIndex": 2,
  443. "videoId": "20657746",
  444. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20657746%26fromGzh%3D1%26rootShareId%3Df73b12db-d0d8-4af4-9935-f9888ce6b7bd%26shareId%3Df73b12db-d0d8-4af4-9935-f9888ce6b7bd%26rootSourceId%3Dtouliu_tencentgzh_20240731_20657746_1"
  445. }
  446. ]
  447. },
  448. {
  449. "groupIndex": 4,
  450. "groupVideoList": [
  451. {
  452. "videoIndex": 1,
  453. "videoId": "13817005",
  454. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13817005%26fromGzh%3D1%26rootShareId%3Dfd539b5c-8f28-49a9-c6dd-a9ecb57d8582%26shareId%3Dfd539b5c-8f28-49a9-c6dd-a9ecb57d8582%26rootSourceId%3Dtouliu_tencentgzh_20240925_13817005_2"
  455. },
  456. {
  457. "videoIndex": 2,
  458. "videoId": "20657746",
  459. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D20657746%26fromGzh%3D1%26rootShareId%3Df73b12db-d0d8-4af4-9935-f9888ce6b7bd%26shareId%3Df73b12db-d0d8-4af4-9935-f9888ce6b7bd%26rootSourceId%3Dtouliu_tencentgzh_20240731_20657746_1"
  460. }
  461. ]
  462. }
  463. ],
  464. "gh_1ee2e1b39ccf": [
  465. {
  466. "groupIndex": 0,
  467. "groupVideoList": [
  468. {
  469. "videoIndex": 1,
  470. "videoId": "13724870",
  471. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13724870%26fromGzh%3D1%26rootShareId%3D0d8768d3-d325-4eb7-da0a-083eedeb729d%26shareId%3D0d8768d3-d325-4eb7-da0a-083eedeb729d%26rootSourceId%3Dtouliu_tencentgzh_20241008_13724870_7"
  472. },
  473. {
  474. "videoIndex": 2,
  475. "videoId": "26348326",
  476. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D26348326%26fromGzh%3D1%26rootShareId%3D21456cd7-8554-473c-8ad3-a7ea4b361071%26shareId%3D21456cd7-8554-473c-8ad3-a7ea4b361071%26rootSourceId%3Dtouliu_tencentgzh_20241008_26348326_1"
  477. }
  478. ]
  479. },
  480. {
  481. "groupIndex": 1,
  482. "groupVideoList": [
  483. {
  484. "videoIndex": 1,
  485. "videoId": "13724870",
  486. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13724870%26fromGzh%3D1%26rootShareId%3D0d8768d3-d325-4eb7-da0a-083eedeb729d%26shareId%3D0d8768d3-d325-4eb7-da0a-083eedeb729d%26rootSourceId%3Dtouliu_tencentgzh_20241008_13724870_7"
  487. },
  488. {
  489. "videoIndex": 2,
  490. "videoId": "26348326",
  491. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D26348326%26fromGzh%3D1%26rootShareId%3D21456cd7-8554-473c-8ad3-a7ea4b361071%26shareId%3D21456cd7-8554-473c-8ad3-a7ea4b361071%26rootSourceId%3Dtouliu_tencentgzh_20241008_26348326_1"
  492. }
  493. ]
  494. },
  495. {
  496. "groupIndex": 2,
  497. "groupVideoList": [
  498. {
  499. "videoIndex": 1,
  500. "videoId": "13724870",
  501. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13724870%26fromGzh%3D1%26rootShareId%3D0d8768d3-d325-4eb7-da0a-083eedeb729d%26shareId%3D0d8768d3-d325-4eb7-da0a-083eedeb729d%26rootSourceId%3Dtouliu_tencentgzh_20241008_13724870_7"
  502. },
  503. {
  504. "videoIndex": 2,
  505. "videoId": "26348326",
  506. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D26348326%26fromGzh%3D1%26rootShareId%3D21456cd7-8554-473c-8ad3-a7ea4b361071%26shareId%3D21456cd7-8554-473c-8ad3-a7ea4b361071%26rootSourceId%3Dtouliu_tencentgzh_20241008_26348326_1"
  507. }
  508. ]
  509. },
  510. {
  511. "groupIndex": 3,
  512. "groupVideoList": [
  513. {
  514. "videoIndex": 1,
  515. "videoId": "13724870",
  516. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13724870%26fromGzh%3D1%26rootShareId%3D0d8768d3-d325-4eb7-da0a-083eedeb729d%26shareId%3D0d8768d3-d325-4eb7-da0a-083eedeb729d%26rootSourceId%3Dtouliu_tencentgzh_20241008_13724870_7"
  517. },
  518. {
  519. "videoIndex": 2,
  520. "videoId": "26348326",
  521. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D26348326%26fromGzh%3D1%26rootShareId%3D21456cd7-8554-473c-8ad3-a7ea4b361071%26shareId%3D21456cd7-8554-473c-8ad3-a7ea4b361071%26rootSourceId%3Dtouliu_tencentgzh_20241008_26348326_1"
  522. }
  523. ]
  524. },
  525. {
  526. "groupIndex": 4,
  527. "groupVideoList": [
  528. {
  529. "videoIndex": 1,
  530. "videoId": "13724870",
  531. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D13724870%26fromGzh%3D1%26rootShareId%3D0d8768d3-d325-4eb7-da0a-083eedeb729d%26shareId%3D0d8768d3-d325-4eb7-da0a-083eedeb729d%26rootSourceId%3Dtouliu_tencentgzh_20241008_13724870_7"
  532. },
  533. {
  534. "videoIndex": 2,
  535. "videoId": "26348326",
  536. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D26348326%26fromGzh%3D1%26rootShareId%3D21456cd7-8554-473c-8ad3-a7ea4b361071%26shareId%3D21456cd7-8554-473c-8ad3-a7ea4b361071%26rootSourceId%3Dtouliu_tencentgzh_20241008_26348326_1"
  537. }
  538. ]
  539. }
  540. ],
  541. "gh_d3f039c9db2b": [
  542. {
  543. "groupIndex": 0,
  544. "groupVideoList": [
  545. {
  546. "videoIndex": 1,
  547. "videoId": "1275943",
  548. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D1275943%26fromGzh%3D1%26rootShareId%3D6c9858d5-2445-4ea5-cf6c-34c8dc189c6a%26shareId%3D6c9858d5-2445-4ea5-cf6c-34c8dc189c6a%26rootSourceId%3Dtouliu_tencentgzh_20241111_1275943_20474657"
  549. },
  550. {
  551. "videoIndex": 2,
  552. "videoId": "12794884",
  553. "pagePath": "pages/category?jumpPage=pages%2Fuser-videos%3Fid%3D12794884%26fromGzh%3D1%26rootShareId%3D640cb363-8b6e-43be-d861-f366e1e8d6fb%26shareId%3D640cb363-8b6e-43be-d861-f366e1e8d6fb%26rootSourceId%3Dtouliu_tencentgzh_20241111_12794884_e53224ff"
  554. }
  555. ]
  556. }
  557. ]
  558. }
  559. def get_pq_video_detail(video_id):
  560. """
  561. 获取票圈视频详情信息
  562. :return:
  563. """
  564. url = "https://longvideoapi.piaoquantv.com/longvideoapi/openapi/video/batchSelectVideoInfo"
  565. data = {
  566. "videoIdList": [video_id]
  567. }
  568. header = {
  569. "Content-Type": "application/json",
  570. }
  571. response = requests.post(url,json=data, headers=header)
  572. return response.json()
  573. def generate_response(gh_id):
  574. """
  575. 输入gh_id, 通过配置文件, 返回结果
  576. :param gh_id:
  577. :return:
  578. """
  579. msg_list = ACCOUNT_VIDEO[gh_id]
  580. response_list = []
  581. for msg in msg_list:
  582. item = {
  583. "groupIndex": msg['groupIndex'],
  584. "msgDataList": []
  585. }
  586. video_info_list = sorted(msg['groupVideoList'], key=lambda x: x['videoIndex'])
  587. for video in video_info_list:
  588. video_id = video['videoId']
  589. video_detail = get_pq_video_detail(video_id)['data'][0]
  590. obj = {
  591. "msgType": 1,
  592. "title": video_detail['title'],
  593. "coverUrl": video_detail['shareImgPath'],
  594. "miniAppId": "wxbdd2a2e93d9a6e25",
  595. "miniPagePath": video['pagePath'],
  596. "newsUrl": "",
  597. "newsDescription": "",
  598. "miniVideoId": video_id
  599. }
  600. item['msgDataList'].append(obj)
  601. article_obj = ARTICLE_URL[gh_id]
  602. item['msgDataList'].append(article_obj)
  603. response_list.append(item)
  604. return response_list