Paste Search Dynamic
SoundcloudAPI
  1. rom sclib import SoundcloudAPI, Track, Playlist
  2. from art import *
  3. import re
  4.  
  5. tprint("SP_dwnld")
  6. api = SoundcloudAPI()
  7. playlist = api.resolve(input("URL : "))
  8.  
  9. assert type(playlist) is Playlist
  10.  
  11. for track in playlist.tracks:
  12.     filename = f'./{track.artist} - {track.title}.mp3'
  13.     filename = filename.replace(" ","_")
  14.     filename = re.sub('[^a-zA-Z-_3.]', '', filename)
  15.  
  16.     with open(filename, 'wb+') as fp:
  17.         track.write_mp3_to(fp)
  18.         print(filename)
Parsed in 0.006 seconds