def _parse_jwplayer_data(self, jwplayer_data, video_id=None, require_title=True, m3u8_id=None, mpd_id=None, rtmp_params=None, base_url=None):
    if ('playlist' not in jwplayer_data):
        jwplayer_data = {'playlist': [jwplayer_data]}
    entries = []
    if (not isinstance(jwplayer_data['playlist'], list)):
        jwplayer_data['playlist'] = [jwplayer_data['playlist']]
    for video_data in jwplayer_data['playlist']:
        if ('sources' not in video_data):
            video_data['sources'] = [video_data]
        this_video_id = (video_id or video_data['mediaid'])
        formats = self._parse_jwplayer_formats(video_data['sources'], video_id=this_video_id, m3u8_id=m3u8_id, mpd_id=mpd_id, rtmp_params=rtmp_params, base_url=base_url)
        subtitles = {}
        tracks = video_data.get('tracks')
        if (tracks and isinstance(tracks, list)):
            for track in tracks:
                if (not isinstance(track, dict)):
                    continue
                track_kind = track.get('kind')
                if ((not track_kind) or (not isinstance(track_kind, compat_str))):
                    continue
                if (track_kind.lower() not in ('captions', 'subtitles')):
                    continue
                track_url = urljoin(base_url, track.get('file'))
                if (not track_url):
                    continue
                subtitles.setdefault((track.get('label') or 'en'), []).append({'url': self._proto_relative_url(track_url)})
        entry = {'id': this_video_id, 'title': unescapeHTML((video_data['title'] if require_title else video_data.get('title'))), 'description': clean_html(video_data.get('description')), 'thumbnail': urljoin(base_url, self._proto_relative_url(video_data.get('image'))), 'timestamp': int_or_none(video_data.get('pubdate')), 'duration': float_or_none((jwplayer_data.get('duration') or video_data.get('duration'))), 'subtitles': subtitles}
        if ((len(formats) == 1) and re.search('^(?:http|//).*(?:youtube\\.com|youtu\\.be)/.+', formats[0]['url'])):
            entry.update({'_type': 'url_transparent', 'url': formats[0]['url']})
        else:
            self._sort_formats(formats)
            entry['formats'] = formats
        entries.append(entry)
    if (len(entries) == 1):
        return entries[0]
    else:
        return self.playlist_result(entries)
def _parse_jwplayer_data(self, jwplayer_data, video_id=None, require_title=True, m3u8_id=None, mpd_id=None, rtmp_params=None, base_url=None):
    if ('playlist' not in jwplayer_data):
        jwplayer_data = {'playlist': [jwplayer_data]}
    entries = []
    if (not isinstance(jwplayer_data['playlist'], list)):
        jwplayer_data['playlist'] = [jwplayer_data['playlist']]
    for video_data in jwplayer_data['playlist']:
        if ('sources' not in video_data):
            video_data['sources'] = [video_data]
        this_video_id = (video_id or video_data['mediaid'])
        formats = self._parse_jwplayer_formats(video_data['sources'], video_id=this_video_id, m3u8_id=m3u8_id, mpd_id=mpd_id, rtmp_params=rtmp_params, base_url=base_url)
        subtitles = {}
        tracks = video_data.get('tracks')
        if (tracks and isinstance(tracks, list)):
            for track in tracks:
                if (not isinstance(track, dict)):
                    continue
                track_kind = track.get('kind')
                if ((not track_kind) or (not isinstance(track_kind, compat_str))):
                    continue
                if (track_kind.lower() not in ('captions', 'subtitles')):
                    continue
                track_url = urljoin(base_url, track.get('file'))
                if (not track_url):
                    continue
                subtitles.setdefault((track.get('label') or 'en'), []).append({'url': self._proto_relative_url(track_url)})
        entry = {'id': this_video_id, 'title': unescapeHTML((video_data['title'] if require_title else video_data.get('title'))), 'description': clean_html(video_data.get('description')), 'thumbnail': urljoin(base_url, self._proto_relative_url(video_data.get('image'))), 'timestamp': int_or_none(video_data.get('pubdate')), 'duration': float_or_none((jwplayer_data.get('duration') or video_data.get('duration'))), 'subtitles': subtitles}
        if ((len(formats) == 1) and re.search('^(?:http|//).*(?:youtube\\.com|youtu\\.be)/.+', formats[0]['url'])):
            entry.update({'_type': 'url_transparent', 'url': formats[0]['url']})
        else:
            self._sort_formats(formats)
            entry['formats'] = formats
        entries.append(entry)
    if (len(entries) == 1):
        return entries[0]
    else:
        return self.playlist_result(entries)