DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
Old 11th October 2018
bsd007's Avatar
bsd007 bsd007 is offline
Always learning
 
Join Date: Sep 2014
Posts: 242
Default

Quote:
Originally Posted by IdOp View Post
You'll also need to quote the special characters in the URL to protect them from the shell, so try something like this (once path issues are resolved):

% youtube-dl 'https://www.youtube.com/watch?v=qb3qUW4EyHc'

(Note the single quotes in red.)
Tried

Code:
$ youtube-dl 'https://www.youtube.com/watch?v=qb3qUW4EyHc'                                           
home$
Same situation, no download.
Reply With Quote
Old 11th October 2018
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

www.youtube-dl is python based and upstream provides an update mechanism:
https://rg3.github.io/youtube-dl/download.html.

You can install/update directly from upstream and the binary will go in the correct place. Some of the documentation (man pages) will not. If you try this on an installed package, it would work but give you some, mostly harmless, extraneous documentation files. It also will not pkg_delete cleanly due to a checksum mismatch.

http://cvsweb.openbsd.org/cgi-bin/cv...ype=text/plain

The other option would be to install from ports and when you need an update, tweak the port to package the latest version to /usr/ports/packages (make package). Then set the PKG_PATH to /usr/ports/packages and pkg_add -u youtube-dl.
Reply With Quote
Old 11th October 2018
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 335
Default

Quote:
Originally Posted by bsd007 View Post
Tried

Code:
$ youtube-dl 'https://www.youtube.com/watch?v=qb3qUW4EyHc'                                           
home$
Same situation, no download.
You're probably still using the old one. Run which youtube-dl to confirm.

By the way you don't need the full YouTube URL (e.g. ~/bin/youtube-dl --no-cache-dir --no-part --continue -f18 qb3qUW4EyHc).

And you'll need the quote marks only for video IDs starting with a dash (to prevent the shell from interpreting these as options/parameters).
__________________
May the source be with you!
Reply With Quote
Old 11th October 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by Beastie View Post
You're probably still using the old one.
This.

bsd007, you seem confused about executable paths. If so, I hope you are not offended by this attempt to clarify Beastie's comment.

A shell's $PATH specifies the directories searched for an executable file by name, and the order the directories are searched. The first directory found to contain a match wins.

The default $PATH for a Bourne-based shell (stored in a new user's $HOME directory as .profile) at 6.3-release is:
Code:
PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games
I will guess your new executable file is not in your $PATH, but might be sitting in your $HOME directory, and your shell is executing the first one it finds in the $PATH, which will be /usr/local/bin/youtube-dl, installed there via pkg_add(1). The recommendation to use which(1) is to determine absolutely which executable you are running when you tell the shell to execute the program without specifying an absolute path.

You can execute the file in your $HOME directory with these two short form absolute paths: $ $HOME/youtube-dl or $ ~/youtube-dl. If the file is sitting in your current working directory you can use the short form "." to execute it, with $ ./youtube-dl.
Reply With Quote
Old 11th October 2018
bsd007's Avatar
bsd007 bsd007 is offline
Always learning
 
Join Date: Sep 2014
Posts: 242
Default

@Beastie
No I am pretty sure I am not running the old version. I have uninstalled the old version.
Code:
$ which youtube-dl
/home/myusername/bin/youtube-dl
I have copied youtube-dl to /home/myusername/bin then made it executable.

@jggimi

When I type "yout" and press tab it auto completes so I guess the path is working.

Last edited by bsd007; 11th October 2018 at 07:06 PM.
Reply With Quote
Old 11th October 2018
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 335
Default

Alright, then. Does it even run? What happens after python ~/bin/youtube-dl?
__________________
May the source be with you!
Reply With Quote
Old 12th October 2018
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

Have you tried multimedia/py-pafy? It will use youtube-dl if it finds it, otherwise it has its own internal downloader. The executable name is ytdl.
Reply With Quote
Old 12th October 2018
bsd007's Avatar
bsd007 bsd007 is offline
Always learning
 
Join Date: Sep 2014
Posts: 242
Default

Quote:
Originally Posted by Beastie View Post
Alright, then. Does it even run? What happens after python ~/bin/youtube-dl?
Code:
 python ~/bin/youtube-dl
ksh: python: not found
Reply With Quote
Old 12th October 2018
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 335
Default

Quote:
Originally Posted by bsd007 View Post
Code:
 python ~/bin/youtube-dl
ksh: python: not found
Are you sure Python is installed? Is it accessible in your PATH?

What's the output of whereis python?

Does python run the interpreter?
__________________
May the source be with you!
Reply With Quote
Old 12th October 2018
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

No executable named python is ever installed through packages. You're looking for python2 or python3.
Reply With Quote
Old 12th October 2018
bsd007's Avatar
bsd007 bsd007 is offline
Always learning
 
Join Date: Sep 2014
Posts: 242
Default

Quote:
Originally Posted by Beastie View Post
Are you sure Python is installed? Is it accessible in your PATH?

What's the output of whereis python?
Code:
$ whereis python
home$
^^ Returns nothing.

Quote:
Originally Posted by Beastie View Post
Does python run the interpreter?
I don't know how to check that.
Reply With Quote
Old 12th October 2018
ibara ibara is offline
OpenBSD language porter
 
Join Date: Jan 2014
Posts: 783
Default

You just did check if running python runs the interpreter. And the shell told you
Code:
ksh: python: not found
The interpreter name is python2 (or python3, if you prefer Python 3).
Reply With Quote
Old 12th October 2018
bsd007's Avatar
bsd007 bsd007 is offline
Always learning
 
Join Date: Sep 2014
Posts: 242
Default

Quote:
Originally Posted by ibara View Post
You just did check if running python runs the interpreter. And the shell told you
Code:
ksh: python: not found
The interpreter name is python2 (or python3, if you prefer Python 3).
Code:
$ pkg_info -Q python                                                       
biopython-1.66p1
bpython-0.17.1
bpython3-0.17.1
collectd-python-5.7.2p1
compizconfig-python-0.8.4p2
diveintopython-5.4p1
diveintopython3-20130531
freeradius-python-3.0.16
hamlib-python-1.2.15.3p0
ipython-5.3.0
ipython3-5.3.0
libvirt-python-1.3.5p0
opensmtpd-extras-python-201703132115p1
postgresql-plpython-10.3
py-GitPython-1.0.2
py-dnspython-1.15.0 (installed)
py-ipython_genutils-0.2.0
py-python2-pythondialog-3.3.0p0
py-wxPython-2.8.12.0p4
py3-dnspython-1.15.0
py3-ipython_genutils-0.2.0
python-2.7.14p1 (installed)
python-3.6.4p0 (installed)
python-bsddb-2.7.14
python-gdbm-2.7.14
python-gdbm-3.6.4
python-idle-2.7.14p0
python-idle-3.6.4
python-tests-2.7.14
python-tests-3.6.4
python-tkinter-2.7.14
python-tkinter-3.6.4
python-tools-2.7.14
texworks-python-0.4.4p3v0
weechat-python-2.0.1
xapian-bindings-python-1.4.5p0
Looks like they are installed.
Reply With Quote
Old 12th October 2018
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

You do not have an executable named "python" - this is why you get the message from ksh that it is not found. The executable files are named "python2.7", or "python3.6" (or its symbolic link, "python3").

Please take note of these names.

When you installed python2.7, you missed this message on your console:
Code:
If you want to use this package as your default system python, as root
create symbolic links like so (overwriting any previous default):
 ln -sf /usr/local/bin/python2.7 /usr/local/bin/python
 ln -sf /usr/local/bin/python2.7-2to3 /usr/local/bin/2to3
 ln -sf /usr/local/bin/python2.7-config /usr/local/bin/python-config
 ln -sf /usr/local/bin/pydoc2.7  /usr/local/bin/pydoc
There is no such message for python 3.6, but you are welcome to make the same symbolic links if you wish.
Reply With Quote
Old 12th October 2018
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 335
Default

Quote:
Originally Posted by jggimi View Post
When you installed python2.7, you missed this message on your console:
Code:
If you want to use this package as your default system python, as root
create symbolic links like so (overwriting any previous default):
 ln -sf /usr/local/bin/python2.7 /usr/local/bin/python
 ln -sf /usr/local/bin/python2.7-2to3 /usr/local/bin/2to3
 ln -sf /usr/local/bin/python2.7-config /usr/local/bin/python-config
 ln -sf /usr/local/bin/pydoc2.7  /usr/local/bin/pydoc
There is no such message for python 3.6, but you are welcome to make the same symbolic links if you wish.
Whoops, I assumed everyone had these, hence the numerous suggestions to use python and the ensuing confusion. Let's hope this settles the issue.
__________________
May the source be with you!
Reply With Quote
Old 27th October 2018
hrsetrdr's Avatar
hrsetrdr hrsetrdr is offline
Port Guard
 
Join Date: Jul 2008
Posts: 25
Default

Quote:
Originally Posted by bsd007 View Post
I installed youtube-dl but it refuses to work coz its out of date.

Please suggest me a Firefox addon for downloading Youtube videos.
..or you could choose one of many mp4 converter sites, if downloading the actual video file is your main purpose.
Reply With Quote
Old 2nd November 2019
fvgit's Avatar
fvgit fvgit is offline
Spikes in tights
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("U2hlcndvb2QgRm9yZXN0")'
Posts: 314
Default

(Didn't want to start a separate topic for this...)

A couple of moments ago I found out you can download entire playlists with youtube-dl. Works the same as with individual videos and it's enough to just supply the playlist-id.

Just finished downloading 30 vids in one go.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No sound problem on Youtube with OpenBSD 6.2/6.3 and Firefox (temporary solution) new2BSDlol OpenBSD Packages and Ports 3 12th July 2018 10:11 PM
Firefox in OpenBSD 6.0 supports YouTube videos bsd-keith OpenBSD Packages and Ports 1 3rd September 2016 03:01 PM
how to watch youtube videos on OpenBSD? lucas34 OpenBSD Packages and Ports 28 11th March 2014 06:34 PM
Router blocking downloading/ limit downloading kelly General software and network 2 24th August 2011 08:13 PM
firefox, linux-flash, nspluginwrapper, and youtube? neurosis FreeBSD Ports and Packages 16 15th August 2008 06:46 AM


All times are GMT. The time now is 07:22 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick