Created
May 16, 2016 20:46
-
-
Save Rudis1261/180c43c609aa2a3ec5f6dfcf186725f5 to your computer and use it in GitHub Desktop.
Simple PHP Puller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 1); | |
error_reporting(-1); | |
$lines = explode(PHP_EOL, file_get_contents('source.txt')); | |
$dir = 'vids'; | |
if (!file_exists($dir)) { | |
mkdir($dir); | |
} | |
foreach($lines as $num => $line) { | |
$ext = pathinfo($line, PATHINFO_EXTENSION); | |
$name = pathinfo($line, PATHINFO_FILENAME); | |
$read = file_get_contents($line); | |
if (!$read) { | |
continue; | |
} | |
echo "Saving {$dir}/{$name}.{$ext}" . PHP_EOL; | |
file_put_contents($dir."/".$name.".".$ext, $read); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://i.imgur.com/cDRMrMy.jpg | |
http://i.imgur.com/f3gQupR.jpg | |
http://i.imgur.com/034nlWW.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment