From 4f5f383968031ba7140c6bf3da4b35d444379566 Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Sun, 25 Jun 2017 23:34:12 +0200
Subject: [PATCH] Added documentation about music acquisition

---
 demo/download-tracks.sh | 22 ++++++++++++++++++++++
 demo/music.txt          |  8 ++++++++
 2 files changed, 30 insertions(+)
 create mode 100755 demo/download-tracks.sh
 create mode 100644 demo/music.txt

diff --git a/demo/download-tracks.sh b/demo/download-tracks.sh
new file mode 100755
index 000000000..6eb58ee0c
--- /dev/null
+++ b/demo/download-tracks.sh
@@ -0,0 +1,22 @@
+#! /bin/bash
+set -e
+[ -z $1 ] && echo "Path to list file missing" && exit 1
+
+echo "This will download tracks from zip archives listed in $1"
+
+LIST_CONTENT=$(cat $1)
+echo "$LIST_CONTENT"
+mkdir -p data/music
+cd data/music
+
+echo "Downloading files..."
+echo "$LIST_CONTENT" | grep "^[^#;]" | xargs -n 1 curl -LO
+
+echo "Unzipping archives..."
+find . -name "*.zip" | while read filename; do
+    dirname="${filename%.*}"
+    mkdir $dirname
+    unzip -o -d "$dirname" "$filename";
+done;
+
+echo "Done!"
diff --git a/demo/music.txt b/demo/music.txt
new file mode 100644
index 000000000..26a83c4e8
--- /dev/null
+++ b/demo/music.txt
@@ -0,0 +1,8 @@
+# You can get a pretty list of open music here: https://archive.org/details/jamendo-albums
+https://archive.org/compress/jamendo-069098/formats=OGG%20VORBIS&file=/jamendo-069098.zip
+https://archive.org/compress/jamendo-001144/formats=OGG%20VORBIS&file=/jamendo-001144.zip
+https://archive.org/compress/jamendo-027690/formats=OGG%20VORBIS&file=/jamendo-027690.zip
+https://archive.org/compress/jamendo-001469/formats=OGG%20VORBIS&file=/jamendo-001469.zip
+https://archive.org/compress/jamendo-106323/formats=OGG%20VORBIS&file=/jamendo-106323.zip
+https://archive.org/compress/jamendo-071149/formats=OGG%20VORBIS&file=/jamendo-071149.zip
+https://archive.org/compress/jamendo-085030/formats=OGG%20VORBIS&file=/jamendo-085030.zip
-- 
GitLab