Compare commits

..

No commits in common. "c3ff8bbcd6967b5f1e071eee19459a63076cd816" and "03c1c0e5a67065df24a4507820997c7adaa8ca81" have entirely different histories.

View File

@ -13,7 +13,6 @@ from ..utils import (
strip_or_none, strip_or_none,
mimetype2ext, mimetype2ext,
try_get, try_get,
url_or_none,
urlencode_postdata, urlencode_postdata,
urljoin, urljoin,
) )
@ -94,15 +93,6 @@ class LinkedInIE(LinkedInBaseIE):
'description': 'md5:be125430bab1c574f16aeb186a4d5b19', 'description': 'md5:be125430bab1c574f16aeb186a4d5b19',
'creator': 'Mishal K.' 'creator': 'Mishal K.'
}, },
}, {
'url': 'https://www.linkedin.com/posts/the-mathworks_2_what-is-mathworks-cloud-center-activity-7151241570371948544-4Gu7',
'info_dict': {
'id': '2',
'ext': 'mp4',
'title': 'MathWorks on LinkedIn: What Is MathWorks Cloud Center?',
'thumbnail': 'https://media.licdn.com/dms/image/D5610AQFKo9M0zqY2_g/ads-video-thumbnail_720_1280/0/1704988806715?e=2147483647&v=beta&t=0vg-ksOY2KrL_QFlNacCv5Tmuk0tum9FJ_4dlJ56Gyw',
'subtitles': 'mincount:1'
},
}] }]
def _real_extract(self, url): def _real_extract(self, url):
@ -114,17 +104,17 @@ class LinkedInIE(LinkedInBaseIE):
like_count = int_or_none(get_element_by_class('social-counts-reactions__social-counts-numRections', webpage)) like_count = int_or_none(get_element_by_class('social-counts-reactions__social-counts-numRections', webpage))
creator = strip_or_none(clean_html(get_element_by_class('comment__actor-name', webpage))) creator = strip_or_none(clean_html(get_element_by_class('comment__actor-name', webpage)))
video_attrs = extract_attributes(self._search_regex(r'(<video[^>]+>)', webpage, 'video')) video_json = extract_attributes(self._search_regex(r'(<video[^>]+>)', webpage, 'video'))
sources = self._parse_json(video_attrs['data-sources'], video_id) sources = self._parse_json(video_json['data-sources'], video_id)
formats = [{ formats = [{
'url': source['src'], 'url': source['src'],
'ext': mimetype2ext(source.get('type')), 'ext': mimetype2ext(source.get('type')),
'tbr': float_or_none(source.get('data-bitrate'), scale=1000), 'tbr': float_or_none(source.get('data-bitrate'), scale=1000),
} for source in sources] } for source in sources]
subtitles = {'en': [{ subtitles = {}
'url': video_attrs['data-captions-url'], sub_url = video_json.get('data-captions-url')
'ext': 'vtt', if sub_url:
}]} if url_or_none(video_attrs.get('data-captions-url')) else {} subtitles.setdefault('en', []).append({'url': sub_url, 'ext': 'vtt'})
return { return {
'id': video_id, 'id': video_id,