mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-01-07 12:00:09 +09:00
bandlab nits
This commit is contained in:
parent
8dced09ed0
commit
d6b19dca91
@ -45,7 +45,7 @@ class BandlabIE(InfoExtractor):
|
|||||||
|
|
||||||
class BandlabAlbumOrPlaylistIE(InfoExtractor):
|
class BandlabAlbumOrPlaylistIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?bandlab\.com/[^/]+/(?P<kind>albums|collections)/(?P<id>[^/]+)'
|
_VALID_URL = r'https?://(?:www\.)?bandlab\.com/[^/]+/(?P<kind>albums|collections)/(?P<id>[^/]+)'
|
||||||
_TRACK_ID_RE = re.compile(r'.+/(?P<id>[^/]+)\.m4a')
|
_TRACK_ID_RE = r'.+/(?P<id>[^/]+)\.m4a'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.bandlab.com/sbsdasani/albums/dc26e307-e51f-ed11-95d7-002248452390',
|
'url': 'https://www.bandlab.com/sbsdasani/albums/dc26e307-e51f-ed11-95d7-002248452390',
|
||||||
'playlist': [
|
'playlist': [
|
||||||
@ -138,9 +138,7 @@ class BandlabAlbumOrPlaylistIE(InfoExtractor):
|
|||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
resource_id = self._match_id(url)
|
resource_id, kind = re.match(self._VALID_URL, url).group('id', 'kind')
|
||||||
kind_regex = re.compile(self._VALID_URL)
|
|
||||||
kind = kind_regex.match(url).group('kind')
|
|
||||||
config = self._download_json(
|
config = self._download_json(
|
||||||
'http://www.bandlab.com/api/v1.3/%s/%s' % (kind, resource_id), resource_id)
|
'http://www.bandlab.com/api/v1.3/%s/%s' % (kind, resource_id), resource_id)
|
||||||
entries = []
|
entries = []
|
||||||
@ -154,13 +152,13 @@ class BandlabAlbumOrPlaylistIE(InfoExtractor):
|
|||||||
name = strip_or_none(name)
|
name = strip_or_none(name)
|
||||||
if not (url and name):
|
if not (url and name):
|
||||||
continue
|
continue
|
||||||
track_id = self._TRACK_ID_RE.match(url).groupdict().get('id')
|
track_id = re.match(self._TRACK_ID_RE, url).group('id')
|
||||||
if not track_id:
|
if not track_id:
|
||||||
continue
|
continue
|
||||||
entries.append({
|
entries.append({
|
||||||
'url': url,
|
'url': url,
|
||||||
'id': track_id,
|
'id': track_id,
|
||||||
'title': name
|
'title': name,
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -98,7 +98,10 @@ from .azmedien import AZMedienIE
|
|||||||
from .baidu import BaiduVideoIE
|
from .baidu import BaiduVideoIE
|
||||||
from .bandaichannel import BandaiChannelIE
|
from .bandaichannel import BandaiChannelIE
|
||||||
from .bandcamp import BandcampIE, BandcampAlbumIE, BandcampWeeklyIE
|
from .bandcamp import BandcampIE, BandcampAlbumIE, BandcampWeeklyIE
|
||||||
from .bandlab import BandlabIE, BandlabAlbumOrPlaylistIE
|
from .bandlab import (
|
||||||
|
BandlabIE,
|
||||||
|
BandlabAlbumOrPlaylistIE
|
||||||
|
)
|
||||||
from .bbc import (
|
from .bbc import (
|
||||||
BBCCoUkIE,
|
BBCCoUkIE,
|
||||||
BBCCoUkArticleIE,
|
BBCCoUkArticleIE,
|
||||||
|
Loading…
Reference in New Issue
Block a user