0
0
mirror of https://github.com/anthonyaxenov/iptv.git synced 2024-11-01 09:36:14 +00:00
iptv/tools/download-all.sh

33 lines
844 B
Bash
Raw Normal View History

2022-05-29 10:19:09 +00:00
#!/bin/bash
#################################################
#
# IPTV Playlist download tool
#
# Usage:
# ./download-all.sh
#
# All playlists from playlists.ini will be
# downloaded in ./downloaded directory
#
# Anthony Axenov (c) 2022
# The MIT License:
# https://github.com/anthonyaxenov/iptv/blob/master/LICENSE
#
#################################################
2022-10-22 08:45:58 +00:00
TOOLS_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";
DL_DIR="$TOOLS_DIR/downloaded"
ROOT_DIR="`dirname "$TOOLS_DIR"`"
INI_FILE="$ROOT_DIR/playlists.ini"
rm -rf "$DL_DIR" && \
mkdir -p "$DL_DIR" && \
cd "$DL_DIR" && \
cat "`dirname "$TOOLS_DIR"`/playlists.ini" \
| grep -P "pls\s*=\s*'(.*)'" \
| sed "s#^pls\s*=\s*##g" \
| sed "s#'##g" \
| tr -d '\r' \
| xargs wget