Get track URLs

This commit is contained in:
Thomas Wade 2018-09-25 17:22:28 +09:30
parent 2e06dc231f
commit ae3e32cd21

View File

@ -55,6 +55,7 @@ class User:
following = []
class Track:
url = ''
title = None
artist = None
date = None
@ -141,10 +142,11 @@ def Get_Tracks_Info(url, limit = 100):
if track_elem.find(class_='sound__trackList'):
continue
# Grab the title
# Grab the title and url
title_elem = track_elem.find(class_='soundTitle__title')
if title_elem:
track.title = title_elem.span.string.strip()
track.url = 'https://soundcloud.com' + title_elem['href']
# Grab who uploaded it (usually the artist unless it's a label)
artist_elem = track_elem.find(class_='soundTitle__usernameText')