Open a0ali0taha opened 1 year ago
⚡ Sweep Free Trial: I used GPT-3.5 to create this ticket. You have 4 GPT-4 tickets left for the month and 0 for the day. For more GPT-4 tickets, visit our payment portal. To retrigger Sweep, edit the issue.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
From looking through the relevant snippets, I decided to make the following modifications:
File Path | Proposed Changes |
---|---|
all.py |
Modify all.py with contents: • Add a new function 'process_all_videos_in_dir(directory)' at the end of the file. This function should get a list of all mp4 files in the specified directory, and then call the existing functions 'detach_audio', 'separate_vocals_with_spleeter', and 'attach_audio' for each file. • Modify the main part of the script to call 'process_all_videos_in_dir' with the directory specified by the user. |
gui.py |
Modify gui.py with contents: • Add a new input field for the directory selection. This can be done using the 'tkinter.filedialog.askdirectory' function, which opens a dialog for the user to select a directory. • Modify the 'download_button_clicked' function to get the selected directory from the new input field and pass it to the 'download_youtube_video' and 'process_all_videos_in_dir' functions. |
start.bat |
Modify start.bat with contents: • Modify the line that calls 'python all.py' to 'python all.py %dir%', where '%dir%' is the directory selected by the user in the GUI. |
I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:
Add script to loop over mp4 files and GUI for selecting input folder
sweep/add-loop-script-and-gui
Description
This PR adds a new script to loop over mp4 files in a selected directory and a GUI for selecting the input folder. The script and GUI have been added to the existing codebase to enhance the functionality of the application.
Summary of Changes
- Modified
all.py
script to include a new functionprocess_all_videos_in_dir(directory)
that loops over all mp4 files in the specified directory and calls the existing functions for processing a single video file.- Modified
gui.py
script to add a new input field for selecting the input folder using thetkinter.filedialog.askdirectory
function.- Modified the
start.bat
script to call the modifiedall.py
script with the selected directory.These changes allow the application to process multiple video files at once and provide a user-friendly way to select the input folder.
Please review and merge these changes. Thank you!
File | Instructions | Progress | |
---|---|---|---|
all.py |
Modify all.py with contents: • Add a new function 'process_all_videos_in_dir(directory)' at the end of the file. This function should get a list of all mp4 files in the specified directory, and then call the existing functions 'detach_audio', 'separate_vocals_with_spleeter', and 'attach_audio' for each file. • Modify the main part of the script to call 'process_all_videos_in_dir' with the directory specified by the user. |
✅ Commit 6b92cf4 |
|
gui.py |
Modify gui.py with contents: • Add a new input field for the directory selection. This can be done using the 'tkinter.filedialog.askdirectory' function, which opens a dialog for the user to select a directory. • Modify the 'download_button_clicked' function to get the selected directory from the new input field and pass it to the 'download_youtube_video' and 'process_all_videos_in_dir' functions. |
✅ Commit 64489f9 |
|
start.bat |
Modify start.bat with contents: • Modify the line that calls 'python all.py' to 'python all.py %dir%', where '%dir%' is the directory selected by the user in the GUI. |
✅ Commit 64489f9 |
I have finished coding the issue. I am now reviewing it for completeness. |
Here are my self-reviews of my changes at sweep/add-loop-script-and-gui
.
Here is the 1st review
Thanks for your contribution. There are a few changes that need to be made:
- In
all.py
, please import theos
module at the top of the file. This module is used in theprocess_all_videos_in_dir(directory)
function but is not currently imported.- In
all.py
, thedir
variable is used but not defined. Please define this variable or replace it with a suitable alternative.- In
gui.py
, please import theprocess_all_videos_in_dir(directory)
function fromall.py
. This function is used in thestart_download_youtube_video()
function but is not currently imported.- In
start.bat
, the%dir%
argument is passed toall.py
, butall.py
does not currently accept command-line arguments. Please modifyall.py
to accept a directory as a command-line argument, or modifystart.bat
to not pass the%dir%
argument.Please make these changes and submit a new pull request. If you need any help, feel free to ask.
I finished incorporating these changes.
🎉 Latest improvements to Sweep:
💡 To recreate the pull request edit the issue title or description. Join Our Discord
Sweep: add GUI for selecting the input folder
add a new script to loop on mp4 files
Checklist
- [X] `all.py` > • Add a new function 'process_all_videos_in_dir(directory)' at the end of the file. This function should get a list of all mp4 files in the specified directory, and then call the existing functions 'detach_audio', 'separate_vocals_with_spleeter', and 'attach_audio' for each file. > • Modify the main part of the script to call 'process_all_videos_in_dir' with the directory specified by the user. - [X] `gui.py` > • Add a new input field for the directory selection. This can be done using the 'tkinter.filedialog.askdirectory' function, which opens a dialog for the user to select a directory. > • Modify the 'download_button_clicked' function to get the selected directory from the new input field and pass it to the 'download_youtube_video' and 'process_all_videos_in_dir' functions. - [X] `start.bat` > • Modify the line that calls 'python all.py' to 'python all.py %dir%', where '%dir%' is the directory selected by the user in the GUI.