Here is a bash script for downloading mp3 songs (not limited to, but any media file) from internet.
Save the urls in a .txt file, and copy paste the following script and make sure the script has run permission,
#!/bin/bash
FILENAME=$1
dir=$2
PWD=`pwd`;
if [ -d "$dir" ]; then
echo `wget -b --directory-\prefix\=/Volumes/Mac_One/Music/$dir -o download_$dir.log -i "$PWD/$FILENAME"`;
else
mkdir -p "/Volumes/Mac_One/Music/$dir";
echo `wget -b --directory-\prefix\=/Volumes/Mac_One/Music/$dir -o download_$dir.log -i "$PWD/$FILENAME"`;
fi
Save the urls in a .txt file, and copy paste the following script and make sure the script has run permission,
#!/bin/bash
FILENAME=$1
dir=$2
PWD=`pwd`;
if [ -d "$dir" ]; then
echo `wget -b --directory-\prefix\=/Volumes/Mac_One/Music/$dir -o download_$dir.log -i "$PWD/$FILENAME"`;
else
mkdir -p "/Volumes/Mac_One/Music/$dir";
echo `wget -b --directory-\prefix\=/Volumes/Mac_One/Music/$dir -o download_$dir.log -i "$PWD/$FILENAME"`;
fi
> download.sh
Comments
Post a Comment