reformatted

pull/418/head
Jason 3 years ago
parent 174df19be7
commit 7e3084e886

@ -100,9 +100,11 @@ class TTTTSWrapper: # TikTok Text-to-Speech Wrapper
session = requests.Session() session = requests.Session()
retry = Retry(connect=3, backoff_factor=0.5) retry = Retry(connect=3, backoff_factor=0.5)
adapter = HTTPAdapter(max_retries=retry) adapter = HTTPAdapter(max_retries=retry)
session.mount('http://', adapter) session.mount("http://", adapter)
session.mount('https://', adapter) session.mount("https://", adapter)
r = session.post(f"{self.URI_BASE}{voice}&req_text={chunk}&speaker_map_type=0") r = session.post(
f"{self.URI_BASE}{voice}&req_text={chunk}&speaker_map_type=0"
)
vstr = [r.json()["data"]["v_str"]][0] vstr = [r.json()["data"]["v_str"]][0]
b64d = base64.b64decode(vstr) b64d = base64.b64decode(vstr)

@ -43,7 +43,9 @@ def make_final_video(number_of_clips, length):
# Gather all images # Gather all images
image_clips = [] image_clips = []
for i in range(0, number_of_clips): for i in range(0, number_of_clips):
if opacity is None or float(opacity) >= 1: # opacity not set or is set to one OR MORE if (
opacity is None or float(opacity) >= 1
): # opacity not set or is set to one OR MORE
image_clips.append( image_clips.append(
ImageClip(f"assets/temp/png/comment_{i}.png") ImageClip(f"assets/temp/png/comment_{i}.png")
.set_duration(audio_clips[i + 1].duration) .set_duration(audio_clips[i + 1].duration)
@ -58,7 +60,9 @@ def make_final_video(number_of_clips, length):
.resize(width=W - 100) .resize(width=W - 100)
.set_opacity(float(opacity)), .set_opacity(float(opacity)),
) )
if opacity is None or float(opacity) >= 1: # opacity not set or is set to one OR MORE if (
opacity is None or float(opacity) >= 1
): # opacity not set or is set to one OR MORE
image_clips.insert( image_clips.insert(
0, 0,
ImageClip(f"assets/temp/png/title.png") ImageClip(f"assets/temp/png/title.png")

Loading…
Cancel
Save