Closed franticht closed 1 week ago
...and there is of course no difference if I run it like this instead, without the quotes: python ~/scr/srt_fix-master/srt_fixer_cli.py 1.srt
I made a really dirty hack to make it work. That is, I didn't really try to understand the code much at all, and just tried to make the error go away rather than properly fixing anything. Perhaps it still helps, in order to figure out what the problem may be.
I changed this:
output_file = args.output
To this:
output_file = str(args.input)
...and just before this line:
new_file_path = output_file or file_path[:-4] + ".fixed.srt"
I added "else", like this:
else:
new_file_path = output_file or file_path[:-4] + ".fixed.srt"
Thank you for you help. Those were pretty obvious errors.
I am trying to use this on my mac (running Sonoma 14.4.1) from the shell. This is what happens:
username@mac01337 files % python ~/scr/srt_fix-master/srt_fixer_cli.py "1.srt" Traceback (most recent call last): File "/Users/username/scr/srt_fix-master/srt_fixer_cli.py", line 84, in
main()
File "/Users/username/scr/srt_fix-master/srt_fixer_cli.py", line 73, in main
elif os.path.isdir(output_file):
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 42, in isdir
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType