Skip to content

Commit 413a553

Browse files
committed
php and unicode, name a better combination
1 parent 217f631 commit 413a553

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

index.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22
session_start();
3+
setlocale(LC_ALL,'C.UTF-8');
34
class YTDLP
45
{
56
public static $config_file=".dlconfig";
@@ -122,14 +123,14 @@ static function NukeJob($jobid)
122123
{
123124
@unlink(self::$dl_dir_common."/".$jobid."/".$item->getFilename());
124125
}
125-
@unlink(self::$dl_dir_common."/".$jobid);
126+
@rmdir(self::$dl_dir_common."/".$jobid);
126127

127128
$remover=new FilesystemIterator(self::$dl_dir_mp3."/".$jobid);
128129
foreach($remover as $item)
129130
{
130131
@unlink(self::$dl_dir_mp3."/".$jobid."/".$item->getFilename());
131132
}
132-
@unlink(self::$dl_dir_mp3."/".$jobid);
133+
@rmdir(self::$dl_dir_mp3."/".$jobid);
133134
}
134135

135136
static function SetupDir($dirname)
@@ -222,7 +223,7 @@ static function buildCMD($dl_mode,$jobid,$vlist)
222223
$cmd.=" --cache-dir ";
223224
$cmd.=escapeshellarg(self::$cache_dir);
224225
$cmd.=" -P ".self::$args['tmp'];
225-
$cmd.=" -P ".self::$args['out-path'];
226+
$cmd.=" -o ".self::$args['out-path']."/".escapeshellarg(self::$output_format);
226227
$cmd.=$dl_mode;
227228
$cmd.=self::$removal_options;
228229
$cmd.=" -- ";

0 commit comments

Comments
 (0)