ソースを参照

更新 share_url
更新 logo.png

罗俊辉 1 年間 前
コミット
f7d1d9ab6e
3 ファイル変更7 行追加7 行削除
  1. 1 1
      app.py
  2. 2 2
      applications/process.py
  3. 4 4
      test.py

+ 1 - 1
app.py

@@ -5,7 +5,7 @@ from quart import Quart
 from applications.routes.title_routes import my_blueprint
 
 # 初始化 App
-app = Quart(__name__)
+app = Quart(__name__, static_folder='applications/static')
 
 # 注册蓝图
 app.register_blueprint(my_blueprint)

+ 2 - 2
applications/process.py

@@ -93,9 +93,9 @@ class ProcessParams(object):
         uid, video_id = result['s1_uid'], result['s1_vid']
         root_share_id, productionPath = cls.create_gzh_path(uid, video_id)
         response = cls.request_for_info(video_id)
-        productionCover = response["data"][0]['coverImg']['coverImgPath']
+        productionCover = response['data'][0]['shareImgPath']
         productionName = response["data"][0]['title']
-        programAvatar = "Avatar"
+        programAvatar = "http://0.0.0.0:8111/static/logo.png"
         programId = "wx89e7eb06478361d7"
         programName = "票圈vlog"
         source = "Web"

+ 4 - 4
test.py

@@ -11,15 +11,15 @@ def request_data(url):
     # index = _url.split("#")[0]
     # url = _url.split("#")[1]
     body = {
-        "title": "发布不幸消息"
+        "title": "中华人民共和国"
     }
     t = time.time()
     res = requests.post(url, json=body)
     e = time.time()
     # print(index)
     print(e - t)
-    print(res.text)
-    # print(res.json())
+    # print(res.text)
+    print(res.json())
 
 
 if __name__ == "__main__":
@@ -27,7 +27,7 @@ if __name__ == "__main__":
     # parser.add_argument("--thread")
     # args = parser.parse_args()
     # thread = int(args.thread)
-    dt = ["http://127.0.0.1:8111/title_to_video"]
+    dt = ["http://192.168.100.31:8111/title_to_video"]
     # total_s = time.time()
     request_data(dt[0])
     # with ThreadPoolExecutor(max_workers=thread) as pool: