Browse Source

download prends maintenant en args un array

master
Cabillot Julien 6 years ago
parent
commit
e6fbb817f3
3 changed files with 18 additions and 14 deletions
  1. 26
      controller/download.php
  2. 2
      download/.gitignore
  3. 4
      root/index.php

26
controller/download.php

@ -6,16 +6,18 @@ function getDownload()
echo 'pas de get';
exit();
}
$premInfos = PremiumizeMe::getLink($_GET['myurl']);
$db = DbMongo::get();
$coll = $db->download;
$coll->insert([
'timestamp' => time(),
'ip' => $_SERVER['REMOTE_ADDR'],
'url' => $_GET['myurl'],
'premURL' => $premInfos['location'],
'filename' => $premInfos['filename']
]);
$result = Download::get($premInfos['location'], $premInfos['filename']);
foreach($_GET['myurl'] as $url) {
$premInfos = PremiumizeMe::getLink($url);
$db = DbMongo::get();
$coll = $db->download;
$coll->insert([
'timestamp' => time(),
'ip' => $_SERVER['REMOTE_ADDR'],
'url' => $url,
'premURL' => $premInfos['location'],
'filename' => $premInfos['filename']
]);
$result = Download::get($premInfos['location'], $premInfos['filename']);
}
}

2
download/.gitignore

@ -0,0 +1,2 @@
*
!.gitignore

4
root/index.php

@ -17,8 +17,8 @@ switch($_GET['action']) {
getStream();
break;
case 'download':
// http://mydl.cabillot.eu/download/?myurl=https://1fichier.com/?yawxht1b3y
// http://mydl.cabillot.eu/download/?myurl[]=https://1fichier.com/?yawxht1b3y
include dirname(__FILE__).'/../controller/download.php';
getDownload();
break;
}
}
Loading…
Cancel
Save