mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-13 23:02:34 +00:00
parent
6134fbeb65
commit
9040e2d6e3
1 changed files with 15 additions and 1 deletions
|
@ -12,6 +12,7 @@ from ..compat import (
|
||||||
compat_zip
|
compat_zip
|
||||||
)
|
)
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
ExtractorError,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
strip_or_none,
|
strip_or_none,
|
||||||
|
@ -125,7 +126,20 @@ class MixcloudIE(MixcloudBaseIE):
|
||||||
tag {
|
tag {
|
||||||
name
|
name
|
||||||
}
|
}
|
||||||
}''', track_id, username, slug)
|
}
|
||||||
|
restrictedReason
|
||||||
|
id''', track_id, username, slug)
|
||||||
|
|
||||||
|
if not cloudcast:
|
||||||
|
raise ExtractorError('Track not found', expected=True)
|
||||||
|
|
||||||
|
reason = cloudcast.get('restrictedReason')
|
||||||
|
if reason == 'tracklist':
|
||||||
|
raise ExtractorError('Track unavailable in your country due to licensing restrictions', expected=True)
|
||||||
|
elif reason == 'repeat_play':
|
||||||
|
raise ExtractorError('You have reached your play limit for this track', expected=True)
|
||||||
|
elif reason:
|
||||||
|
raise ExtractorError('Track is restricted', expected=True)
|
||||||
|
|
||||||
title = cloudcast['name']
|
title = cloudcast['name']
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue