#!/bin/bash

T="$1"
if [ -z "$T" ]; then
  T="1"
fi
mkdir DataSet_9
cd DataSet_9
N=$T

# grep .m4a ../urls.txt | while read LINE; do
# grep .mp4 ../urls.txt | tail -n "+$T" | while read LINE; do
tail -n "+$T" ../urls.txt | while read LINE; do
  echo "$N : $LINE" |tee -a ../get_all.log
  wget --no-verbose -c --header='Cookie: justiceGovAgeVerified=true' "$LINE" 2>&1 |tee -a ../get_all.log
  N=$[$N + 1]
done
