|  | @@ -53,25 +53,14 @@ dir_title = 'title/'
 | 
											
												
													
														|  |  dir_subtitle = 'subtitle/'
 |  |  dir_subtitle = 'subtitle/'
 | 
											
												
													
														|  |  dir_anchor = 'anchor_raw/'
 |  |  dir_anchor = 'anchor_raw/'
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -class request(BaseModel):
 |  | 
 | 
											
												
													
														|  | -    name: str
 |  | 
 | 
											
												
													
														|  | -    text_content: str
 |  | 
 | 
											
												
													
														|  | -    image_urls: List[str]
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -class QQ(BaseModel):
 |  | 
 | 
											
												
													
														|  | -    n1: str
 |  | 
 | 
											
												
													
														|  | -    n2: str
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -class request2(BaseModel):
 |  | 
 | 
											
												
													
														|  | 
 |  | +class request(BaseModel):
 | 
											
												
													
														|  |      name: str
 |  |      name: str
 | 
											
												
													
														|  |      text_content: List[str]
 |  |      text_content: List[str]
 | 
											
												
													
														|  |      image_urls: List[str]
 |  |      image_urls: List[str]
 | 
											
												
													
														|  | 
 |  | +    avatar: int
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -class anchor_request(BaseModel):
 |  | 
 | 
											
												
													
														|  | -    name: str
 |  | 
 | 
											
												
													
														|  | -    text_content: str
 |  | 
 | 
											
												
													
														|  | -    image_urls: List[str]
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  class ConnectionManager:
 |  |  class ConnectionManager:
 | 
											
												
													
														|  |      def __init__(self):
 |  |      def __init__(self):
 | 
											
										
											
												
													
														|  | @@ -121,7 +110,7 @@ async def progress_page():
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  @app.post("/make_anchor_video_v2")
 |  |  @app.post("/make_anchor_video_v2")
 | 
											
												
													
														|  | -async def make_anchor_video_v2(req:request2):
 |  | 
 | 
											
												
													
														|  | 
 |  | +async def make_anchor_video_v2(req:request):
 | 
											
												
													
														|  |      db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/AI_anchor?charset=utf8mb4')
 |  |      db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/AI_anchor?charset=utf8mb4')
 | 
											
												
													
														|  |      log_table = db['history_input']
 |  |      log_table = db['history_input']
 | 
											
												
													
														|  |      txt_content_seperate_by_dot = ''
 |  |      txt_content_seperate_by_dot = ''
 | 
											
										
											
												
													
														|  | @@ -140,7 +129,7 @@ async def make_anchor_video_v2(req:request2):
 | 
											
												
													
														|  |      return {"msg":"製作影片需要時間,請您耐心等候  稍後可以在www.choozmo.com:8168/"+req.name+".mp4 中觀看"} 
 |  |      return {"msg":"製作影片需要時間,請您耐心等候  稍後可以在www.choozmo.com:8168/"+req.name+".mp4 中觀看"} 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  @app.post("/make_anchor_video_v33")
 |  |  @app.post("/make_anchor_video_v33")
 | 
											
												
													
														|  | -async def make_anchor_video_v2(req:request2):
 |  | 
 | 
											
												
													
														|  | 
 |  | +async def make_anchor_video_v33(req:request2):
 | 
											
												
													
														|  |      db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/AI_anchor?charset=utf8mb4')
 |  |      db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/AI_anchor?charset=utf8mb4')
 | 
											
												
													
														|  |      log_table = db['history_input']
 |  |      log_table = db['history_input']
 | 
											
												
													
														|  |      txt_content_seperate_by_dot = ''
 |  |      txt_content_seperate_by_dot = ''
 | 
											
										
											
												
													
														|  | @@ -354,7 +343,7 @@ def txt2image_title(content, save_target):
 | 
											
												
													
														|  |      draw.text((5,5), text, (17, 41, 167), font)
 |  |      draw.text((5,5), text, (17, 41, 167), font)
 | 
											
												
													
														|  |      canvas.save(save_target, "PNG")
 |  |      canvas.save(save_target, "PNG")
 | 
											
												
													
														|  |  '''
 |  |  '''
 | 
											
												
													
														|  | -def call_achor_video_v2(fileName):
 |  | 
 | 
											
												
													
														|  | 
 |  | +def call_achor_video_v2(fileName,avatar):
 | 
											
												
													
														|  |      conn = rpyc.classic.connect("192.168.1.105",18812)
 |  |      conn = rpyc.classic.connect("192.168.1.105",18812)
 | 
											
												
													
														|  |      ros = conn.modules.os 
 |  |      ros = conn.modules.os 
 | 
											
												
													
														|  |      rsys = conn.modules.sys 
 |  |      rsys = conn.modules.sys 
 | 
											
										
											
												
													
														|  | @@ -374,7 +363,10 @@ def call_achor_video_v2(fileName):
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      val=random.randint(1000000,9999999)
 |  |      val=random.randint(1000000,9999999)
 | 
											
												
													
														|  |      ros.chdir('/home/jared/to_video')
 |  |      ros.chdir('/home/jared/to_video')
 | 
											
												
													
														|  | -    ros.system('./p6.sh '+str(val)+' &')
 |  | 
 | 
											
												
													
														|  | 
 |  | +    if avatar ==7:
 | 
											
												
													
														|  | 
 |  | +        ros.system('./p6.sh '+str(val)+' &')
 | 
											
												
													
														|  | 
 |  | +    else :
 | 
											
												
													
														|  | 
 |  | +        ros.system('./p7.sh '+str(val)+' &')
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |      while True:
 |  |      while True:
 | 
											
												
													
														|  |          print('waiting...')
 |  |          print('waiting...')
 | 
											
										
											
												
													
														|  | @@ -580,8 +572,8 @@ def anchor_video_v2(name,text_content, image_urls):
 | 
											
												
													
														|  |      LOGO_ED = openshot.FFmpegReader(dir_video+"LOGO_ED.avi")
 |  |      LOGO_ED = openshot.FFmpegReader(dir_video+"LOGO_ED.avi")
 | 
											
												
													
														|  |      LOGO_ED.Open()
 |  |      LOGO_ED.Open()
 | 
											
												
													
														|  |      LOGO_ED_clip = video_photo_clip(vid=LOGO_ED,layer=4,position=main_timer,end=LOGO_ED.info.duration+2
 |  |      LOGO_ED_clip = video_photo_clip(vid=LOGO_ED,layer=4,position=main_timer,end=LOGO_ED.info.duration+2
 | 
											
												
													
														|  | -                    ,location_x=0,location_y=-0.02
 |  | 
 | 
											
												
													
														|  | -                    ,scale_x=0.79,scale_y=0.685)
 |  | 
 | 
											
												
													
														|  | 
 |  | +                    ,location_x=0,location_y=-0.04
 | 
											
												
													
														|  | 
 |  | +                    ,scale_x=0.79,scale_y=0.69)
 | 
											
												
													
														|  |      t.AddClip(LOGO_ED_clip)
 |  |      t.AddClip(LOGO_ED_clip)
 | 
											
												
													
														|  |      ED_duration = LOGO_ED.info.duration
 |  |      ED_duration = LOGO_ED.info.duration
 | 
											
												
													
														|  |      LOGO_ED.Close()
 |  |      LOGO_ED.Close()
 |