<?php require_once dirname(__FILE__) . '/src/Csv.php'; require_once dirname(__FILE__) . '/src/PixivArtWorkDownload.php'; $log_file = 'mklink'; list($image_dir, $link_dir, $cookie_file, $userlist_file) = SetParam(); CreateLink(ReadCsv($userlist_file)); function CreateLink($userlist) { global $image_dir, $link_dir; MakeDirectory("{$link_dir}_windows"); $handle = fopen('mklink.bat', 'w'); foreach ($userlist as $user) { @($user_id = $user['user_id']); @($display_name = $user['display_name']); fwrite($handle, "mklink /d {$link_dir}_windows\\{$display_name} {$image_dir}\\{$user_id}" . "\r\n"); } fclose($handle); Msg('succeed', "Create bat file 'mklink.bat'.\n"); }
#!/usr/bin/php <?php require_once dirname(__FILE__) . '/src/CookieLogin.php'; require_once dirname(__FILE__) . '/src/Csv.php'; require_once dirname(__FILE__) . '/src/PixivArtWorkDownload.php'; list($image_dir, $link_dir, $cookie_file, $userlist_file) = SetParam(); // ログフォルの作成 date_default_timezone_set('Asia/Tokyo'); $dir = 'log/dl/' . date('ymdHis'); $log_file = $dir . '/dl.log'; if (!MakeDirectory($dir)) { Msg("error", "Couldn't make the directory " . $dir . "'\n"); exit(1); } # クッキーの処理 CookieLogin(); # csvファイルの読み込み $userlist = ReadCsv($userlist_file); # 童貞が喜ぶぐへへな画像をdl # 世界の中心はここね❤ PixivArtWorkDownload($userlist, $userlist_file); exit(0); ?>