mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 10:44:52 +01:00
bitwarden
This commit is contained in:
@@ -97,20 +97,6 @@ if _ACTION == "flip":
|
||||
# accessed = "08/07/2014 18:30:45"
|
||||
# )
|
||||
create_date = filedate.File(_FULL_PATH + _FILE).get()
|
||||
c = create_date["created"]
|
||||
m = create_date["modified"]
|
||||
a = create_date["accessed"]
|
||||
new_date = {"created": c.strftime("%m/%d/%Y %H:%M:%S"),
|
||||
"modified": m.strftime("%m/%d/%Y %H:%M:%S"),
|
||||
"accessed":a.strftime("%m/%d/%Y %H:%M:%S")
|
||||
}
|
||||
new_date = {"created": c.strftime("%m/%d/%Y %H:%M:%S"),
|
||||
"modified": m.strftime("%m/%d/%Y %H:%M:%S"),
|
||||
"accessed":a.strftime("%m/%d/%Y %H:%M:%S")
|
||||
}
|
||||
print(create_date)
|
||||
print(create_date["created"])
|
||||
print(new_date)
|
||||
print(_FULL_PATH)
|
||||
print(myCmd)
|
||||
os.chdir(_FULL_PATH)
|
||||
@@ -144,11 +130,12 @@ if _ACTION == "join":
|
||||
else:
|
||||
_FULL_PATH = _SOURCE_DIR + "/" + _DEV + "/" + _DAY_DIR + "/"
|
||||
video_seq = {}
|
||||
|
||||
|
||||
if os.path.exists(_FULL_PATH):
|
||||
if os.path.exists(_FULL_PATH + "100GOPRO"):
|
||||
_FULL_PATH = _FULL_PATH + "100GOPRO"
|
||||
for filename in os.listdir(_FULL_PATH):
|
||||
|
||||
if filename.endswith(".MP4") and not filename.startswith("joined_"):
|
||||
prefix = filename[0:2]
|
||||
part = prefix + filename[2:4]
|
||||
@@ -195,7 +182,10 @@ if _ACTION == "join":
|
||||
f.close()
|
||||
f = open("video.txt", "a")
|
||||
final_size = 0
|
||||
create_date = ""
|
||||
for p in parts:
|
||||
if create_date == "":
|
||||
create_date = filedate.File(_FULL_PATH + p).get()
|
||||
f.write(f"file '{p}'\n")
|
||||
file_stats = os.stat(p)
|
||||
final_size += file_stats.st_size
|
||||
@@ -240,6 +230,7 @@ if _ACTION == "join":
|
||||
# pbar.update(progress - pbar.n)
|
||||
|
||||
cur_stat = 0
|
||||
|
||||
with tqdm(total=100, position=1, desc="Join") as pbar:
|
||||
position=0
|
||||
while proc.returncode is None:
|
||||
@@ -273,6 +264,11 @@ if _ACTION == "join":
|
||||
print("Size OK")
|
||||
try:
|
||||
shutil.move(export_name, export_name.replace("joining","joined"))
|
||||
filedate.File(_FULL_PATH + export_name.replace("joining","joined")).set(
|
||||
created = create_date["created"],
|
||||
modified = create_date["modified"],
|
||||
accessed = create_date["accessed"]
|
||||
)
|
||||
except:
|
||||
print(f"Failed to move {export_name}")
|
||||
print("\r\n",flush=True)
|
||||
@@ -319,8 +315,10 @@ if _ACTION == "encode":
|
||||
sys.exit()
|
||||
|
||||
os.chdir(_FULL_PATH)
|
||||
|
||||
create_date = ""
|
||||
for p in parts:
|
||||
if create_date == "":
|
||||
create_date = filedate.File(_FULL_PATH + p).get()
|
||||
export_name = "encoding_" + p
|
||||
if _FLIP:
|
||||
if ops == "win":
|
||||
@@ -352,6 +350,11 @@ if _ACTION == "encode":
|
||||
#ffmpeg -i .\GH010149.MP4 -c:v hevc_amf -rc cqp -qp_i 42 -qp_p 42 -quality quality -crf 25 output7.mp4
|
||||
try:
|
||||
shutil.move(export_name, export_name.replace("encoding","encoded"))
|
||||
filedate.File(_FULL_PATH + export_name.replace("encoding","encoded")).set(
|
||||
created = create_date["created"],
|
||||
modified = create_date["modified"],
|
||||
accessed = create_date["accessed"]
|
||||
)
|
||||
except:
|
||||
print(f"Failed to move {export_name}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user