mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-25 19:52:11 +00:00
[bandcamp] Fix thumbnail extraction
This commit is contained in:
parent
a99cc4ca16
commit
8b4774dcac
1 changed files with 3 additions and 1 deletions
|
@ -47,6 +47,7 @@ class BandcampIE(InfoExtractor):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
title = mobj.group('title')
|
title = mobj.group('title')
|
||||||
webpage = self._download_webpage(url, title)
|
webpage = self._download_webpage(url, title)
|
||||||
|
thumbnail = self._html_search_meta('og:image', webpage, default=None)
|
||||||
m_download = re.search(r'freeDownloadPage: "(.*?)"', webpage)
|
m_download = re.search(r'freeDownloadPage: "(.*?)"', webpage)
|
||||||
if not m_download:
|
if not m_download:
|
||||||
m_trackinfo = re.search(r'trackinfo: (.+),\s*?\n', webpage)
|
m_trackinfo = re.search(r'trackinfo: (.+),\s*?\n', webpage)
|
||||||
|
@ -75,6 +76,7 @@ class BandcampIE(InfoExtractor):
|
||||||
return {
|
return {
|
||||||
'id': track_id,
|
'id': track_id,
|
||||||
'title': data['title'],
|
'title': data['title'],
|
||||||
|
'thumbnail': thumbnail,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'duration': float_or_none(data.get('duration')),
|
'duration': float_or_none(data.get('duration')),
|
||||||
}
|
}
|
||||||
|
@ -143,7 +145,7 @@ class BandcampIE(InfoExtractor):
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'thumbnail': info.get('thumb_url'),
|
'thumbnail': info.get('thumb_url') or thumbnail,
|
||||||
'uploader': info.get('artist'),
|
'uploader': info.get('artist'),
|
||||||
'artist': artist,
|
'artist': artist,
|
||||||
'track': track,
|
'track': track,
|
||||||
|
|
Loading…
Reference in a new issue