mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-29 05:32:00 +00:00
Use _sort_formats util
This commit is contained in:
parent
c3026dd70c
commit
7f1c09bea1
1 changed files with 2 additions and 4 deletions
|
@ -198,7 +198,7 @@ class BNNVaraIE(NPOIE):
|
||||||
headers={
|
headers={
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
})
|
})
|
||||||
|
|
||||||
product_id = traverse_obj(media, ('data', 'player', 'pomsProductId'))
|
product_id = traverse_obj(media, ('data', 'player', 'pomsProductId'))
|
||||||
formats = self._download_by_product_id(product_id, video_id) if product_id else []
|
formats = self._download_by_product_id(product_id, video_id) if product_id else []
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
@ -231,9 +231,7 @@ class ONIE(NPOIE):
|
||||||
for result in results:
|
for result in results:
|
||||||
formats.extend(self._extract_formats_by_product_id(result, video_id))
|
formats.extend(self._extract_formats_by_product_id(result, video_id))
|
||||||
|
|
||||||
if not formats:
|
self._sort_formats(formats)
|
||||||
raise ExtractorError('Could not find a POMS product id in the provided URL, '
|
|
||||||
'perhaps because all stream URLs are DRM protected.')
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
|
Loading…
Reference in a new issue