Handle paid video only if formats is missing.
This commit is contained in:
parent
341cc7125b
commit
0e3e9bd435
@ -158,10 +158,6 @@ class OdnoklassnikiIE(InfoExtractor):
|
|||||||
video_id, 'Downloading metadata JSON',
|
video_id, 'Downloading metadata JSON',
|
||||||
data=urlencode_postdata(data))
|
data=urlencode_postdata(data))
|
||||||
|
|
||||||
paymentInfo = metadata.get('paymentInfo')
|
|
||||||
if paymentInfo:
|
|
||||||
raise ExtractorError('This is Paid video. you need to subscribe in order to watch it', expected=True)
|
|
||||||
|
|
||||||
movie = metadata['movie']
|
movie = metadata['movie']
|
||||||
|
|
||||||
# Some embedded videos may not contain title in movie dict (e.g.
|
# Some embedded videos may not contain title in movie dict (e.g.
|
||||||
@ -255,5 +251,10 @@ class OdnoklassnikiIE(InfoExtractor):
|
|||||||
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
if not formats:
|
||||||
|
payment_info = metadata.get('paymentInfo')
|
||||||
|
if payment_info:
|
||||||
|
raise ExtractorError('This video is paid, subscribe to download it', expected=True)
|
||||||
|
|
||||||
info['formats'] = formats
|
info['formats'] = formats
|
||||||
return info
|
return info
|
||||||
|
Loading…
x
Reference in New Issue
Block a user