From 19511045c957df71dc98341000a15109988d3fee Mon Sep 17 00:00:00 2001 From: Colton Burki Date: Sat, 25 Mar 2023 18:35:35 -0500 Subject: [PATCH] Fixed a bug with white space directories --- main.py | 16 +++++++++------- preview.png | Bin 10781 -> 9851 bytes src/globals.py | 2 +- src/thread.py | 20 +++++--------------- src/utils.py | 13 +++++-------- 5 files changed, 20 insertions(+), 31 deletions(-) diff --git a/main.py b/main.py index 4d84a28..9519e4f 100644 --- a/main.py +++ b/main.py @@ -64,7 +64,7 @@ def __init__(self) -> None: self._label_log.setWordWrap(True) self._label_log.setAlignment(Qt.AlignmentFlag.AlignCenter) self._label_log.setStyleSheet("border: 1px solid black; margin: 1px") - self._button_foot = QPushButton(f"v{g.VERSION} | Created by Cheezos", self) + self._button_foot = QPushButton(f"v{g.VERSION}", self) self._button_foot.resize(SBW, SBH) X, Y = g.B_FOOT_POS self._button_foot.move(X, Y) @@ -159,14 +159,14 @@ def _verify_directories(self): print("Verifying directories...") g.dir_root = os.path.dirname(os.path.abspath(__file__)) print(f"Root: {g.dir_root}") - g.dir_bin = f"{g.dir_root}/bin" + g.dir_bin = os.path.join(g.dir_root, "bin") if not os.path.exists(g.dir_bin): os.mkdir(g.dir_bin) print(f"Created bin directory") print(f"Bin: {g.dir_bin}") - g.dir_output = f"{g.dir_root}/output" + g.dir_output = os.path.join(g.dir_root, "output") if not os.path.exists(g.dir_output): os.mkdir(g.dir_output) @@ -177,14 +177,16 @@ def _verify_directories(self): def _handle_windows(self): print("Windows detected") - FFMPEG_PATH = f"{g.dir_bin}/ffmpeg.exe" - FFPROBE_PATH = f"{g.dir_bin}/ffprobe.exe" + FFMPEG_PATH = os.path.join(g.dir_bin, "ffmpeg.exe") + print(f"FFmpeg: {FFMPEG_PATH}") + FFPROBE_PATH = os.path.join(g.dir_bin, "ffprobe.exe") + print(f"FFprobe: {FFPROBE_PATH}") if os.path.exists(FFMPEG_PATH) and os.path.exists(FFPROBE_PATH): BIN_PATH = g.dir_bin g.ffmpeg_installed = True - g.ffmpeg_path = f"{BIN_PATH}/ffmpeg.exe" - g.ffprobe_path = f"{BIN_PATH}/ffprobe.exe" + g.ffmpeg_path = FFMPEG_PATH + g.ffprobe_path = FFPROBE_PATH self._button_select.setEnabled(True) else: self._download_thread = DownloadThread() diff --git a/preview.png b/preview.png index dc1f28f3320fba9f1539b013287e1db6af43ff65..619272eff91e3d2ff0caefc2232c12ce34c0b9e9 100644 GIT binary patch literal 9851 zcmch7dsvd`yROxg)0Em_ip&FrrA;2oJR@eAcGQ~klm|3ZD-V>IiV8I2lqo7hnuZ7L zWKAAZQbYxE%%n`IOwj;IMM)796cIt#G;6PG@AX@I&9#4P?X~~ldcWsAJm2@d-}~J6 z^WHC6r@g&&e%StlmX?;zv7;V8YiX@OXlbo<`F@S2W^J0FOH-_X|Lk>0tG3s0Qe%7< z?S9H#ORFBcP8q)XTc4{(1L0a)TX%o^tvL4cu30TD(+$Tw+|Q+i3ONGo?#YlrF=F#> z^!LhDCOrn->Vw~}fM>2al!3c@bkENPdjgMc6ZI@L2<%d>u791AY_o>s5cM+j_MP?H zf2ynQX*;&-H`7%^9XLKMd~biwo74L&b?TY3?^B=T@;L#+1UW5)PkpLsrAbSt zhKCKfvpU=Wtqo_lAUbT;n+$Kz6ge*s^K?3FR_fs#)^~gl_88VQ%>G|BV9P*iG6PxL zEW-h0B4YV+EOE8QZ3HmlDZR*DHG`JWk`^+tp>J9g=DlYon$Ge#!6OR5ojXSqaAM_Wut!~ThZWgEsfA#alA-!dHF&u~@FUr%* ztx+wDH@V7lVuSMZ<{xBgOVv~z^?bS*Q&)2rSac1oAkv_1%Vji@j80SL8Fc27+D?Nn zL+q3EtpPIuNO$V^>S%FGUPuJe2n01A<0=&Du!VZ75EOJQ7>8b(hj%)tUwL6*@;8c3 z7HXn%l!Y1z6&uYcuZlxvcK30kR$dd)X~Gbo1$A-=x|b>^12k@_d<+b!PRoWVUbbe>EcQoZW|pLVqh;!m zv3#8MD)m|QoxcZOfV&y({G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- a/src/globals.py +++ b/src/globals.py @@ -1,4 +1,4 @@ -VERSION = "3.0.0" +VERSION = "3.0.1" FFMPEG_DL = "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl.zip" TITLE = f"Cheezos Video Compressor v{VERSION}" READY_TEXT = f"Select your videos to get started." diff --git a/src/thread.py b/src/thread.py index b82186b..df11985 100644 --- a/src/thread.py +++ b/src/thread.py @@ -20,28 +20,18 @@ def _run_pass(self, file_path, bitrate, pass_1: bool): PASS = "1" if pass_1 else "2" MSG = f"Compressing, please wait...\n\nVideo queue: {COMPLETED_COUNT}/{QUEUE_COUNT}\nPass: {PASS}/2" FILE_NAME = file_path.split("/")[-1] - FFMPEG = g.ffmpeg_path - INPUT = file_path + FFMPEG_PATH = g.ffmpeg_path + INPUT_PATH = file_path BITRATE = f"{bitrate}k" print(f"New bitrate: {BITRATE}") - OUTPUT = rf"{g.dir_output}/{FILE_NAME}-compressed.mp4" + OUTPUT_PATH = os.path.join(g.dir_output, f"{FILE_NAME}-compressed.mp4") print(MSG) cmd = "" if pass_1: - cmd = r""""%s" -i "%s" -y -b:v %s -an -pass 1 -f mp4 TEMP""" % ( - FFMPEG, - INPUT, - BITRATE, - ) + cmd = f'"{FFMPEG_PATH}" -i "{INPUT_PATH}" -y -b:v {BITRATE} -an -pass 1 -f mp4 TEMP' else: - cmd = r""""%s" -i "%s" -y -b:v %sk -b:a %sk -pass 2 "%s" """ % ( - g.ffmpeg_path, - file_path, - bitrate, - 128, - OUTPUT, - ) + cmd = f'"{FFMPEG_PATH}" -i "{INPUT_PATH}" -y -b:v {BITRATE} -b:a 128k -pass 2 "{OUTPUT_PATH}"' print(cmd) self.update_label.emit(MSG) diff --git a/src/utils.py b/src/utils.py index a328809..b43bd57 100644 --- a/src/utils.py +++ b/src/utils.py @@ -6,11 +6,8 @@ def get_video_length(file_path): - VIDEO = '"%s"' % file_path - CMD = ( - "%s -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 %s" - % (g.ffprobe_path, VIDEO) - ) + VIDEO = "%s" % file_path + CMD = f'"{g.ffprobe_path}" -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "{file_path}"' PROCESS = subprocess.Popen(CMD, stdout=subprocess.PIPE, shell=True) LENGTH = float(PROCESS.stdout.readline()) print(f"Video duration: {LENGTH}") @@ -28,9 +25,9 @@ def get_video_bitrate(file_path, target_file_size): def clean(): try: - os.remove("TEMP") - os.remove("ffmpeg2pass-0.log") - os.remove("ffmpeg2pass-0.log.mbtree") + os.remove(os.path.join(g.dir_root, "TEMP")) + os.remove(os.path.join(g.dir_root, "ffmpeg2pass-0.log")) + os.remove(os.path.join(g.dir_root, "ffmpeg2pass-0.log.mbtree")) except: print("No temporary files to remove")