1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-25 18:04:33 +01:00

Added ie for tracks

This commit is contained in:
Lyz 2019-10-25 17:35:27 +02:00
parent faf074154a
commit 895f5e8b04
No known key found for this signature in database
GPG Key ID: 6C7D7C1612CDE02F

View File

@ -447,8 +447,8 @@ class BandcampUserIE(InfoExtractor):
def _real_extract(self, url): def _real_extract(self, url):
uploader = self._match_id(url) uploader = self._match_id(url)
webpage = self._download_webpage(url, uploader) webpage = self._download_webpage(url, uploader)
entries = []
# Bandcamp User type 1 page # Bandcamp User type 1 page
try: try:
@ -456,29 +456,32 @@ class BandcampUserIE(InfoExtractor):
r'data-edit-callback="/music_reorder" data-initial-values="([^"]+)">', r'data-edit-callback="/music_reorder" data-initial-values="([^"]+)">',
webpage, 'raw_data').replace('"', '"')) webpage, 'raw_data').replace('"', '"'))
entries = [ for element in discography_data:
self.url_result( if element['type'] == 'album':
ie = BandcampAlbumIE.ie_key()
else:
ie = BandcampIE.ie_key()
entries.append(self.url_result(
compat_urlparse.urljoin(url, element['page_url']), compat_urlparse.urljoin(url, element['page_url']),
ie=BandcampAlbumIE.ie_key(), ie=ie,
video_id=element['id'], video_id=element['id'],
video_title=element['title'], video_title=element['title']))
)
for element in discography_data
]
except RegexNotFoundError: except RegexNotFoundError:
# Bandcamp user type 2 page # Bandcamp user type 2 page
discography_data = re.findall( discography_data = re.findall(
r'<div[^>]+trackTitle["\'][^"\']+["\']([^"\']+)', webpage) r'<div[^>]+trackTitle["\'][^"\']+["\']([^"\']+)', webpage)
entries = [ for element in discography_data:
self.url_result( if re.match('album', element):
compat_urlparse.urljoin(url, element), ie = BandcampAlbumIE.ie_key()
ie=BandcampAlbumIE.ie_key(), else:
video_title=element, ie = BandcampIE.ie_key()
)
for element in discography_data
]
entries.append(self.url_result(
compat_urlparse.urljoin(url, element),
ie=ie,
video_title=element))
return { return {
'_type': 'playlist', '_type': 'playlist',
'id': uploader, 'id': uploader,