init
This commit is contained in:
commit
b49131d8ea
4
README
Normal file
4
README
Normal file
|
@ -0,0 +1,4 @@
|
|||
unweb er min samling af forskellige scripts til at undgå at bruge webapps.
|
||||
|
||||
tv2east.dk/getlive.sh
|
||||
Udtræk HLS playlist til Livestream af TV2Øst.
|
36
tv2east.dk/getlive.sh
Executable file
36
tv2east.dk/getlive.sh
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/bin/bash
|
||||
# Copyright (c) 2021 smpl <smpl@slamkode.ml>
|
||||
# SPDX-Identifier: Zlib
|
||||
|
||||
URL="https://www.tv2east.dk/live"
|
||||
USER_AGENT="Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko"
|
||||
PLAYLIST=""
|
||||
|
||||
while read -r line; do
|
||||
if [[ "$line" == *"playlist_url:"* ]]; then
|
||||
PLAYLIST=$(echo -En $line | sed -n 's/.*playlist_url:"\([^"]*\)".*/\1/p' | sed -n 's/\\u002F/\//gp')
|
||||
while read fline; do
|
||||
:;
|
||||
done
|
||||
break;
|
||||
fi
|
||||
done < <(curl -A "$USER_AGENT" "$URL")
|
||||
|
||||
echo "Playlist: $PLAYLIST"
|
||||
|
||||
RESOLUTION=""
|
||||
URL=""
|
||||
|
||||
while read -r line; do
|
||||
if [[ $line == "#EXT-X-STREAM-INF"* ]]; then
|
||||
RESOLUTION=$(echo -En "$line" | sed -n 's/.*RESOLUTION=\([^,\n]*\)/\1/p')
|
||||
elif [[ $line != "#"* ]]; then
|
||||
URL=$line;
|
||||
fi
|
||||
|
||||
if [[ -n $RESOLUTION && -n $URL ]]; then
|
||||
echo -e "$RESOLUTION:\n $URL"
|
||||
RESOLUTION=""
|
||||
URL=""
|
||||
fi
|
||||
done < <(curl -A "$USER_AGENT" "$PLAYLIST")
|
Loading…
Reference in a new issue