diff options
author | Miquel Lionel <lionel@les-miquelots.net> | 2022-05-07 19:44:36 +0200 |
---|---|---|
committer | Miquel Lionel <lionel@les-miquelots.net> | 2022-05-07 19:44:36 +0200 |
commit | edf62abd0c7b9bb7a99e313056c7563a1e24b84a (patch) | |
tree | 03b64fbc622dbc4bc0c2a248111d6305d12fe21e /ytagslurp | |
download | ytagslurp-edf62abd0c7b9bb7a99e313056c7563a1e24b84a.tar.gz ytagslurp-edf62abd0c7b9bb7a99e313056c7563a1e24b84a.zip |
First commit, license and script added
Diffstat (limited to 'ytagslurp')
-rwxr-xr-x | ytagslurp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ytagslurp b/ytagslurp new file mode 100755 index 0000000..b534f00 --- /dev/null +++ b/ytagslurp @@ -0,0 +1,32 @@ +#!/bin/sh +# ytagslurp: extract tags from a youtube video + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# 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 General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <https://www.gnu.org/licenses/>. + +# Copyright (c) 2022, Miquel Lionel <lionel@les-miquelots.net> + +INVIDIOUS_INSTANCE=yewtu.be +URL="$1" +DOMAIN="$(echo $URL | cut -d/ -f3)" + +if [ -z "$URL" ]; then + echo No URL provided + printf "Copyright (c) 2022, Miquel Lionel <lionel@les-miquelots.net>\n" + printf "\nytagslurp is a quite simple script to extract tags from a youtube video\n" + printf "usage: ytagslurp [youtube URL]\n" + exit 1 +fi + +SWAPPED_URL=$(echo $URL | sed "s/$DOMAIN/$INVIDIOUS_INSTANCE/g") +curl -s $SWAPPED_URL | grep "meta name=\"keywords\"" | cut -d\" -f4 |