Skip to content

Commit

Permalink
[soundcloud] Fix paged playlist download archival
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryDHall committed Feb 1, 2019
1 parent 9613e14 commit 18f015f
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions youtube_dl/extractor/soundcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,13 +397,26 @@ def resolve_permalink_url(candidates):
if isinstance(cand, dict):
permalink_url = cand.get('permalink_url')
entry_id = self._extract_id(cand)
title = cand.get('title')
if permalink_url and permalink_url.startswith('http'):
return permalink_url, entry_id
return permalink_url, entry_id, title

for e in collection:
permalink_url, entry_id = resolve_permalink_url((e, e.get('track'), e.get('playlist')))
tr_dict = e.get('track')
pl_dict = e.get('playlist')

permalink_url, entry_id, entry_title = resolve_permalink_url(
(e, tr_dict, pl_dict))
if permalink_url:
entries.append(self.url_result(permalink_url, video_id=entry_id))
entry_data = self.url_result(
permalink_url,
video_id=entry_id, video_title=entry_title)

if isinstance(tr_dict, dict):
# if entry has track data, attach extractor key
entry_data['ie_key'] = SoundcloudIE.ie_key()

entries.append(entry_data)

next_href = response.get('next_href')
if not next_href:
Expand Down

0 comments on commit 18f015f

Please sign in to comment.