mirror of
https://github.com/yt-dlp/yt-dlp
synced 2024-12-24 21:58:58 +01:00
[ie/soundcloud] Various fixes (#11820)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Core Tests / Core Tests (push) Has been cancelled
Download Tests / Quick Download Tests (push) Has been cancelled
Download Tests / Full Download Tests (push) Has been cancelled
Quick Test / Core Test (push) Has been cancelled
Quick Test / Code check (push) Has been cancelled
Release (master) / release (push) Has been cancelled
Release (master) / publish_pypi (push) Has been cancelled
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Core Tests / Core Tests (push) Has been cancelled
Download Tests / Quick Download Tests (push) Has been cancelled
Download Tests / Full Download Tests (push) Has been cancelled
Quick Test / Core Test (push) Has been cancelled
Quick Test / Code check (push) Has been cancelled
Release (master) / release (push) Has been cancelled
Release (master) / publish_pypi (push) Has been cancelled
- Fix original/download formats so that they are considered bestaudio - Raise appropriate error if track is DRM-protected Authored by: bashonly
This commit is contained in:
parent
09a6c68712
commit
d298693b1b
1 changed files with 8 additions and 2 deletions
|
@ -210,6 +210,7 @@ class SoundcloudBaseIE(InfoExtractor):
|
|||
|
||||
format_urls = set()
|
||||
formats = []
|
||||
has_drm = False
|
||||
query = {'client_id': self._CLIENT_ID}
|
||||
if secret_token:
|
||||
query['secret_token'] = secret_token
|
||||
|
@ -245,6 +246,7 @@ class SoundcloudBaseIE(InfoExtractor):
|
|||
'url': format_url,
|
||||
'quality': 10,
|
||||
'format_note': 'Original',
|
||||
'vcodec': 'none',
|
||||
})
|
||||
|
||||
def invalid_url(url):
|
||||
|
@ -260,6 +262,7 @@ class SoundcloudBaseIE(InfoExtractor):
|
|||
|
||||
protocol = traverse_obj(t, ('format', 'protocol', {str})) or 'http'
|
||||
if protocol.startswith(('ctr-', 'cbc-')):
|
||||
has_drm = True
|
||||
continue
|
||||
if protocol == 'progressive':
|
||||
protocol = 'http'
|
||||
|
@ -317,8 +320,11 @@ class SoundcloudBaseIE(InfoExtractor):
|
|||
'preference': -10 if is_preview else None,
|
||||
})
|
||||
|
||||
if not formats and info.get('policy') == 'BLOCK':
|
||||
self.raise_geo_restricted(metadata_available=True)
|
||||
if not formats:
|
||||
if has_drm:
|
||||
self.report_drm(track_id)
|
||||
if info.get('policy') == 'BLOCK':
|
||||
self.raise_geo_restricted(metadata_available=True)
|
||||
|
||||
user = info.get('user') or {}
|
||||
|
||||
|
|
Loading…
Reference in a new issue