mirror of
https://github.com/l1ving/youtube-dl
synced 2025-01-21 06:22:51 +08:00
[idf1_extractor] Add new extractor (fulfilling support request #25671)
This commit is contained in:
parent
2391941f28
commit
acb0f56569
@ -451,6 +451,7 @@ from .hungama import (
|
||||
HungamaSongIE,
|
||||
)
|
||||
from .hypem import HypemIE
|
||||
from .idf1_extractor import IDF1IE
|
||||
from .ign import (
|
||||
IGNIE,
|
||||
OneUPIE,
|
||||
@ -1516,3 +1517,4 @@ from .zattoo import (
|
||||
from .zdf import ZDFIE, ZDFChannelIE
|
||||
from .zingmp3 import ZingMp3IE
|
||||
from .zype import ZypeIE
|
||||
|
||||
|
43
youtube_dl/extractor/idf1_extractor.py
Normal file
43
youtube_dl/extractor/idf1_extractor.py
Normal file
@ -0,0 +1,43 @@
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import url_or_none
|
||||
|
||||
|
||||
class IDF1IE(InfoExtractor):
|
||||
IE_NAME = 'IDF1'
|
||||
_VALID_URL = r'https?://(?:www\.)?idf1\.fr/videos/(?:[^/|.]+)/(?P<id>[^/|.]+)\.html'
|
||||
_TESTS = [{
|
||||
'url': 'https://www.idf1.fr/videos/jlpp/2020-05-29-partie-1.html',
|
||||
'info_dict': {
|
||||
'id': '2020-05-29-partie-1',
|
||||
'ext': 'js',
|
||||
'title': 'JLPP - 2020/05/29 - partie 1 sur le replay IDF1 - IDF1',
|
||||
'description': '"Jacky lave plus propre, votre nouvelle émission culte, tous les jours du lundi au vendredi à 17h00 sur IDF1 !"',
|
||||
'url': 'https://player.dacast.com/js/player.js?contentId=15863_f_890022',
|
||||
},
|
||||
}, {
|
||||
'url': 'https://www.idf1.fr/videos/id-voyance/2020-03-13-partie-3.html',
|
||||
'info_dict': {
|
||||
'id': '2020-03-13-partie-3',
|
||||
'ext': 'js',
|
||||
'title': 'ID Voyance Île-de-France - 2020/03/13 - partie 3 sur le replay IDF1 - IDF1',
|
||||
'description': '"Isabelle et nos voyants en direct tous les vendredis dès 20h50 sur IDF1 pour l\'émission ID Voyance Île-de-France."',
|
||||
'url': 'https://player.dacast.com/js/player.js?contentId=15863_f_827665',
|
||||
},
|
||||
}]
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
title = self._html_search_regex(r'<title[^>]*>(.+?)</title>', webpage, 'title', default='(no title available)')
|
||||
description = self._html_search_regex(r'<meta[^>]*\sname=["|\']description["|\'][^>]*\scontent=(.+?)/>', webpage, 'description', fatal=False)
|
||||
dacast_link = self._html_search_regex(r'<script\ssrc=([^\>]+)></script>', webpage, 'link')
|
||||
dacast_link = url_or_none(dacast_link.replace('"', ''))
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'description': description,
|
||||
'url': dacast_link,
|
||||
}
|
Loading…
Reference in New Issue
Block a user