Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #246369

Re: recommend music player?

From Emanuel Berg <moasenwood@zoho.eu>
Newsgroups linux.debian.user
Subject Re: recommend music player?
Date 2022-03-17 04:40 +0100
Message-ID <E1P9v-2gf5-5@gated-at.bofh.it> (permalink)
References <E1G6d-2ayW-1@gated-at.bofh.it> <E1OZP-2gbz-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


황병희 wrote:

> Personally my computer is chromebook. I installed Debian 11
> Bullseye inside chromebook. In that case, YouTube is very
> useful music player. Ok man sorry for off-topic music
> player. Though YouTube is so awesome, at least, to me ...

Uhm ... YouTube?!

While YouTube is a great _database_ for multimedia, the
interface is usually what people dislike about it.

Compared to mpv ... yeah, it is a toy.

But: Here [last] are a bunch of commands that can help you get
the material, or a bunch of material actually, from a single
search string ...

This will give you, hopefully, what is good about YouTube so
you can then combine it with that is awesome about mpv and get
the best of both worlds.

Test with, e.g. this awesome video:

  https://www.youtube.com/watch?v=SdL55HWNPRM

#! /dev/zsh
#
# this file:
#   https://dataswamp.org/~incal/conf/.zsh/dl

dl_resume=".dl"

dl-resume () {
    if [[ -f $dl_resume ]]; then
        rtorrent $(cat $dl_resume)
    else
        echo "Cannot resume, no $dl_resume file" >&2
    fi
}

dl () {
    local urls=${1:-$(<$DL_FILE)}

    if [[ $urls == magnet* ]]; then
        echo $urls > $dl_resume
        rtorrent ${=urls}
    elif [[ $urls == http* ]]; then
        dl-both $urls
    fi
}

dlp_opts=(-i -q --no-colors --no-warnings)

dl-both () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts ${=urls}
}

dl-video () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestvideo' ${=urls}
}

dl-audio () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestaudio' ${=urls}
}

dl-1080-up () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestvideo[height>=1080]+bestaudio' ${=urls}
}

dl-720-up () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestvideo[height>=720]+bestaudio' ${=urls}
}

dl-2160 () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestvideo[height=2160]+bestaudio' ${=urls}
}

dl-1080 () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestvideo[height=1080]+bestaudio' ${=urls}
}

dl-720 () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestvideo[height=720]+bestaudio' ${=urls}
}

dl-2160-video () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestvideo[height=2160]' ${=urls}
}

dl-1080-up-video () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestvideo[height>=1080]' ${=urls}
}

dl-720-up-video () {
    local urls=${1:-$(<$DL_FILE)}
    yt-dlp $dlp_opts -f 'bestvideo[height>=720]' ${=urls}
}

dl-all () {
    local fun=$1
    shift
    local search=$@

    local name=$funcstack[1]
    local file=.${name}-str.txt

    if [[ $fun == 'cat' ]]; then
        cat $file
    else
        echo $search >> $file

        local hits=$(printf '%s\t%s\r\n' /youtube.cgi $search |
                     nc git.codemadness.org 70                |
                     awk -F '\t' '/^h.*embed/ { sub("URL:", "", $2); print $2 }')
        $fun $hits
    fi
}
alias dac='dl-all cat'

dl-all-1080-up () {
    local search=$@
    dl-all dl-1080-up $search
}
alias da=dl-all-1080-up

dl-all-720-up () {
    local search=$@
    dl-all dl-720-up $search
}

dl-all-both () {
    local search=$@
    dl-all dl-both $search
}

dl-all-2160-video () {
    local search=$@
    dl-all dl-2160-video $search
}
alias dl-all-4k-video=dl-all-2160-video

dl-all-2160 () {
    local search=$@
    dl-all dl-2160 $search
}
alias dl-all-4k=dl-all-2160

dl-all-1080 () {
    local search=$@
    dl-all dl-1080 $search
}

dl-all-720 () {
    local search=$@
    dl-all dl-720 $search
}

dl-all-1080-up-video () {
    local search=$@
    dl-all dl-1080-up-video $search
}

dl-all-720-up-video () {
    local search=$@
    dl-all dl-720-up-video $search
}

dl-up-down () {
    local search=$@
    dl-all dl-2160 $search
    dl-all dl-1080 $search
    dl-all dl-720  $search
}

dl-all-video () {
    local search=$@
    dl-all dl-video $search
}

dl-all-audio () {
    local search=$@
    dl-all dl-audio $search
}
alias daa=dl-all-audio

dl-music () {
    local songs=($@)

    local s
    local hit
    for s in $songs; do
        hit=$(printf '%s\t%s\r\n' /youtube.cgi $s |
              nc git.codemadness.org 70           |
              head -n 1                           |
              awk -F '\t' '/^h.*embed/ { sub("URL:", "", $2); print $2 }')
        dl-audio $hit
    done
}

-- 
underground experts united
https://dataswamp.org/~incal

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

recommend music player? kaye n <guikaye@gmail.com> - 2022-03-16 19:00 +0100
  Re: recommend music player? Devin Prater <r.d.t.prater@gmail.com> - 2022-03-16 19:00 +0100
    Re: recommend music player? Jude DaShiell <jdashiel@panix.com> - 2022-03-16 19:20 +0100
      Re: recommend music player? Emanuel Berg <moasenwood@zoho.eu> - 2022-03-16 21:50 +0100
  Re: recommend music player? Markus Schönhaber <debian-user@list-post.mks-mail.de> - 2022-03-16 19:20 +0100
  Re: recommend music player? "Alexander V. Makartsev" <avbetev@gmail.com> - 2022-03-16 20:30 +0100
    Re: recommend music player? Cindy Sue Causey <butterflybytes@gmail.com> - 2022-03-16 20:40 +0100
  Re: recommend music player? Dan Ritter <dsr@randomstring.org> - 2022-03-17 01:10 +0100
    Re: recommend music player? Chris Mitchell <d-u@chris.oldnest.ca> - 2022-03-17 13:00 +0100
  Re: recommend music player? 황병희 <soyeomul@doraji.xyz> - 2022-03-17 04:30 +0100
    Re: recommend music player? Emanuel Berg <moasenwood@zoho.eu> - 2022-03-17 04:40 +0100
      Re: recommend music player? Byung-Hee HWANG <soyeomul@doraji.xyz>  - 2022-03-17 11:30 +0100
        Re: recommend music player? Byung-Hee HWANG <soyeomul@doraji.xyz>  - 2022-03-17 11:50 +0100
  Re: recommend music player? A_Man_Without_Clue <love.chaser@gmail.com> - 2022-03-17 04:30 +0100

csiph-web