ソースを参照

修改分享小程序从票圈 vlog 改为票圈最惊奇

罗俊辉 1 年間 前
コミット
edf53feee6
2 ファイル変更37 行追加15 行削除
  1. 2 1
      applications/process.py
  2. 35 14
      test.py

+ 2 - 1
applications/process.py

@@ -25,7 +25,7 @@ def create_gzh_path(video_id, shared_uid):
     url = f"pages/user-videos?id={video_id}&su={shared_uid}&fromGzh=1&rootShareId={root_share_id}&shareId={root_share_id}"
     # 自动把 root_share_id 加入到白名单
     auto_white(root_share_id)
-    return root_share_id, f"pages/category?jumpPage={urllib.parse.quote(url)}"
+    return root_share_id, f"pages/category?jumpPage={urllib.parse.quote(url, safe='')}"
 
 
 def request_for_info(video_id):
@@ -66,6 +66,7 @@ class ProcessParams(object):
     """
     Params Analysis
     """
+
     def __init__(self, t_id):
         self.trace_id = t_id
 

+ 35 - 14
test.py

@@ -12,7 +12,10 @@ def request_data(url):
     # index = _url.split("#")[0]
     # url = _url.split("#")[1]
     body = {
-        "search_keys": ["日本"],
+        "accountName": "魔法美学馆",
+        "content": "8月20日,最高人民法院举行新闻发布会,发布新修订的《最高人民法院关于审理民间借贷案件适用法律若干问题的规定》(以下简称《规定》)并回答记者提问。",
+        "title": "邯郸杀人案件",
+        "search_keys": ["日本核污水排海"],
         "ghId": "gh_efaf7da157f5"
     }
     t = time.time()
@@ -24,16 +27,34 @@ def request_data(url):
     # print(res.json())
 
 
-if __name__ == "__main__":
-    # parser = argparse.ArgumentParser()  # 新建参数解释器对象
-    # parser.add_argument("--thread")
-    # args = parser.parse_args()
-    # thread = int(args.thread)
-    # dt = ["http://61.48.133.26:8111/title_to_video"]
-    dt = ["http://127.0.0.1:5000/search_videos"]
-    # total_s = time.time()
-    request_data(dt[0])
-    # with ThreadPoolExecutor(max_workers=thread) as pool:
-    #     pool.map(request_data, dt)
-    # total_e = time.time()
-    # print(total_e - total_s)
+# if __name__ == "__main__":
+#     # parser = argparse.ArgumentParser()  # 新建参数解释器对象
+#     # parser.add_argument("--thread")
+#     # args = parser.parse_args()
+#     # thread = int(args.thread)
+#     dt = ["http://61.48.133.26:8111/title_to_video"]
+#     # total_s = time.time()
+#     request_data(dt[0])
+#     # with ThreadPoolExecutor(max_workers=thread) as pool:
+#     #     pool.map(request_data, dt)
+#     # total_e = time.time()
+#     # print(total_e - total_s)
+import uuid
+import urllib.parse
+
+
+def create_gzh_path(video_id, shared_uid):
+    """
+    :param video_id: 视频 id
+    :param shared_uid: 分享 id
+    """
+    root_share_id = str(uuid.uuid4())
+    url = f"pages/user-videos?id={video_id}&su={shared_uid}&fromGzh=1&rootShareId={root_share_id}&shareId={root_share_id}"
+    # 自动把 root_share_id 加入到白名单
+    # auto_white(root_share_id)
+    return root_share_id, f"pages/category?jumpPage={urllib.parse.quote(url, safe='')}"
+
+
+a, n = create_gzh_path(12345678, 1234)
+
+print(n)