Skip to content

Commit

Permalink
thanks
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Mar 19, 2022
1 parent 8553f74 commit 770fb20
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/server/template/sya.html
Expand Up @@ -48,25 +48,25 @@ <h3>No download</h3>
<a href="https://github.com/yt-dlp/yt-dlp"><code>yt-dlp</code></a>
playlist
</strong>
with a few simple lines of code.
with a few simple lines of code. (Thanks to <a href="https://github.com/SuperSonicHub1">@SuperSonicHub1</a>!)
</p>
<pre><code>#!/bin/bash
# USAGE: stream-playlist playlist-url station-name

yt-dlp-to-ffconcat() {
local url=$1
yt-dlp --format bestaudio --get-url "$url" | sed -e "s/^/file '/" | sed -e "s/$/'/"
local url=$1
yt-dlp --format bestaudio --get-url "$url" | sed -e "s/^/file '/" | sed -e "s/$/'/"
}

main() {
local url=$1
local station=$2
ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto \
-f concat -safe 0 -i <(yt-dlp-to-ffconcat "$url") \
-f mp3 -ar 44100 -b:a 256k - | \
cstream -t 64k | \
curl -s -k -H "Transfer-Encoding: chunked" -X POST -T - \
"https://streammyaudio.com/$station.mp3?stream=true&advertise=true"
local url=$1
local station=$2
ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto \
-f concat -safe 0 -i <(yt-dlp-to-ffconcat "$url") \
-f mp3 -ar 44100 -b:a 256k - | \
cstream -t 64k | \
curl -s -k -H "Transfer-Encoding: chunked" -X POST -T - \
"https://streammyaudio.com/$station.mp3?stream=true&advertise=true"
}

main "$@"
Expand Down Expand Up @@ -127,4 +127,4 @@ <h3>Source</h3>
If you have any problems with the download please feel free to <a href="https://github.com/schollz/streammyaudio/issues/new/choose" target="_blank">create an issue on Github</a>.
</p>
{{ template "postbody" . }}
{{end}}
{{end}}

0 comments on commit 770fb20

Please sign in to comment.