diff options
| author | remitamine <remitamine@gmail.com> | 2016-04-01 20:42:15 +0100 | 
|---|---|---|
| committer | remitamine <remitamine@gmail.com> | 2016-04-01 20:42:15 +0100 | 
| commit | 5f705baf5ecda6be678481ff9ab9c27a6cd54dc0 (patch) | |
| tree | 1b8dfb0f614e8400e96c631840218d7cf122b170 /youtube_dl/extractor/cnet.py | |
| parent | 0750b2491f5f14e51c2bf91584fd490944154393 (diff) | |
[cnet] extract more formats
Diffstat (limited to 'youtube_dl/extractor/cnet.py')
| -rw-r--r-- | youtube_dl/extractor/cnet.py | 25 | 
1 files changed, 13 insertions, 12 deletions
| diff --git a/youtube_dl/extractor/cnet.py b/youtube_dl/extractor/cnet.py index c154b3e19..58c26f20f 100644 --- a/youtube_dl/extractor/cnet.py +++ b/youtube_dl/extractor/cnet.py @@ -17,6 +17,8 @@ class CNETIE(ThePlatformIE):              'uploader_id': '6085384d-619e-11e3-b231-14feb5ca9861',              'uploader': 'Sarah Mitroff',              'duration': 70, +            'timestamp': 1396479627, +            'upload_date': '20140402',          },      }, {          'url': 'http://www.cnet.com/videos/whiny-pothole-tweets-at-local-government-when-hit-by-cars-tomorrow-daily-187/', @@ -28,8 +30,11 @@ class CNETIE(ThePlatformIE):              'uploader_id': 'b163284d-6b73-44fc-b3e6-3da66c392d40',              'uploader': 'Ashley Esqueda',              'duration': 1482, +            'timestamp': 1433289889, +            'upload_date': '20150603',          },      }] +    TP_RELEASE_URL_TEMPLATE = 'http://link.theplatform.com/s/kYEXFC/%s?mbr=true'      def _real_extract(self, url):          display_id = self._match_id(url) @@ -51,16 +56,12 @@ class CNETIE(ThePlatformIE):              uploader = None              uploader_id = None -        metadata = self.get_metadata('kYEXFC/%s' % list(vdata['files'].values())[0], video_id) -        description = vdata.get('description') or metadata.get('description') -        duration = int_or_none(vdata.get('duration')) or metadata.get('duration') - -        formats = [] -        subtitles = {} +        media_guid_path = 'media/guid/2288573011/%s' % vdata['mpxRefId'] +        formats, subtitles = self._extract_theplatform_smil(self.TP_RELEASE_URL_TEMPLATE % media_guid_path, video_id)          for (fkey, vid) in vdata['files'].items():              if fkey == 'hls_phone' and 'hls_tablet' in vdata['files']:                  continue -            release_url = 'http://link.theplatform.com/s/kYEXFC/%s?mbr=true' % vid +            release_url = self.TP_RELEASE_URL_TEMPLATE % vid              if fkey == 'hds':                  release_url += '&manifest=f4m'              tp_formats, tp_subtitles = self._extract_theplatform_smil(release_url, video_id, 'Downloading %s SMIL data' % fkey) @@ -68,15 +69,15 @@ class CNETIE(ThePlatformIE):              subtitles = self._merge_subtitles(subtitles, tp_subtitles)          self._sort_formats(formats) -        return { +        info = self.get_metadata('kYEXFC/%s' % media_guid_path, video_id) +        info.update({              'id': video_id,              'display_id': display_id,              'title': title, -            'description': description, -            'thumbnail': metadata.get('thumbnail'), -            'duration': duration, +            'duration': int_or_none(vdata.get('duration')),              'uploader': uploader,              'uploader_id': uploader_id,              'subtitles': subtitles,              'formats': formats, -        } +        }) +        return info | 
