Skip to content

Commit

Permalink
✨ Added rar5 support
Browse files Browse the repository at this point in the history
Added another method to avoid output buffering
Updated download plugins for: filefactory_com, mega_co_nz and openload_co
Updated upload plugins: filefactory.com_member.php, rapidgator.net_member.php
Updated GenericXFS_DL and added 2 plugins using it.
  • Loading branch information
Th3-822 committed Dec 29, 2016
1 parent bdea1ca commit f650499
Show file tree
Hide file tree
Showing 19 changed files with 1,022 additions and 554 deletions.
1 change: 0 additions & 1 deletion audl.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

login_check();

header('X-Accel-Buffering: no');
require(TEMPLATE_DIR . '/header.php');
?>
<br />
Expand Down
6 changes: 4 additions & 2 deletions classes/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
else {
$all_act_files_exist = true;
foreach($_GET['files'] as $v) {
$file = $list[$v]['name'];
if (!is_file($file)) {
if (empty($list[$v])) {
$file = '';
$size_time = false;
} else if (!is_file(($file = $list[$v]['name']))) {
if ($options['2gb_fix'] && in_array($_GET['act'], array('delete', 'delete_go')) && file_exists($file) && !is_dir($file) && !is_link($file)) $size_time = file_data_size_time($file);
else $size_time = false;
} else $size_time = true;
Expand Down
31 changes: 16 additions & 15 deletions classes/options/rar.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function rar() {
<input type="checkbox" name="rar_opts[separated]" value="1" /><?php echo lang(387); ?>
</td>
<td class="rar-options-right-td">
&nbsp;
<input type="checkbox" name="rar_opts[rar5]" value="1" /><?php echo lang(394); ?>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -159,7 +159,7 @@ function rar_go() {
<tr>
<td>
<?php
if ($_GET['rar_opts']['separated']) {
if (!empty($_GET['rar_opts']['separated'])) {
foreach ($_GET['rar_opts']['filestorar'] as $k => $v) { if (empty($list[$v])) { unset($_GET['rar_opts']['filestorar'][$k]); } }
$am = count($_GET['rar_opts']['filestorar']);
}
Expand All @@ -170,12 +170,12 @@ function rar_go() {
}

for($i = 0; $i < $am; $i++) {
if ($_GET['rar_opts']['separated']) { $name = htmlentities(basename($list[$_GET['rar_opts']['filestorar'][$i]]['name']).'.rar'); }
if (!empty($_GET['rar_opts']['separated'])) $name = htmlentities(basename($list[$_GET['rar_opts']['filestorar'][$i]]['name']).'.rar');
?>
<table align="center">
<tr>
<td colspan="2" class="rar-main-td">
<?php printf(lang(363), ($_GET['rar_opts']['separated'] ? $name : $_GET['rar_opts']['rarfilename'])); ?>
<?php printf(lang(363), (!empty($_GET['rar_opts']['separated']) ? $name : $_GET['rar_opts']['rarfilename'])); ?>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -217,28 +217,29 @@ function rar_st(elementid, st){
flush();
require_once(CLASS_DIR."rar.php");

if ($options['disable_deleting']) { $_GET['rar_opts']['delete'] = 0; }
if ($options['disable_archive_compression']) { $_GET['rar_opts']['comp_lvl'] = 0; }
if ($options['disable_deleting']) $_GET['rar_opts']['delete'] = 0;
if ($options['disable_archive_compression']) $_GET['rar_opts']['comp_lvl'] = 0;

if (!empty($_GET['rar_opts']['separated'])) $am = count($_GET['rar_opts']['filestorar']);
else $am = 1;

if ($_GET['rar_opts']['separated']) { $am = count($_GET['rar_opts']['filestorar']); }
else { $am = 1; }
for($i = 0; $i < $am; $i++) {
$name = ($_GET['rar_opts']['separated']) ? basename($list[$_GET['rar_opts']['filestorar'][$i]]['name']).'.rar' : $_GET['rar_opts']['rarfilename'];
$name = (!empty($_GET['rar_opts']['separated'])) ? basename($list[$_GET['rar_opts']['filestorar'][$i]]['name']).'.rar' : $_GET['rar_opts']['rarfilename'];
$rar = new rlRar($name, $options['check_these_before_unzipping'] ? $options['forbidden_filetypes'] : array('.xxx'));
if ($rar->rar_return !== 'rar') {
if ($rar->get_rar_return() !== 'rar') {
?>
<script type="text/javascript">rar_st('rar_status<?php echo $i; ?>', '<?php echo lang(343); ?>');</script>
<?php
}
else {
$rar_opts_tmp = $_GET['rar_opts'];
if ($_GET['rar_opts']['separated']) { $rar_opts_tmp['filestorar'] = array($_GET['rar_opts']['filestorar'][$i]); }
if (!empty($_GET['rar_opts']['separated'])) { $rar_opts_tmp['filestorar'] = array($_GET['rar_opts']['filestorar'][$i]); }
$rar_result = $rar->addtoarchive($rar_opts_tmp, $options['download_dir'], 'rar_status'.$i, $i);
echo $rar_result;
if (strpos($rar_result, ", 'Done')") !== false) {
_create_list();
clearstatcache();
if ($_GET['rar_opts']['delete'] == true) {
if (!empty($_GET['rar_opts']['delete'])) {
foreach ($_GET['rar_opts']['filestorar'] as $rar_tounlist) {
$rar_tounlist = basename($list[$rar_tounlist]['name']);
if (empty($rar_tounlist)) { continue; }
Expand All @@ -249,9 +250,9 @@ function rar_st(elementid, st){
}
}
}
$rar_tolist = realpath($options['download_dir']).'/'.basename($rar->filename);
if ($_GET['rar_opts']['vols'] && !is_file($rar_tolist)) {
if (substr(strtolower($rar_tolist), -4) == '.rar') { $rar_tolist = substr($rar_tolist, 0, -4); }
$rar_tolist = realpath($options['download_dir']).'/'.basename($rar->get_filename());
if (!empty($_GET['rar_opts']['vols']) && !is_file($rar_tolist)) {
if (substr(strtolower($rar_tolist), -4) == '.rar') $rar_tolist = substr($rar_tolist, 0, -4);
$tmp = basename(strtolower($rar_tolist)).'.part';
$rar_dir = opendir(realpath($options['download_dir']).'/');
while (false !== ($rar_f_dd = readdir($rar_dir))) {
Expand Down
4 changes: 2 additions & 2 deletions classes/options/unrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function unrar_setCheckboxes(act, filestounrar) {
<?php
unset ($rar);
$rar = new rlRar($file["name"], $options['check_these_before_unzipping'] ? $options['forbidden_filetypes'] : array('.xxx'));
if ($rar->rar_return === false) { echo lang(367); }
if ($rar->get_rar_return() === false) { echo lang(367); }
else {
$rar_list = $rar->listthem(@$_GET['passwords'][$i], $options['download_dir'], $i);
if ($rar_list[0] == 'PASS') { $rar_passl_needed = true; echo lang(368); }
Expand Down Expand Up @@ -168,7 +168,7 @@ function rar_st(elementid, st){
foreach ($_GET['filestounrar'][$i] as $rar_item) {
flush();
$rar = new rlRar($file["name"], $options['check_these_before_unzipping'] ? $options['forbidden_filetypes'] : array('.xxx'));
if ($rar->rar_return === false) {
if ($rar->get_rar_return() === false) {
?>
<script type="text/javascript">rar_st('<?php echo 'unrar'.$_GET["files"][$i].'-'.str_replace('=', '-', $rar_item); ?>', '<?php echo lang(343); ?>');</script>
<?php
Expand Down
Loading

0 comments on commit f650499

Please sign in to comment.