Rate this script:  I Love it  /   I Hate it

Download mp3's from a password protected site using a m3u file


Code


<?php
// simple script to download mp3's from a password protected site using a playlist file
//remote username
$username = 'username';
// remote password
$password = 'password';

// m3u file
$get = file("file.m3u"); // m3u (playlist) file contains paths to  remote files

foreach($get as $url){
        $trim_url = rtrim($url); // trim newline
        $explode_url = explode("//", $trim_url); //explode url so you can insert username:password for wget
        $fixed_url = 'http://' . $username . ':' . $password . '@' . $explode_url[1];

        exec("wget $fixed_url"); // downloads to current directory
}



?>
 

 

 
Download mp3's from a password protected site using a m3u file scripts | Download mp3's from a password protected site using a m3u file snippet | Download mp3's from a password protected site using a m3u file example | Download mp3's from a password protected site using a m3u file tutorial | Download mp3's from a password protected site using a m3u file code