Created
July 8, 2024 08:56
-
-
Save MilanPala/c4efea4335ccb072bfa9514556dd19a4 to your computer and use it in GitHub Desktop.
Stažení všech souborů pro Albi tužku
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 | |
$page = file_get_contents('https://www.kouzelnecteni.cz/stahnout-audio-soubor/'); | |
preg_match_all('/href="([^.]+\.bnl)"/', $page, $matches); | |
$i = 0; | |
$dir = '/mnt/c/Users/milan/Downloads/tuzka/'; | |
foreach ($matches[1] as $match) { | |
echo ' - Stahuji: ' . (++$i) . '/' . count($matches[1]) . PHP_EOL; | |
$filePath = 'https://www.kouzelnecteni.cz' . $match; | |
$file = file_get_contents($filePath); | |
$fileName = basename($filePath); | |
file_put_contents($dir . $fileName, $file); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment