1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-29 03:34:32 +01:00

Merge master

This commit is contained in:
Lyz 2019-11-07 22:48:13 +01:00
parent c9595ee780
commit 1782b39a08
No known key found for this signature in database
GPG Key ID: 6C7D7C1612CDE02F
2 changed files with 56 additions and 1 deletions

View File

@ -22,6 +22,7 @@ from ..utils import (
unified_strdate,
unified_timestamp,
url_or_none,
RegexNotFoundError,
)
@ -415,3 +416,52 @@ class BandcampWeeklyIE(InfoExtractor):
'episode_id': compat_str(video_id),
'formats': formats
}
class BandcampUserIE(InfoExtractor):
IE_NAME = 'Bandcamp:user'
_VALID_URL = r'https?://(?:(?P<subdomain>[^.]+)\.)?bandcamp\.com'
_TESTS = [{
'url': 'https://adrianvonziegler.bandcamp.com',
'info_dict': {
'id': 'adrianvonziegler',
'title': 'Albums of adrianvonziegler',
},
'playlist_mincount': 20,
}, {
'url': 'http://dotscale.bandcamp.com',
'info_dict': {
'id': 'dotscale',
'title': 'Albums of dotscale',
},
'playlist_count': 1,
}]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
uploader = mobj.group('subdomain')
webpage = self._download_webpage(url, uploader)
album_elements = re.findall(r'<a href="/album/(.+)">', webpage)
if not album_elements:
raise ExtractorError('The page doesn\'t contain any albums')
entries = [
self.url_result(
compat_urlparse.urljoin(url, 'album/{}'.format(album_id)),
ie=BandcampAlbumIE.ie_key(),
video_id='{}-{}'.format(uploader, album_id),
video_title=album_id,
)
for album_id in album_elements
]
return {
'_type': 'playlist',
'id': uploader,
'title': 'Albums of {}'.format(uploader),
'entries': entries,
}

View File

@ -80,7 +80,12 @@ from .awaan import (
)
from .azmedien import AZMedienIE
from .baidu import BaiduVideoIE
from .bandcamp import BandcampIE, BandcampAlbumIE, BandcampWeeklyIE
from .bandcamp import (
BandcampIE,
BandcampAlbumIE,
BandcampWeeklyIE,
BandcampUserIE,
)
from .bbc import (
BBCCoUkIE,
BBCCoUkArticleIE,