Romario Brahma - 2017-02-14 08:00:30
i wrote like this to download the videos. But it's not working for all browser and when i download the video it save by default name "videoplayback". Can anyone tech me how to write complete downloading script? I have no idea. Please help me anyone who can?
I modified in YoutubeDownloader.php to get video like this.
foreach($stream_map_arr as $stream)
{
parse_str($stream, $stream_data);
$stream_data["title"] = $this->video_title;
$stream_data["mime"] = $stream_data["type"];
$mime_type = explode(";", $stream_data["mime"]);
$stream_data["mime"] = $mime_type[0];
$start = stripos($mime_type[0], "/");
$format = ltrim(substr($mime_type[0], $start), "/");
$stream_data["format"] = $format;
unset($stream_data["type"]);
$final_stream_map_arr [] = $stream_data;
}
//return $final_stream_map_arr;
for($x=0;$x<5;$x++) {
echo "<a href='".$final_stream_map_arr[$x]["url"]."' target='_self' download>Download ".$final_stream_map_arr[$x]["quality"]." ".$final_stream_map_arr[$x]["mime"]."</a><br>";
}
}