Skip to content

Commit 27f402c

Browse files
committed
ws handling
1 parent 5d9a0d3 commit 27f402c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

YTTikTokSplitter.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from curses.ascii import isdigit, isspace
12
from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip
23
import csv
34
import os
@@ -27,6 +28,11 @@ def get_sec(time_str):
2728
if line.strip():
2829
if line[0].isdigit():
2930
o.write(line.strip()+"\n")
31+
elif line[0].isspace():
32+
while line[0].isspace():
33+
line = line[1:]
34+
if line[0].isdigit():
35+
o.write(line.strip()+"\n")
3036
file1 = open('chapters_new.txt', 'r', encoding="utf8")
3137
Lines = file1.readlines()
3238
# print(Lines)
@@ -88,4 +94,6 @@ def get_sec(time_str):
8894
# end = eachline[2]
8995
# end = get_sec(end)
9096

91-
#ffmpeg_extract_subclip(file_name, start, end, targetname=out_file)
97+
#ffmpeg_extract_subclip(file_name, start, end, targetname=out_file)
98+
if os.path.exists("chapters_new.txt"):
99+
os.remove("chapters_new.txt")

0 commit comments

Comments
 (0)