- title = self._html_search_regex(r'<h1>(.+?)</h1>', webpage, 'title',
- flags=re.DOTALL)
- url = self.build_video_url(id)
- upload_date = self.parse_upload_date(
- self._search_regex(r'Publié le (\d\d-\d\d-\d{4})', webpage,
- 'upload date'))
- view_count = int(self._search_regex(r'(\d+) vues', webpage, 'view count'))
- duration = int(self._search_regex('Durée (\d+)', webpage, 'duration'))
- categories = self.parse_categories(self._html_search_regex(
- r'<li class="categorie">(.+?)</li>', webpage, "categories",
- flags=re.DOTALL))
- description = self._html_search_regex(
- r'<article id="descriptif">(.+?)</article>', webpage, "description",
- flags=re.DOTALL)
- thumbnail = url_prefix + self._html_search_regex(re.compile(
- '<div id="mediaspace' + id + '">.*?<img src="(.+?)"', re.DOTALL),
- webpage, "thumbnail")
- uploader = re.sub(r' *\| *$', '',
- self._html_search_regex(r'<li class="auteur">(.+?)</li>', webpage,
- "uploader", flags=re.DOTALL))
- average_rating = float(self._search_regex(r'Note : (\d+,\d+)',
- webpage, "average rating").replace(',', '.'))
- comment_count = int(self._search_regex(r'\((\d+)\)', webpage,
- "comment count"))
+ upload_date = unified_strdate(self._search_regex(
+ r'Le\s*<b>([\d/]+)', webpage, 'upload date', fatal=False))
+ duration = settings.get('main', {}).get('duration')
+ view_count = int_or_none(self._search_regex(
+ r'(\d+) vues', webpage, 'view count', fatal=False))
+ average_rating = self._search_regex(
+ r'Note\s*:\s*(\d+(?:,\d+)?)', webpage, 'average rating', fatal=False)
+ if average_rating:
+ average_rating = float_or_none(average_rating.replace(',', '.'))
+
+ categories = self._html_search_regex(
+ r'(?s)Catégories\s*:\s*<b>(.+?)</b>', webpage, 'categories', fatal=False)
+ if categories:
+ categories = [category.strip() for category in categories.split(',')]
+
+ subtitles = {'fr': [{
+ 'url': subtitle,
+ } for subtitle in settings.get('main', {}).get('vtt_tracks', {}).values()]}