diff options
| author | Naglis Jonaitis <njonaitis@gmail.com> | 2015-05-07 21:58:03 +0300 | 
|---|---|---|
| committer | Naglis Jonaitis <njonaitis@gmail.com> | 2015-05-07 22:00:07 +0300 | 
| commit | 46be82b811d91be0b0876cf141e6a94e65b8fd7f (patch) | |
| tree | 9eff64565380db61a0a03f3fdb1c9ee966d6a0d0 | |
| parent | 09b412dafa4bc95b9850d77b3bce5f7eac47a578 (diff) | |
[vessel] Use `main_video_asset` when searching for video_asset (Fixes #5623)
| -rw-r--r-- | youtube_dl/extractor/vessel.py | 12 | 
1 files changed, 9 insertions, 3 deletions
| diff --git a/youtube_dl/extractor/vessel.py b/youtube_dl/extractor/vessel.py index 6215f0642..3c8d2a943 100644 --- a/youtube_dl/extractor/vessel.py +++ b/youtube_dl/extractor/vessel.py @@ -38,9 +38,13 @@ class VesselIE(InfoExtractor):          return req      @staticmethod -    def find_assets(data, asset_type): +    def find_assets(data, asset_type, asset_id=None):          for asset in data.get('assets', []): -            if asset.get('type') == asset_type: +            if not asset.get('type') == asset_type: +                continue +            elif asset_id is not None and not asset.get('id') == asset_id: +                continue +            else:                  yield asset      def _check_access_rights(self, data): @@ -82,11 +86,13 @@ class VesselIE(InfoExtractor):          req = VesselIE.make_json_request(              self._API_URL_TEMPLATE % asset_id, {'client': 'web'})          data = self._download_json(req, video_id) +        video_asset_id = data.get('main_video_asset')          self._check_access_rights(data)          try: -            video_asset = next(VesselIE.find_assets(data, 'video')) +            video_asset = next( +                VesselIE.find_assets(data, 'video', asset_id=video_asset_id))          except StopIteration:              raise ExtractorError('No video assets found') | 
