Browse Source

somefix

master
flyingrub 8 years ago
parent
commit
527292b38e
  1. 1
      .gitignore
  2. 2
      README.md
  3. 20
      scdl/scdl.py

1
.gitignore vendored

@ -3,3 +3,4 @@ dist/
*.pyc
*.egg-info/
__pycache__/
*.mp3

2
README.md

@ -17,7 +17,7 @@ It should work with OS X, Linux, Windows.
### Installation
___
1. Install scdl `pip3 install scdl`
2. Setup your path and your auth_token in `$HOME/.config/scdl/scdl.cfg`
2. (Optional) Setup your path and your auth_token in `$HOME/.config/scdl/scdl.cfg`
### Authentication:

20
scdl/scdl.py

@ -131,7 +131,7 @@ def get_item(track_url):
item = client.get('/resolve', url=track_url)
except Exception as e:
print("Could not resolve url " + track_url)
print(e.message, e.args)
print(e)
sys.exit(0)
return item
@ -142,8 +142,11 @@ def parse_url(track_url):
"""
arguments = docopt(__doc__, version='0.1')
item = get_item(track_url)
if not item:
return
elif isinstance(item, soundcloud.resource.ResourceList):
download_all(item)
elif item.kind == 'track':
print("Found a track")
download_track(item)
@ -287,6 +290,21 @@ def download_playlist(playlist):
download_track(mp3_url)
def download_all(tracks):
"""
Download all song of a page
Not recommended
"""
print("NOTE: This will only download the songs of the page.(49 max)")
print("I recommend you to provide an user link and a download type.")
count = 0
for track in tracks:
count += 1
print("")
print('Track n°%d' % (count))
download_track(track)
def download_track(track):
"""
Downloads a track

Loading…
Cancel
Save