Created
October 14, 2018 19:13
-
-
Save zoilomora/6421cf1b85f7e78b89c00b76b2ec6761 to your computer and use it in GitHub Desktop.
Descargar canciones de la "Lista LOS40" - Los 40 Principales
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 | |
$data = json_decode(file_get_contents('./data.json')); | |
$result = ''; | |
foreach ($data->songs as $song) { | |
$ffmpegCommand = sprintf( | |
'ffmpeg -ss %s -t %s -i {} \"%s.mp3\" && rm {}', | |
$song->start, | |
$song->duration, | |
$song->name | |
); | |
$result .= sprintf( | |
"youtube-dl -x --audio-format mp3 --prefer-ffmpeg --exec \"%s\" %s \n", | |
$ffmpegCommand, | |
$song->url | |
); | |
} | |
file_put_contents('./commands.sh', $result); |
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
{ | |
"dateUpdate": "2018-10-14T20:33:34+02:00", | |
"songs": [ | |
{ | |
"name": "Ni La Hora - Ana Guerra, Juan Magán", | |
"url": "https://www.youtube.com/watch?v=OsAcF2APchM", | |
"start": "00:00:00", | |
"duration": "194" | |
}, | |
{ | |
"name": "Déjala Que Baile - Melendi, Alejandro Sanz, Arkano", | |
"url": "https://www.youtube.com/watch?v=yda62tNSLsQ", | |
"start": "00:00:17", | |
"duration": "215" | |
}, | |
{ | |
"name": "Fuego - Eleni Foureira", | |
"url": "https://www.youtube.com/watch?v=eDSgs6syrgg", | |
"start": "00:00:12", | |
"duration": "181" | |
}, | |
{ | |
"name": "Teléfono - Aitana", | |
"url": "https://www.youtube.com/watch?v=bHTfTPIMnaw", | |
"start": "00:00:03", | |
"duration": "159" | |
}, | |
{ | |
"name": "One Kiss - Calvin Harris, Dua Lipa", | |
"url": "https://www.youtube.com/watch?v=DkeiKbqa02g", | |
"start": "00:00:08", | |
"duration": "211" | |
}, | |
{ | |
"name": "Girls Like You - Maroon 5, Cardi B", | |
"url": "https://www.youtube.com/watch?v=aJOTlE1K90k", | |
"start": "00:00:00", | |
"duration": "255" | |
}, | |
{ | |
"name": "La llave - Pablo Alborán, Piso 21", | |
"url": "https://www.youtube.com/watch?v=m3p4TX0sWqw", | |
"start": "00:00:02", | |
"duration": "183" | |
}, | |
{ | |
"name": "Leave a Light On - Tom Walker", | |
"url": "https://www.youtube.com/watch?v=nqnkBdExjws", | |
"start": "00:00:13", | |
"duration": "183" | |
}, | |
{ | |
"name": "Cuando Nadie Ve - Morat", | |
"url": "https://www.youtube.com/watch?v=szeA9tvItJY", | |
"start": "00:00:01", | |
"duration": "219" | |
}, | |
{ | |
"name": "La Cintura - Alvaro Soler", | |
"url": "https://www.youtube.com/watch?v=VrspRNubfyM", | |
"start": "00:00:00", | |
"duration": "203" | |
}, | |
{ | |
"name": "Qué Tienes Tú - Dvicio, Mau y Ricky, Reik", | |
"url": "https://www.youtube.com/watch?v=-tTZcnbwf4o", | |
"start": "00:00:00", | |
"duration": "208" | |
}, | |
{ | |
"name": "Solo - Clean Bandit, Demi Lovato", | |
"url": "https://www.youtube.com/watch?v=8JnfIa84TnU", | |
"start": "00:00:00", | |
"duration": "221" | |
}, | |
{ | |
"name": "Gira - David Otero", | |
"url": "https://www.youtube.com/watch?v=h6pgsgGOWJE", | |
"start": "00:00:00", | |
"duration": "220" | |
}, | |
{ | |
"name": "Te esperaré toda la vida - Dani Fernández", | |
"url": "https://www.youtube.com/watch?v=nUCuBrdEbUw", | |
"start": "00:00:04", | |
"duration": "224" | |
}, | |
{ | |
"name": "Flames - David Guetta, Sia", | |
"url": "https://www.youtube.com/watch?v=J75enyWdbBM", | |
"start": "00:00:00", | |
"duration": "193" | |
}, | |
{ | |
"name": "Contradicción - Malú", | |
"url": "https://www.youtube.com/watch?v=nX_r8SktAEI", | |
"start": "00:00:16", | |
"duration": "192" | |
}, | |
{ | |
"name": "No Es Justo - J. Balvin, Zion & Lennox", | |
"url": "https://www.youtube.com/watch?v=2zn4dAuZ2RU", | |
"start": "00:00:11", | |
"duration": "252" | |
}, | |
{ | |
"name": "Él no soy yo - Blas Cantó", | |
"url": "https://www.youtube.com/watch?v=yIg0uKHK8JU", | |
"start": "00:00:00", | |
"duration": "260" | |
}, | |
{ | |
"name": "2002 - Anne-Marie", | |
"url": "https://www.youtube.com/watch?v=Il-an3K9pjg", | |
"start": "00:00:00", | |
"duration": "185" | |
}, | |
{ | |
"name": "Rise - Jonas Blue, Jack & Jack", | |
"url": "https://www.youtube.com/watch?v=btrzs54s1Rc", | |
"start": "00:00:02", | |
"duration": "210" | |
}, | |
{ | |
"name": "Usted - Juan Magan, Mala Rodríguez", | |
"url": "https://www.youtube.com/watch?v=C01zDmEsSrk", | |
"start": "00:00:09", | |
"duration": "233" | |
}, | |
{ | |
"name": "Shotgun - George Ezra", | |
"url": "https://www.youtube.com/watch?v=aAiVsqfbn5g", | |
"start": "00:00:11", | |
"duration": "181" | |
}, | |
{ | |
"name": "Promises - Calvin Harris, Sam Smith", | |
"url": "https://www.youtube.com/watch?v=dTQMd2I3drE", | |
"start": "00:00:01", | |
"duration": "212" | |
}, | |
{ | |
"name": "In My Mind - Dynoro, Gigi D'Agostino", | |
"url": "https://www.youtube.com/watch?v=W9P_qUnMaFg", | |
"start": "00:00:01", | |
"duration": "175" | |
}, | |
{ | |
"name": "1, 2, 3 - Sofia Reyes, De La Ghetto, Jason Derulo", | |
"url": "https://www.youtube.com/watch?v=p03TIGqEc8o", | |
"start": "00:00:00", | |
"duration": "195" | |
}, | |
{ | |
"name": "Loca - Sweet California", | |
"url": "https://www.youtube.com/watch?v=6HeWoCcC-JM", | |
"start": "00:00:00", | |
"duration": "201" | |
}, | |
{ | |
"name": "Clandestino - Maluma, Shakira", | |
"url": "https://www.youtube.com/watch?v=1DhA69K3fZ4", | |
"start": "00:00:01", | |
"duration": "230" | |
}, | |
{ | |
"name": "Amasijo de Huesos - Sidecars", | |
"url": "https://www.youtube.com/watch?v=NCmWYFz4Whk", | |
"start": "00:00:17", | |
"duration": "268" | |
}, | |
{ | |
"name": "Ya no quiero ná - Lola Indigo", | |
"url": "https://www.youtube.com/watch?v=-dvftyeRYzM", | |
"start": "00:00:00", | |
"duration": "191" | |
}, | |
{ | |
"name": "Lo Siento - Beret", | |
"url": "https://www.youtube.com/watch?v=aYsFb7S8LFc", | |
"start": "00:00:00", | |
"duration": "224" | |
}, | |
{ | |
"name": "Happier - Marshmello, Bastille", | |
"url": "https://www.youtube.com/watch?v=RE87rQkXdNw", | |
"start": "00:00:04", | |
"duration": "213" | |
}, | |
{ | |
"name": "A Partir De Hoy - David Bisbal, Sebastian Yatra", | |
"url": "https://www.youtube.com/watch?v=Iwz4P8HfGVM", | |
"start": "00:00:16", | |
"duration": "194" | |
}, | |
{ | |
"name": "Happier - Ed Sheeran", | |
"url": "https://www.youtube.com/watch?v=zWQN7u6g62c", | |
"start": "00:00:00", | |
"duration": "202" | |
}, | |
{ | |
"name": "Back To You - Selena Gomez", | |
"url": "https://www.youtube.com/watch?v=VY1eFxgRR-k", | |
"start": "00:00:41", | |
"duration": "222" | |
}, | |
{ | |
"name": "I'm A Mess - Bebe Rexha", | |
"url": "https://www.youtube.com/watch?v=LdH7aFjDzjI", | |
"start": "00:00:00", | |
"duration": "195" | |
}, | |
{ | |
"name": "Belerofón - Taburete", | |
"url": "https://www.youtube.com/watch?v=XM5DdGkRP40", | |
"start": "00:00:01", | |
"duration": "213" | |
}, | |
{ | |
"name": "Mad Love - Sean Paul, Becky G, David Guetta", | |
"url": "https://www.youtube.com/watch?v=mlf4bidp2yc", | |
"start": "00:00:00", | |
"duration": "199" | |
}, | |
{ | |
"name": "Lo Malo - Aitana, Ana Guerra", | |
"url": "https://www.youtube.com/watch?v=qYXCsZunjRM", | |
"start": "00:00:08", | |
"duration": "179" | |
}, | |
{ | |
"name": "Friends - Anne-Marie, Marshmello", | |
"url": "https://www.youtube.com/watch?v=CY8E6N5Nzec", | |
"start": "00:00:00", | |
"duration": "202" | |
}, | |
{ | |
"name": "These Days - Rudimental, Dan Caplen, Jess Glynne, Macklemore", | |
"url": "https://www.youtube.com/watch?v=UlXPdOuNU3Q", | |
"start": "00:00:00", | |
"duration": "210" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment