-
Notifications
You must be signed in to change notification settings - Fork 139
Open
Labels
App 💻Issues/Pull Requests which update Drifty Application CodeIssues/Pull Requests which update Drifty Application CodeEddieHub:good-first-issueLabel for good-first-issue finder made by EddieHub CommunityLabel for good-first-issue finder made by EddieHub Communitybug 🐛Issues/Pull Requests reporting/fixing a bugIssues/Pull Requests reporting/fixing a buggood first issueGood for newcomersGood for newcomers
Milestone
Description
Describe the bug
A person clicked on a video from a YouTube playlist and when the link to the video is pasted in Drifty,
- Drifty GUI tries to fetch the video name indefinitely. It also shows a popup window mentioning how many videos are there in the playlist but, it fails to download any. So, it keeps on detecting filename and computer heats up.
- Drifty CLI shows an error that it fails to detect the filename and prompts the user to exit.
Steps To Reproduce
- Open Drifty GUI application.
- Paste a YouTube video link (containing both
watch?v=andlist=parameters), for example, this link - https://www.youtube.com/watch?v=uy_PEGgUF4U&list=PL0lo9MOBetEFGPccyxyfex8BYF_PQUQWn&index=1 - You can see that Drifty GUI tries to fetch the filename and the progress bar moves continuously indefinitely.
- Repeat the same in Drifty CLI to see that bug also.
Expected Behavior
Drifty must recognize that the URL is of a YouTube video and not of any playlists.
Screenshots
Drifty CLI
Drifty GUI
File.Name.detection.going.on.for.indefinite.time.mp4
Additional information
A regex match to identify if the provided link is a YouTube playlist or a specific YouTube video link, must be added.
Yt-dlp fails to identify if a specific video is asked rather than the full playlist as seen when this code fragment is executed.
Drifty/GUI/src/main/java/ui/GetFilename.java
Lines 172 to 192 in 3fff0e5
| String command = Program.get(YT_DLP); | |
| String[] args = new String[]{command, "--flat-playlist", "--skip-download", "-P", dir, link}; | |
| ProcessBuilder pb = new ProcessBuilder(args); | |
| pb.redirectErrorStream(true); | |
| Process process = pb.start(); | |
| StringJoiner joiner = new StringJoiner(lineFeed); | |
| try { | |
| try ( | |
| InputStream inputStream = process.getInputStream(); | |
| BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)) | |
| ) | |
| { | |
| String line; | |
| while ((line = reader.readLine()) != null) { | |
| if (this.isCancelled()) { | |
| break; | |
| } | |
| joiner.add(line); | |
| feedback.setValue(joiner.toString()); | |
| } | |
| } |
A possible and reliable soluyion is to truncate the url upto the specific video id (the resultant url will be of the form
https://www.youtube.com/watch?v=uy_PEGgUF4U).
If anyone wants to work on this issue, please comment below.
Metadata
Metadata
Assignees
Labels
App 💻Issues/Pull Requests which update Drifty Application CodeIssues/Pull Requests which update Drifty Application CodeEddieHub:good-first-issueLabel for good-first-issue finder made by EddieHub CommunityLabel for good-first-issue finder made by EddieHub Communitybug 🐛Issues/Pull Requests reporting/fixing a bugIssues/Pull Requests reporting/fixing a buggood first issueGood for newcomersGood for newcomers
Projects
Status
In Progress
