unescapeHTML,
update_url_query,
unified_strdate,
+ url_or_none,
)
fatal=False)
if not stat:
continue
- retry_url = stat.get('retry_url')
- if not isinstance(retry_url, compat_str):
+ retry_url = url_or_none(stat.get('retry_url'))
+ if not retry_url:
continue
formats.append({
'url': self._proto_relative_url(retry_url, 'http:'),
raise ExtractorError('The page doesn\'t contain any tracks')
# Only tracks with duration info have songs
entries = [
- self.url_result(compat_urlparse.urljoin(url, t_path), ie=BandcampIE.ie_key())
+ self.url_result(
+ compat_urlparse.urljoin(url, t_path),
+ ie=BandcampIE.ie_key(),
+ video_title=self._search_regex(
+ r'<span\b[^>]+\bitemprop=["\']name["\'][^>]*>([^<]+)',
+ elem_content, 'track title', fatal=False))
for elem_content, t_path in track_elements
if self._html_search_meta('duration', elem_content, default=None)]
formats = []
for format_id, format_url in show['audio_stream'].items():
- if not isinstance(format_url, compat_str):
+ if not url_or_none(format_url):
continue
for known_ext in KNOWN_EXTENSIONS:
if known_ext in format_id: