56 lines
1.8 KiB
Python
Raw Normal View History

# coding: utf-8
from __future__ import unicode_literals
2014-01-15 11:49:50 +05:30
from .common import InfoExtractor
2016-07-02 18:49:39 +02:00
from ..utils import (
int_or_none,
unified_strdate,
unified_timestamp,
)
2016-07-02 18:49:39 +02:00
import re
2014-01-15 11:49:50 +05:30
class FranceInterIE(InfoExtractor):
2016-07-02 18:49:39 +02:00
_VALID_URL = r'https?://(?:www\.)?franceinter\.fr/emissions/(?P<id>[^?#]+)'
_TEST = {
2016-07-02 18:49:39 +02:00
'url': 'https://www.franceinter.fr/emissions/la-tete-au-carre/la-tete-au-carre-30-juin-2016',
'md5': 'f13e4371662cf5a829f64d829ae78062',
2016-02-14 15:37:17 +06:00
'info_dict': {
2016-07-02 18:49:39 +02:00
'id': 'la-tete-au-carre/la-tete-au-carre-30-juin-2016',
'ext': 'mp3',
2016-07-02 18:49:39 +02:00
'title': 'Regards sur le sport du 30 juin 2016 - France Inter',
'description': 'UEFA Europa, Jeux Olympiques... La période est aux sports, dans les gradins ou devant les écrans. Mais quel est le regard des spécialistes sur cette pratique? ',
'timestamp': 1467244800,
'upload_date': '20160630',
},
}
2014-01-15 11:49:50 +05:30
def _real_extract(self, url):
2015-12-22 11:30:35 +01:00
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
2016-07-02 18:49:39 +02:00
video_url = self._search_regex(
r'<button class="replay-button playable" data-is-aod="1" data-url="([^"]+)"', webpage, 'video url')
2016-07-02 18:49:39 +02:00
title = self._og_search_title(webpage)
description = self._og_search_description(webpage)
extractdate = self._search_regex(
r'([0-9]+[.][0-9]+[.][0-9]+)', video_url, 'extractdate', fatal=False)
timestamp = unified_timestamp(extractdate)
upload_date = (unified_strdate(extractdate))
return {
'id': video_id,
'title': title,
'description': description,
'timestamp': timestamp,
'formats': [{
'url': video_url,
'vcodec': 'none',
}],
2016-07-02 18:49:39 +02:00
}