Get track URLs
This commit is contained in:
parent
2e06dc231f
commit
ae3e32cd21
@ -55,6 +55,7 @@ class User:
|
|||||||
following = []
|
following = []
|
||||||
|
|
||||||
class Track:
|
class Track:
|
||||||
|
url = ''
|
||||||
title = None
|
title = None
|
||||||
artist = None
|
artist = None
|
||||||
date = None
|
date = None
|
||||||
@ -141,10 +142,11 @@ def Get_Tracks_Info(url, limit = 100):
|
|||||||
if track_elem.find(class_='sound__trackList'):
|
if track_elem.find(class_='sound__trackList'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Grab the title
|
# Grab the title and url
|
||||||
title_elem = track_elem.find(class_='soundTitle__title')
|
title_elem = track_elem.find(class_='soundTitle__title')
|
||||||
if title_elem:
|
if title_elem:
|
||||||
track.title = title_elem.span.string.strip()
|
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)
|
# Grab who uploaded it (usually the artist unless it's a label)
|
||||||
artist_elem = track_elem.find(class_='soundTitle__usernameText')
|
artist_elem = track_elem.find(class_='soundTitle__usernameText')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user