Jan-08-2023, 05:01 PM
I have a remote server that records live TV. Every night I run a python script that copies new TV recordings to my local (home) PC over a VPN so I can watch those episodes at home.
Once the files are copied to my home PC, I run 2 'external' command line applications on them (comskip.exe - to remove commercials; and ccextractor.exe - to create an external .srt (subtitle) file).
the 2 'external' applications used to run 100% of the time, now, at best, they work 50% of the time. I get no errors, and my internal logs (from the script) don't show any glaring issues. The script seems to exit fine, as the last command is to write 'Applicaiton Finished' to a text file, which completes fine.
All PC's involved are Windows 11, and I believe I am on the latest version of Python (3.11.1).
I am happy to provide the entire script if needed, but the relevant 'Function()' is below. Can anyone tell me what might be causing it to not run the external applications sometimes?
Once the files are copied to my home PC, I run 2 'external' command line applications on them (comskip.exe - to remove commercials; and ccextractor.exe - to create an external .srt (subtitle) file).
the 2 'external' applications used to run 100% of the time, now, at best, they work 50% of the time. I get no errors, and my internal logs (from the script) don't show any glaring issues. The script seems to exit fine, as the last command is to write 'Applicaiton Finished' to a text file, which completes fine.
All PC's involved are Windows 11, and I believe I am on the latest version of Python (3.11.1).
I am happy to provide the entire script if needed, but the relevant 'Function()' is below. Can anyone tell me what might be causing it to not run the external applications sometimes?
def MoveFile(pFile, pDest): isFile = os.path.isfile(pFile) if isFile == True: dPath=os.path.dirname(pDest) isDir = os.path.isdir(dPath) if isDir == False: CreateFolder(dPath) os.system('move "%s" "%s"' % (pFile, pDest)) WriteLog("Moved: '%s' to '%s'" % (pFile, pDest)) if right(pDest, 3) == "mpg": #BEGIN CCEXTRATOR ccCmnd = [ccPath, pDest] WriteLog ("BEGIN: Closed Captions Extraction on %s: %s" % (pDest, ccCmnd)) ccErrCode = subprocess.Popen(ccCmnd, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True) csCmnd = [csPath, "--ini=" + BasePath + "Comskip\\comskip.ini", pDest] WriteLog ("BEGIN: Comskip on %s: %s" % (pDest, csCmnd)) csErrCode = subprocess.Popen(csCmnd, stdin=subprocess.PIPE, stderr=subprocess.PIPE, stdout=subprocess.PIPE, shell=True) else: WriteLog("Info: '%s' is not a file, so won't be moved." % pDest)