Closed ghost closed 7 years ago
youtube-dl can already be installed from the python package index.
apt update && apt install python
pip install youtube-dl
I have this : [code] $ apt update && apt install python pip install youtube-dlHit:1 http://termux.net stable InReleaseReading package lists... DoneBuilding dependency treeReading state information... DoneAll packages are up to date.Reading package lists... DoneBuilding dependency treeReading state information... DoneE: Unable to locate package pipE: Unable to locate package installE: Unable to locate package youtube-dl [/code]
Try again with: apt update && apt install python; pip install youtube-dl
Note the semicolon before pip. pip is a command.
Sorry too late. I have found this http://techwiser.com/how-to-use-termux-to-download-youtube-videos/
curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /data/data/com.termux/files/usr/bin/youtube-dl
chmod a+rx /data/data/com.termux/files/usr/bin/youtube-dl
which youtube-dl
PS: This tool requires Python
@mskian
$ youtube-dl --version
bash: /data/data/com.termux/files/usr/bin/youtube-dl: /usr/bin/env: bad interpreter: No such file or directory
No issue on My side
did you install it on the correct location
which youtube-dl
output
/data/data/com.termux/files/usr/bin/youtube-dl
@mskian yes. It's because of the interpreter was set as /usr/local/env python
and there is no /usr/local/env
on (my) termux.
I could not change it because then it would complain about the binary being corrupted. (Why is this python script binary anyway?)
So I've installed the pip
version instead with apt install pip && pip install youtube-dl
and this one has the interpreter set as /data/data/com.termux/files/usr/bin/python
so this one works. :+1:
/usr/bin/env: bad interpreter: No such file or directory
It looks like it can't find /usr/bin/env
(because on Termux it is at /data/data/com.termux/files/usr/bin/env
).
Do you have termux-exec
installed?
If not, you should either install it or run termux-fix-shebang /data/data/com.termux/files/usr/bin/youtube-dl
@Rudloff Timing :sunglasses: we replied at the same time. Please read my previous reply too.
Do you have
termux-exec
installed?
Nope. What is this? I followed some tutorials last year to get termux up and running, but I haven't revisited it if some new tricks have been developed.
However, the pip install youtube-dl
version works without needing this solution, so my problem is solved. But for the sake of argument, why would we install this need-fix-version over the pip no-fix-needed version?
My intention was to get the newest version because I thought it was not in the pip list. But it turns out it is actually a brand new version. :smile:
termux-exec
is a package that you can install with apt install termux-exec
and it automatically replaces /usr/
pathes with their correct Termux variant, so you don't have to worry about this kind of problem.
(It's not bulletproof but works most of the time.)
@Rudloff Ah that is convenient, thank you.
At the risk of being annoyingly off-topic, I recognize the knowledge here and will shamelessly ask: Is there also a package that either fixes the root shell/prompt/tab-completion when using su
, or enables the non-su user to access your own phone folders such as /sdcard/Download
and /sdcard/Music
?
As a workaround I'm using termux-sudo, but it's not ideal to sudo everything, because all "my" folders on the SD card need root permission to be accessed/written to, from a termux perspective.
This is indeed pretty off-topic and I think this kind of question should be asked on the mailing-list. (But have you tried tsu? :stuck_out_tongue:)
Actually, yes, the shell doesn't tab-complete either. But I will investigate the possibilities more closely.
Back on topic, it turns out I was wrong, and I do have termux-exec
:
$ apt install termux-exec
Reading package lists... Done
Building dependency tree
Reading state information... Done
termux-exec is already the newest version (0.3).
termux-exec set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Still the non-termux youtube-dl
didn't work for me. Just mentioning this for the next person who finds this issue through google. I recommend the pip install youtube-dl
method. It works out of the box, and was updated two weeks ago.
I also use the pip version but the standalone version also works for me despite having /usr/bin/env
. So I'm not sure why it does not work for you.
I am comfortable with standalone version :100:
curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /data/data/com.termux/files/usr/bin/youtube-dl
Requires Python3
pkg install python
FFmpeg (For Audio Conversion)
pkg install ffmpeg
also Writing Bash script to download youtube videos in different formats (Using youtube-dl) - https://gist.github.com/mskian/d4a1d18dde779eac6c55c22bbc469862
Install youtube-dl on Termux via cURL Command
curl -sL https://gist.githubusercontent.com/mskian/6ea9c2b32d5f41867e7cafc88d1b26d5/raw/youtube-dl.sh | bash
if cURL not installed RUN - (pkg install curl
)
$ pkg install python ffmpeg $ pip install youtube-dl $ youtube-dl --version 2018.11.23
https://github.com/rg3/youtube-dl/