mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-25 18:04:33 +01:00
Merge master
This commit is contained in:
parent
d65d89183f
commit
d7a19b8e54
@ -22,6 +22,7 @@ from ..utils import (
|
|||||||
unified_strdate,
|
unified_strdate,
|
||||||
unified_timestamp,
|
unified_timestamp,
|
||||||
url_or_none,
|
url_or_none,
|
||||||
|
RegexNotFoundError,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -415,3 +416,52 @@ class BandcampWeeklyIE(InfoExtractor):
|
|||||||
'episode_id': compat_str(video_id),
|
'episode_id': compat_str(video_id),
|
||||||
'formats': formats
|
'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,
|
||||||
|
}
|
||||||
|
@ -80,7 +80,12 @@ from .awaan import (
|
|||||||
)
|
)
|
||||||
from .azmedien import AZMedienIE
|
from .azmedien import AZMedienIE
|
||||||
from .baidu import BaiduVideoIE
|
from .baidu import BaiduVideoIE
|
||||||
from .bandcamp import BandcampIE, BandcampAlbumIE, BandcampWeeklyIE
|
from .bandcamp import (
|
||||||
|
BandcampIE,
|
||||||
|
BandcampAlbumIE,
|
||||||
|
BandcampWeeklyIE,
|
||||||
|
BandcampUserIE,
|
||||||
|
)
|
||||||
from .bbc import (
|
from .bbc import (
|
||||||
BBCCoUkIE,
|
BBCCoUkIE,
|
||||||
BBCCoUkArticleIE,
|
BBCCoUkArticleIE,
|
||||||
|
Loading…
Reference in New Issue
Block a user