yt-player.sh
a wrapper script for youtube-dl
and omxplayer
The following covers how to install this branch within a user account
Install Dependencies
sudo pip install --upgrade youtube-dl
Git Commands
-
Make a directory for Git sources
-
Change current directory to sub-directory path
-
Clone the source and any submodule dependencies
mkdir -vp "${HOME}/git/hub/rpi-curious"
cd "${HOME}/git/hub/rpi-curious"
git clone --recurse-submodules git@github.com:rpi-curious/yt-player.git
Install Commands
-
Link
yt-player.sh
to aPATH
accessible location -
Set ownership and executable permissions
mkdir ~/bin
ln -s "${HOME}/git/hub/rpi-curious/yt-player/yt-player.sh" "${HOME}/bin/"
chown ${USER}:${GROUPS} ~/bin/yt-player.sh
chmod u+x "${HOME}/git/hub/rpi-curious/yt-player/yt-player.sh"
Update
-
Change directory to repository root
-
Pull changes to source code
-
Update submodules utilized by this repository
cd "${HOME}/git/hub/rpi-curious/yt-player"
git pull
git submodule update --init --recursive --merge
Arguments | Type | Description |
---|---|---|
both hdmi local alsa |
boolean | Set audio output for omxplayer |
10 -10 |
number | Set volume in millibels for omxplayer |
http* |
string | space separated list of URLs for youtube-dl to parse |
Example
yt-player.sh hdmi 10\
'https://www.youtube.com/playlist?list=PL45KLPZcC-zM_G2wTBt6NH-oqXUYt3ns7'\
'https://www.youtube.com/watch?v=jxf8NBA3STc'\
'https://www.youtube.com/watch?v=nuNVRKBkfXI'
Silent pauses are to be expected for playlists, this is likely because of parsing youtube-dl
output via Bash (receives entire list), where as Python generators might shorten wait times; but that is speculation.
Live streams do not work as of last test, however, one may consider streamlink
...
sudo pip install --upgrade streamlink
... for such needs, check reddit
discussion for omxplayer
specific settings.
YT Player quick start documentation
Copyright (C) 2019 S0AndS0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation; version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.