title: How to download private Soundcloud track with access token in bash script
body: <p>I have generated a list of Soundcloud track id's with the following python code:</p>
  
  <pre><code>import soundcloud
  import urllib
  
  client = soundcloud.Client(client_id='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
                         client_secret='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
                         username='XXXXXXXXXXXXXXXXXXXXXXXXXX',
                         password='XXXXXXXXXXXXXXXXXX')
  
  f=open('soundcloud-track-ids', 'w+')
  
  count = 0
  while count &lt; 6000:
      tracks = client.get('/me/tracks', limit=200, offset=count)
      for track in tracks:
          print &gt;&gt;f, track.id, "\t", track.title .encode('utf-8')
      count += 200
  
  f.close()
  </code></pre>
  
  <p>I have then run a bash script to backup the entire archive to contents to a hard drive:</p>
  
  <pre><code>#!/bin/bash
  
  SAVEIFS=$IFS
  IFS=$(echo -en "\n\b")
  
  while read line; do
      if [ ! -f /mnt/drobo_1/Soundcloud/$(echo $line | cut -f 2- | sed 's,/,\ ,g').mp3 ];     then
          wget https://api.soundcloud.com/tracks/"$(echo $line | awk '{print $1}')"/download?oauth_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX \
          -O /mnt/drobo_1/Soundcloud/"$(echo $line | cut -f 2- | sed 's,/,\ ,g').mp3"
      fi
  done &lt; ./soundcloud-track-ids
  
  IFS=$SAVEIFS
  </code></pre>
  
  <p>Nearly all of the 5317 tracks are private, and most have downloaded without a problem, however about 600 tracks have failed to download with the following error:</p>
  
  <pre><code>--2015-01-05 12:46:09--  https://api.soundcloud.com/tracks/152288957/download?oauth_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  Resolving api.soundcloud.com (api.soundcloud.com)... 93.184.220.127
  Connecting to api.soundcloud.com (api.soundcloud.com)|93.184.220.127|:443... connected.
  HTTP request sent, awaiting response... 404 Not Found
  2015-01-05 12:46:10 ERROR 404: Not Found.
  </code></pre>
  
  <p>Does anyone know what the error could be?</p>