Closed Technetium1 closed 1 year ago
Hello, it should be fixed now with the new commits and the new package version 1.1.2 on PyPi.
Please test it out and let me know. If it works please close this issue.
Thank you for contributing!
Hi, I'll test this!
Seems to be working fine in terms of folder recursion. Thanks for the fast fix! I have a new error though. There's no way to skip when it hits a duplicate file:
Muxing: this may take awhile...(741.28 fps, avg 706.33 fps, ETA 00h00m00s)
Encoding successfully done!
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\User\AppData\Roaming\Python\Python311\Scripts\havc.exe\__main__.py", line 7, in <module>
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\app.py", line 36, in main
videos.search()
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\search.py", line 48, in search
current_video_file.copy_to(sub_delete_folder)
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\entities\video_file.py", line 51, in copy_to
shutil.copyfile(original, target)
File "C:\Program Files\Python311\Lib\shutil.py", line 236, in copyfile
raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: 'D:\\Comedy\\Andrew Santino - Cheeseburger (2023)\\Andrew Santino - Cheeseburger (2023).mkv' and 'D:\\\\Comedy\\Andrew Santino - Cheeseburger (2023)\\Andrew Santino - Cheeseburger (2023).mkv' are the same file
Should I open a second issue?
Great!
Yes, please open another issue, I will take a look at it.
Thanks!
Seems this is not actually fixed:
All files found with the a .avi or .m4v or .mkv or .mov or .mp2 or .mpeg or .mpg or .vob or .wmv extension are going to be converted to .mp4 extension and be kept in the "D:\_CONVERTED" folder.
"D:\Comedy\Taylor Tomlinson - Look at You (2022)" is going to be modified permanently.
Are you sure you want to continue?
[Y/n]
Current Command: C:\ProgramData\chocolatey\bin\HandBrakeCLI.exe --preset=H.265 NVENC 1080p --subtitle-lang-list eng --optimize -i D:\Comedy\Taylor Tomlinson - Look at You (2022)\Taylor Tomlinson - Look at You (2022) (1080p NF WEB-DL x265 10bit t3nzin).mkv -o D:\Comedy\Taylor Tomlinson - Look at You (2022)\Taylor Tomlinson - Look at You (2022) (1080p NF WEB-DL x265 10bit t3nzin).mp4
libdvdread: Encrypted DVD support unavailable.
libdvdread: Can't open file VIDEO_TS.IFO.
Muxing: this may take awhile...(150.16 fps, avg 210.90 fps, ETA 00h00m00s)
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\User\AppData\Roaming\Python\Python311\Scripts\havc.exe\__main__.py", line 7, in <module>
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\app.py", line 36, in main
videos.search()
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\search.py", line 44, in search
sub_delete_folder = self.create_delete_folder_structure(root, new_main_delete_folder)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\search.py", line 81, in create_delete_folder_structure
return new_deleted_folder_directory.create_folder(to_delete_folder)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\services\directory.py", line 26, in create_folder
os.mkdir(new_directory)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'D:\\Comedy\\_CONVERTED\\Taylor Tomlinson - Look at You (2022)'
'{cf}"' is not recognized as an internal or external command,
operable program or batch file.
as well as:
All files found with the a .avi or .m4v or .mkv or .mov or .mp2 or .mpeg or .mpg or .vob or .wmv extension are going to be converted to .mp4 extension and be kept in the "D:\_CONVERTED" folder.
"D:\Comedy\Taylor Tomlinson - Quarter-Life Crisis (2020)" is going to be modified permanently.
Are you sure you want to continue?
[Y/n]
Current Command: C:\ProgramData\chocolatey\bin\HandBrakeCLI.exe --preset=H.265 NVENC 1080p --subtitle-lang-list eng --optimize -i D:\Comedy\Taylor Tomlinson - Quarter-Life Crisis (2020)\Taylor Tomlinson - Quarter-Life Crisis (2020).mkv -o D:\Comedy\Taylor Tomlinson - Quarter-Life Crisis (2020)\Taylor Tomlinson - Quarter-Life Crisis (2020).mp4
libdvdread: Encrypted DVD support unavailable.
libdvdread: Can't open file VIDEO_TS.IFO.
Muxing: this may take awhile... (332.02 fps, avg 200.52 fps, ETA 00h00m00s)
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\User\AppData\Roaming\Python\Python311\Scripts\havc.exe\__main__.py", line 7, in <module>
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\app.py", line 36, in main
videos.search()
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\search.py", line 44, in search
sub_delete_folder = self.create_delete_folder_structure(root, new_main_delete_folder)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\search.py", line 81, in create_delete_folder_structure
return new_deleted_folder_directory.create_folder(to_delete_folder)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\services\directory.py", line 26, in create_folder
os.mkdir(new_directory)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'D:\\Comedy\\_CONVERTED\\Taylor Tomlinson - Quarter-Life Crisis (2020)'
Hello, please update your version to the new one: 1.2.0
I changed some things regarding the code in those errors in the new version, please update the version and let me know if it fixed those too.
Thanks!
Still have an issue, but it's skipping properly now:
All files found with the a .avi or .m4v or .mkv or .mov or .mp2 or .mpeg or .mpg or .vob or .wmv extension are going to be converted to .mp4 extension and be kept in the "D:\_CONVERTED" folder.
"D:\Comedy" is going to be modified permanently.
Are you sure you want to continue?
[Y/n]
D:\Comedy\Andrew Santino - Cheeseburger (2023)\Andrew Santino - Cheeseburger (2023).mkv was skipped because file with same name already exists!
Current Command: C:\ProgramData\chocolatey\bin\HandBrakeCLI.exe --preset=H.265 NVENC 1080p --subtitle-lang-list eng --optimize -i D:\Comedy\Bert Kreisher - The Machine (2016)\Bert.Kreisher.The.Machine.2016.mkv -o D:\Comedy\Bert Kreisher - The Machine (2016)\Bert.Kreisher.The.Machine.2016.mp4
libdvdread: Encrypted DVD support unavailable.
libdvdread: Can't open file VIDEO_TS.IFO.
Muxing: this may take awhile... (681.27 fps, avg 655.24 fps, ETA 00h00m00s)
Encoding successfully done!
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\User\AppData\Roaming\Python\Python311\Scripts\havc.exe\__main__.py", line 7, in <module>
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\app.py", line 37, in main
videos.search()
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\search.py", line 48, in search
sub_delete_folder = self.create_delete_sub_folder(root, delete_folder)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\search.py", line 80, in create_delete_sub_folder
return delete_folder.create_folder(delete_folder_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\User\AppData\Roaming\Python\Python311\site-packages\havc\services\directory.py", line 26, in create_folder
os.mkdir(new_directory)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'D:\\_CONVERTED\\Comedy\\Bert Kreisher - The Machine (2016)'
Hello, please update once again to version 1.2.1.
Let me know if it worked!
Thank you for your patience by the way 👍
Everything looks good so far, I'll let the batch run and see how it goes! Thanks for the fast response times :smiley:
Here's a log, valid for 29 days. Thanks once again! I'll include the BAT file for anyone else to use as a template if they want. I know it's ugly :upside_down_face:
@echo off
TITLE HAVC CONVERTER
pip install --user -U havc
cls
ECHO INSTALLED HAVC!
ECHO ENTERING D:
cd /d "D:\"
ECHO CONVERTING EVERYTHING TO MP4!
ECHO !!!!!! NOTICE !!!!!!
ECHO IF AN MP4 FAILS TO CONVERT
ECHO CHANGE EXTENSION TO .M4V
ECHO THEN RERUN!
havc --root "C:\ProgramData\chocolatey\bin" --convert "D:\TargetFolderName" --extensions avi m4v mkv mov mp2 mpeg mpg vob wmv --target mp4 --delete-folder "D:\_CONVERTED" --custom-command "--preset='H.265 NVENC 1080p' --subtitle-lang-list eng --optimize -i {of} -o {cf}"
ECHO DONE!
pause
Command that works when only going one dir deep:
havc --root "C:\ProgramData\chocolatey\bin" --convert "D:\Comedy" --extensions avi m4v mkv mov mp2 mpeg mpg vob wmv --target mp4 --delete-folder "D:\_CONVERTED" --custom-command "--preset='H.265 NVENC 1080p' --all-subtitles --optimize -i {of} -o {cf}"
Expected valid path:
"D:\Comedy\Andrew Santino - Cheeseburger (2023)\Andrew Santino - Cheeseburger (2023).mkv"
Invalid path after losing the parent dir:"D:\Comedy\Andrew Santino - Cheeseburger (2023).mkv"
LOG:
Thanks for creating this!