2

I've downloaded Open Video Downloader which is a gui to youtube-dl (which is kinda dead)
I've replaced it with yt-dlp (youtube-dl fork which is working)

My problem is that yt-dlp needs python 3.7+ to work. When OpenVideoDownloader spawns /home/myuser/.youtube-dl-gui/yt-dlp-unix, I get an error regarding this, because I've set Python 2.7 as default in my Ubuntu 20.04

I've installed python3.9 and running this on bash works:

/usr/bin/python3.9 /home/myuser/.youtube-dl-gui/yt-dlp-unix https://www.youtube.com/watch?v=ceiyvKwpRRo*

So, how could I replace /home/myuser/.youtube-dl-gui/yt-dlp-unix with another executable/batch/alias that really calls /usr/bin/python3.9 /home/myuser/.youtube-dl-gui/yt-dlp-unix (with all the parameters given) so OpenVideoDownloader can spawn it and work fine?

All this because I've read if I set python3.9 as default I may break my Ubuntu install, etc.

Thanks for any idea

2
  • Can't you just edit /home/myuser/.youtube-dl-gui/yt-dlp-unix and change #!/usr/bin/python to #!/usr/bin/python3.9?
    – terdon
    Sep 22, 2022 at 14:20
  • videohelp.com/software/Open-Video-Downloader for linux. I use youtube-dl all the time. it works fine for me. version 2021.12.17
    – pierrely
    Sep 25, 2022 at 2:44

1 Answer 1

3
Script

Create a script in your path with these contents: (called ytdl in this example)

#!/bin/bash

/usr/bin/python3.9 /home/myuser/.youtube-dl-gui/yt-dlp-unix "$@"

"$@" means all parameters will be passed on.

If you want to add a fixed parameter, include it in the script:

#!/bin/bash

/usr/bin/python3.9 /home/myuser/.youtube-dl-gui/yt-dlp-unix --ffmpeg-location '/usr/bin/ffmpeg' "$@"

Make it executable:

chmod +x ./ytdl
Alias

You can achieve the same thing by just creating an alias:

alias ytdl="/usr/bin/python3.9 /home/myuser/.youtube-dl-gui/yt-dlp-unix --ffmpeg-location '/usr/bin/ffmpeg'"

Arguments are automatically passed to an alias, so you just have to source the file containing the alias (for instance ~/.bashrc or ~/.bash_aliases).

Now running ytdl will do what you want.

1
  • Worked flawlessly. Thanks a lot !
    – Enrique
    Sep 21, 2022 at 14:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .