Skip to content

Instantly share code, notes, and snippets.

@crazko
Created Dec 30, 2018
Embed
What would you like to do?
radio slovensko download
<?php
use Symfony\Component\DomCrawler\Crawler;
$loader = require __DIR__ . '/vendor/autoload.php';
$list = file('list.txt');
$index = fopen('index.html', 'w');
$commands = fopen('commands.sh', 'w');
fwrite($commands, "#!/bin/bash\n\n");
$i = 1;
foreach ($list as $file) {
list($name, $url) = explode(' | ', $file);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, trim($url));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$content = curl_exec($ch);
curl_close($ch);
$crawler = new Crawler($content);
$path = $crawler
->filter('.player-download-link > a')
->first()
->attr('href');
// $filename = str_replace(":", "%3A", $name) . ".mp3";
$filename = "$name.mp3";
$command = "curl -s -o \"$filename\" $path && echo 'done $i' &";
fwrite($commands, "$command\n");
$i++;
$title = $crawler->filter('.article-header + h2');
$desc = $title->nextAll()->first();
fwrite($index, "<h2><a href=\"" . trim($url) . "\">" . $title->html() . "</a></h2>\n");
fwrite($index, "<div>" . $desc->html() . "</div>\n");
}
fwrite($commands, "\nwait");
fclose($commands);
Gaudeamus igitur alebo Pár slov o Kantovi, 25.2.2014 13:00 | http://www.rtvs.sk/radio/archiv/1365/724417
J. N. Nestroy: Lumpacivagabundus, 9.4.2014 21:02 | http://www.rtvs.sk/radio/archiv/1365/781567
Monsterproces, 29.6.2014 20:00 | http://www.rtvs.sk/radio/archiv/1365/688
Tesár, 27.8.2014 22:01 | http://www.rtvs.sk/radio/archiv/1365/753057
Krutohlavova cesta na Mesiac, 27.9.2014 13:00 | http://www.rtvs.sk/radio/archiv/1365/54446
Dospelým neprístupné, 13.12.2014 13:00 | http://www.rtvs.sk/radio/archiv/1365/94236
Čajka, 28.4.2015 19:30 | http://www.rtvs.sk/radio/archiv/1365/200952
Peter a Lucia, 26.5.2015 19:30 | http://www.rtvs.sk/radio/archiv/1365/218489
Tetula, 25.8.2015 19:00 | http://www.rtvs.sk/radio/archiv/1365/275141
Spoločenstvo, 22.9.2015 19:32 | http://www.rtvs.sk/radio/archiv/1365/314496
Snežný vrchol, 6.10.2015 19:30 | http://www.rtvs.sk/radio/archiv/1365/302299
Peter Janků: Labutia pieseň veľkého Slovana, 27.10.2015 19:35 | http://www.rtvs.sk/radio/archiv/1365/333505
Adela, 31.10.2015 13:00 | http://www.rtvs.sk/radio/archiv/1365/320674
Blázon a kráľ, 3.11.2015 19:33 | http://www.rtvs.sk/radio/archiv/1365/336562
Terra Granus – Zem pri Hrone, 10.11.2015 19:30 | http://www.rtvs.sk/radio/archiv/1365/326351
Fórum mladých autorov II, 24.11.2015 21:07 | http://www.rtvs.sk/radio/archiv/1365/350606
Café Hyena, 8.12.2015 21:55 | http://www.rtvs.sk/radio/archiv/1365/360056
Klára a 12 mesiačikov, 26.12.2015 13:00 | http://www.rtvs.sk/radio/archiv/1365/354309
Dvaja, 29.12.2015 20:30 | http://www.rtvs.sk/radio/archiv/1365/364637
Na svadbu..., 16.2.2016 19:01 | http://www.rtvs.sk/radio/archiv/1365/387075
Albínky, 6.3.2016 21:00 | http://www.rtvs.sk/radio/archiv/1365/398667
Starostlivá balada, 2.4.2016 22:01 | http://www.rtvs.sk/radio/archiv/1365/818684
Gösta Berling, 30.4.2016 13:00 | http://www.rtvs.sk/radio/archiv/1365/433177
Futbal, 30.4.2016 18:30 | http://www.rtvs.sk/radio/archiv/1365/433184
Stanislaw Witkiewicz: Šialená lokomotíva, 10.5.2016 19:01 | http://www.rtvs.sk/radio/archiv/1365/440959
Otcológy alebo Prvý, 28.5.2016 18:29 | http://www.rtvs.sk/radio/archiv/1365/452103
Cesta okolo sveta za 80 dní, 17.9.2016 18:31 | http://www.rtvs.sk/radio/archiv/1365/521840
Spolu, 30.9.2016 20:00 | http://www.rtvs.sk/radio/archiv/1365/547627
Ústa pani D´arcyovej, 1.10.2016 18:31 | http://www.rtvs.sk/radio/archiv/1365/530784
Fórum mladých autorov III., 4.10.2016 20:49 | http://www.rtvs.sk/radio/archiv/1365/548317
Tiahnuť na juh - Putovanie dona Quijota, 15.10.2016 18:31 | http://www.rtvs.sk/radio/archiv/1365/539596
Stalo sa prvého septembra (alebo inokedy), 18.10.2016 19:00 | http://www.rtvs.sk/radio/archiv/1365/541453
Ema B. a jej virtuálny život, 29.10.2016 18:31 | http://www.rtvs.sk/radio/archiv/1365/548362
Budem sa dívať všetkým do očí, 5.11.2016 13:00 | http://www.rtvs.sk/radio/archiv/1365/552462
Biely nosorožec, 5.11.2016 18:30 | http://www.rtvs.sk/radio/archiv/1365/552469
Don Quijote - 1.časť (Kniha bláznovstva), 8.11.2016 19:00 | http://www.rtvs.sk/radio/archiv/1365/554164
Odpúšťanie, 12.11.2016 18:31 | http://www.rtvs.sk/radio/archiv/1365/556419
Don Quijote - 2.diel (Kniha múdrosti), 15.11.2016 19:00 | http://www.rtvs.sk/radio/archiv/1365/558176
Abeceda citového šachu, 19.11.2016 18:30 | http://www.rtvs.sk/radio/archiv/1365/560475
Krajina nepokosených lúk, 22.11.2016 19:00 | http://www.rtvs.sk/radio/archiv/1365/562231
Môj brat., 26.11.2016 18:30 | http://www.rtvs.sk/radio/archiv/1365/564572
V záhrade papierových drakov, 3.12.2016 13:00 | http://www.rtvs.sk/radio/archiv/1365/570141
Zbierka 1920, 3.12.2016 18:15 | http://www.rtvs.sk/radio/archiv/1365/586802
Sen noci svätojánskej, 31.12.2016 21:01 | http://www.rtvs.sk/radio/archiv/1365/587550
Ruská posteľ, 10.1.2017 20:00 | http://www.rtvs.sk/radio/archiv/1365/592940
Revízor, 28.2.2017 20:00 | http://www.rtvs.sk/radio/archiv/1365/622776
Na vlastných krídlach, 25.3.2017 13:04 | http://www.rtvs.sk/radio/archiv/1365/639512
Epicentrum žitia, 30.5.2017 21:02 | http://www.rtvs.sk/radio/archiv/1365/682904
Naša zabudnutá klasika - Kar, 11.7.2017 20:31 | http://www.rtvs.sk/radio/archiv/1365/738741
Naša zabudnutá klasika - Slovensko a kultúra, 18.7.2017 20:35 | http://www.rtvs.sk/radio/archiv/1365/738743
Naša zabudnutá klasika - Mrzutá, 25.7.2017 20:35 | http://www.rtvs.sk/radio/archiv/1365/738742
Naša zabudnutá klasika - Obrázky zo Slovenska, 1.8.2017 20:00 | http://www.rtvs.sk/radio/archiv/1365/722697
Naša zabudnutá klasika - Prvá obeť, 8.8.2017 20:01 | http://www.rtvs.sk/radio/archiv/1365/727198
Naša zabudnutá klasika - Záplava, 15.8.2017 20:01 | http://www.rtvs.sk/radio/archiv/1365/731535
Dve doby, 30.9.2017 13:05 | http://www.rtvs.sk/radio/archiv/1365/760072
Hranice svätosti, 30.9.2017 15:05 | http://www.rtvs.sk/radio/archiv/1365/822927
Americký výlet baróna Prášila, 17.10.2017 20:01 | http://www.rtvs.sk/radio/archiv/1365/770653
Advent (+18), 17.10.2017 21:21 | http://www.rtvs.sk/radio/archiv/1365/770655
Obvinenie, 7.11.2017 20:02 | http://www.rtvs.sk/radio/archiv/1365/784080
Vae Victis, 21.11.2017 20:31 | http://www.rtvs.sk/radio/archiv/1365/792505
Tristan a Izolda - oratórium vášne, 21.11.2017 21:31 | http://www.rtvs.sk/radio/archiv/1365/792506
Krajina V (Krv), 25.11.2017 13:05 | http://www.rtvs.sk/radio/archiv/1365/794840
Squat, 19.12.2017 21:01 | http://www.rtvs.sk/radio/archiv/1365/810444
Podivný pútnik, 1.1.2018 14:01 | http://www.rtvs.sk/radio/archiv/1365/849401
Dedičstvo, 30.1.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/850705
Jama, 16.2.2018 21:54 | http://www.rtvs.sk/radio/archiv/1365/889617
Slovo Válkovo, 27.3.2018 20:31 | http://www.rtvs.sk/radio/archiv/1365/897726
Lulu, 10.4.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/904715
Preventívna prehliadka, 29.5.2018 20:36 | http://www.rtvs.sk/radio/archiv/1365/932888
Ibrahimovo okno, 3.7.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/951893
Moje deti, 10.7.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/955477
Jazdecká legenda, 17.7.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/958925
Divý Adam, 24.7.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/962453
Smutné časy, 31.7.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/967427
Smutný dom, 7.8.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/971219
V borbe s temnotou, 14.8.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/975035
Tuberáci, 21.8.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/978822
Obeť svätej čistoty, 1.9.2018 15:01 | http://www.rtvs.sk/radio/archiv/1365/985033
Tantalópolis, 25.9.2018 20:32 | http://www.rtvs.sk/radio/archiv/1365/1012430
Tajomstvo príborníka, 26.9.2018 21:31 | http://www.rtvs.sk/radio/archiv/1365/997547
Noční špióni, 3.10.2018 21:31 | http://www.rtvs.sk/radio/archiv/1365/1002531
Rozhlasová hra, 9.10.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/1006001
Veľkoslovensko. Pravda o vzniku monarchie, 23.10.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/1013644
Vietor v píniách, 27.10.2018 13:01 | http://www.rtvs.sk/radio/archiv/1365/1015879
A ten tata Masaryk, 30.10.2018 20:01 | http://www.rtvs.sk/radio/archiv/1365/1017489
Podivuhodný príbeh Petra Schlemihla, 10.11.2018 13:01 | http://www.rtvs.sk/radio/archiv/1365/1023136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment