Browse Source

Add some debug

master
Julien Cabillot 1 year ago
parent
commit
0554db044c
2 changed files with 8 additions and 4 deletions
  1. 7
      lib/Download.php
  2. 5
      lib/PremiumizeMe.php

7
lib/Download.php

@ -32,6 +32,12 @@ class Download {
// $myDownload->addEvent([ // $myDownload->addEvent([
// 'state' => 'downloading' // 'state' => 'downloading'
// ]); // ]);
//
if (!empty($myDownload->_id)) {
echo 'New job: '.$myDownload->dtype.':'.$myDownload->url;
} else {
echo 'No job in the queue';
}
return $myDownload; return $myDownload;
} }
@ -135,7 +141,6 @@ class Download {
*/ */
static function launchNextDownload() static function launchNextDownload()
{ {
echo json_encode('Traitement');
if ('cgi-fcgi' === php_sapi_name()) { if ('cgi-fcgi' === php_sapi_name()) {
//fastcgi_finish_request(); //fastcgi_finish_request();
} }

5
lib/PremiumizeMe.php

@ -145,10 +145,9 @@ class PremiumizeMe {
// Pour le moment nous ne gérons que des cas avec un seul fichier retourné // Pour le moment nous ne gérons que des cas avec un seul fichier retourné
$premInfos = PremiumizeMe::getLink($element->url); $premInfos = PremiumizeMe::getLink($element->url);
// TODO: only if debug
//echo 'Premimumizeme link: '.$premInfos['link'];
file_put_contents( 'test', $premInfos, FILE_APPEND);
file_put_contents('test', stat(file_exists(DOWNLOADINGDIR.DIRECTORY_SEPARATOR.$premInfos['path'])));
file_put_contents('test', stat(file_exists(DOWNLOADEDDIR.DIRECTORY_SEPARATOR.$premInfos['path'])));
if (file_exists(DOWNLOADINGDIR.DIRECTORY_SEPARATOR.$premInfos['path']) || file_exists(DOWNLOADEDDIR.DIRECTORY_SEPARATOR.$premInfos['path'])) { if (file_exists(DOWNLOADINGDIR.DIRECTORY_SEPARATOR.$premInfos['path']) || file_exists(DOWNLOADEDDIR.DIRECTORY_SEPARATOR.$premInfos['path'])) {
$element->addEvent(['state' => 'dupp' ]); $element->addEvent(['state' => 'dupp' ]);
$element->updateState('dupp'); $element->updateState('dupp');

Loading…
Cancel
Save