axcore / tartube

A GUI front-end for youtube-dl, partly based on youtube-dl-gui and written in Python 3 / Gtk 3
GNU Lesser General Public License v2.1
2.12k stars 112 forks source link

Tartube commands aren't compatiable with zsh #654

Closed MM4096 closed 4 weeks ago

MM4096 commented 1 month ago

Thanks for taking the time to submit a bug report! Please include the following information:

What operating system are you using?

Linux (Ubuntu 24)

What version of Tartube are you using?

2.5.0

If your bug report is "I can't download this video", please provide a link to the video

The commands run by Tartube (yt-dlp commands) do not work on a zsh shell, resulting in the following output:

yt-dlp --newline -i --hls-prefer-native --cookies /home/coding/Documents/Tartube/cookies.txt -f bestvideo[height<=?720]+bestaudio/best[height<=?720] --output /home/coding/Documents/Tartube/Downloads/%(title)s.%(ext)s https://www.youtube.com/watch\?v\=cJ-pQaNCDAQ

zsh: bad pattern: bestvideo[height

I assume this is because zsh has ? be a matching character, and isn't well escaped.

axcore commented 1 month ago

I can reproduce this using yt-dlp alone. Namely, in zsh:

yt-dlp -f bestvideo[height<=?720]+bestaudio/best[height<=?720] https://www.youtube.com/watch\?v\=cJ-pQaNCDAQ
zsh: bad pattern: bestvideo[height

I can't reproduce it using when running Tartube from zsh. Specifically, on Linux Mint I open the Gnome terminal, and type

zsh
python3 tartube/tartube

Then in Tartube's window, I click Edit > General download options, and add this to the Additional download options box:

-f bestvideo[height<=?720]+bestaudio/best[height<=?720]

In this case, the download of your video is successful. Perhaps you can spot what I haven't done that would reproduce the problem.

axcore commented 1 month ago

For yt-dlp, the problem can be resolved by enclosing the download option in quotes, i.e.

-f "bestvideo[height<=?720]+bestaudio/best[height<=?720]"

In Tartube, there is a complication: because of some Python and/or shell behaviour I don't understand, enclosing each download option within quotes creates more problems than it solves.

You could try using the quotes in Edit > General download options, but I can't predict what effect it will have:

-f "bestvideo[height<=?720]+bestaudio/best[height<=?720]"

MM4096 commented 1 month ago

I also can't reproduce this by running bash then zsh to emulate coming from a bash terminal. However, running tartube straight from a zsh terminal (and a zsh environment) results in this quote problem.

axcore commented 4 weeks ago

Sorry for such a long day in replying. Today I tested Tartube running in zsh. This time I'm sure it really is zsh, and not bash:

zshell

The video from your original post is no longer available on YouTube. I tried several other brand new videos, but could reproduce your error using them. Do you have a video whose link is still available?

MM4096 commented 4 weeks ago

As it appears, I had an earlier version of Tartube installed (2.5.0-1). Updating to the latest version has fixed this problem.