Preparing to multi-account search

This commit is contained in:
magnolia-fan
2011-04-02 18:57:17 +04:00
parent d411680b1b
commit 41efeface3
13 changed files with 160 additions and 460 deletions
+7 -3
View File
@@ -62,12 +62,16 @@ class VkontakteMP3 {
* @author chez
**/
public static function check($files, $artist_name, $track_name, $track_length) {
$urls = array();
foreach($files as $i => $file) {
$urls[$i] = $file['url'];
}
$headers = RemoteFile::getHeadersMT($urls);
foreach ($files as $i => $file) {
$headers = RemoteFile::getHeaders($file['url']);
if ($headers === false || $headers['http'] != 200) {
if (!isset($headers[$i]['http']) || $headers[$i]['http'] != 200) {
unset($files[$i]);
} else {
$files[$i]['size'] = trim($headers['content_length']);
$files[$i]['size'] = trim($headers[$i]['content_length']);
}
}
$m = new TrackWeight();