View Single Post
Old 2019-01-12, 05:47 PM   #15
HowlingWulf
Me fail English? That's unpossible!
 
HowlingWulf's Avatar
 
Join Date: Dec 2003
Location: FL
Posts: 1,381
Send a message via ICQ to HowlingWulf
Quote:
Originally Posted by Greenguy View Post
1 - Worked PERFECTLY!

2 - Is it by any chance easy to go from this:
2BTB_061209_Cindy.mp4
2BTB_061211_Mia.mp4
2BTB_061219_Aaliyah.mp4

To this:
2BTB_061209_Cindy/source/2BTB_061209_Cindy.mp4
2BTB_061211_Mia/source/2BTB_061211_Mia.mp4
2BTB_061219_Aaliyah/source/2BTB_061219_Aaliyah.mp4
Sure. Try this:

PHP Code:
<?php
$path 
".";
$extensions = array( "mp4" );

$files array_diff(scandir($path), array('.''..'));

foreach ( 
$files as $file ) {
        if ( ! 
is_file $file ) ) continue;
        
$file_parts pathinfo$file );
        if ( ! 
in_array$file_parts['extension'], $extensions ) ) continue;

        if ( ! 
file_exists$file_parts['filename'] ) && ! mkdir$file_parts['filename'] ) ) { echo "Oops! Could 
not create directory 
{$file_parts['filename']}\n"; continue; }

        if ( ! 
file_exists$file_parts['filename'] . "/source" ) && ! mkdir$file_parts['filename'] . "/source" 
) ) { echo "Oops! Could not create directory {$file_parts['filename']}/source\n"; continue; }

        
$new_loc $file_parts['filename'] . "/source/" $file;
        if ( ! 
rename$file$new_loc ) ) { echo "Oops! Could not move {$file} to {$new_loc}\n"; continue; }

        echo 
$file " moved to {$new_loc} successfully.\n";
}

echo 
"Done\n";
__________________
WordPress Porn directory theme => Maddos
Create a Porn Tube => Video Pornster
HowlingWulf is offline   Reply With Quote