Drifty: [BUG] YouTube video link with playlist parameter is mistaken as playlist link
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
https://github.com/user-attachments/assets/db281ab2-10d2-4a25-811f-da45f78b4cad
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.
https://github.com/SaptarshiSarkar12/Drifty/blob/3fff0e5e05a4fd871b50129aefff458ac246d59d/GUI/src/main/java/ui/GetFilename.java#L172-L192
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.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 67 (37 by maintainers)
Commits related to this issue
- Fix: Added code to Standardized YouTube link format for issue #601 — committed to Tarunkumarkanakam/Drifty by Tarunkumarkanakam 2 years ago
- Add: Added extractQueryParams function for issue #601 — committed to Tarunkumarkanakam/Drifty by Tarunkumarkanakam 2 years ago
- Fix: Added code to Standardized YouTube link format for issue #601 — committed to Tarunkumarkanakam/Drifty by Tarunkumarkanakam 2 years ago
- Add: Added extractQueryParams function for issue #601 — committed to Tarunkumarkanakam/Drifty by Tarunkumarkanakam 2 years ago
@Tarunkumarkanakam
You are right. Moreover, the current version of drifty doesn’t detect duplicate links if they have the tracking parameter different although the ID of video or playlist is same. So, your method would also help in that case.
Right 👍. There should be a
/instead of\inyoutu.be\{videoID}.Right. Agreed 💯.
Please don’t use
youtu.be/{videoID}. Instead useyoutube.com/watch?v={videoID}oryoutube.com/playlist?list={listID}because you can have bothplaylistsandvideosunder the same domain asyoutu.bedoesn’t support playlists. What do you think?We can connect through LinkedIn, https://www.linkedin.com/in/tarun-kanakam
This is the updated code in Drifty_CLI.java This handles any type of YouTube link thrown by the user. This is right after the Instagram link handling in main method of Drifty_CLI.java
I’m preparing screenshots and short videos, I’ll send once done
Yep it worked, I’ll work on it and let you know. If possible can you list out the things that need to be finished
Yes its WSL 2
😔 Same issue
Unable to open DISPLAYGot it
Interesting. It used to work some months back and without even a small change, it stopped working now 😢. How inconsistent can these systems be 🙃!
😄 Well I’m a Windows, Mac and a Linux user. LoL XD
@Tarunkumarkanakam I think yes. I don’t have a windows machine and I tried multiple times to install wsl in my Windows VM but it failed each time and finally destructed the whole VM, so, I had to delete the whole setup 😢. The docs regarding the docker setup for Windows also needs to be more detailed but, this project is lacking in contributors now, I suppose 😆.
@SaptarshiSarkar12 When I executed the CLI with code from the master branch using
docker-compose run cli. I am getting the error as in the image attached. Is that an issue that needs to be reported?EDIT: Sorry, My bad it’s my firewall issue. 😞