#!/bin/bash declare -A strings if [[ "${params[id]}" ]]; then data=$(haruhi-dl --ie-key YoutubeChannel -J --flat-playlist "https://www.youtube.com/channel/${params[id]}") elif [[ "${params[user]}" ]]; then data=$(haruhi-dl --ie-key YoutubeChannel -J --flat-playlist "https://www.youtube.com/user/${params[user]}") elif [[ "${params[c]}" ]]; then data=$(haruhi-dl --ie-key YoutubeChannel -J --flat-playlist "https://www.youtube.com/c/${params[c]}") elif [[ "${get_data[id]}" ]]; then data=$(haruhi-dl --ie-key YoutubeChannel -J --flat-playlist "https://www.youtube.com/channel/${get_data[id]}") elif [[ "${get_data[name]}" ]]; then data=$(haruhi-dl --ie-key YoutubeChannel -J --flat-playlist "https://www.youtube.com/user/${get_data[name]}") else echo "Please specify either id or name" return fi title=$(jq -r '.title' <<< $data) if [[ ${cfg[template]} == 'default' ]]; then meta[title]="$title" source templates/head.sh fi IFS=$'\n' video_title=($(jq -r '.entries[].title' <<< $data)) video_id=($(jq -r '.entries[].id' <<< $data)) strings[subscribe]="