Safely get title string
No thanks to you, San Holo, this would've worked perfectly
This commit is contained in:
parent
f8a6aa3980
commit
61df852e63
@ -209,8 +209,11 @@ def Get_Tracks_Info(url, limit = 100):
|
|||||||
# Grab the title and url
|
# 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 = str(title_elem.span.string.strip())
|
|
||||||
track.url = 'https://soundcloud.com' + title_elem['href']
|
track.url = 'https://soundcloud.com' + title_elem['href']
|
||||||
|
if title_elem.span.string:
|
||||||
|
track.title = str(title_elem.span.string.strip())
|
||||||
|
else:
|
||||||
|
track.title = ''
|
||||||
|
|
||||||
# Check if we have already gotten this track before
|
# Check if we have already gotten this track before
|
||||||
if track.url in tracks.keys():
|
if track.url in tracks.keys():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user