From 75df2f23cdde1fe24e7fd15c3cd09bd180878220 Mon Sep 17 00:00:00 2001 From: Saimadhav Heblikar Date: Wed, 15 Jan 2014 11:18:47 +0530 Subject: [PATCH 1/4] Create franceinter.py --- youtube_dl/extractor/franceinter.py | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 youtube_dl/extractor/franceinter.py diff --git a/youtube_dl/extractor/franceinter.py b/youtube_dl/extractor/franceinter.py new file mode 100644 index 000000000..89b5f6511 --- /dev/null +++ b/youtube_dl/extractor/franceinter.py @@ -0,0 +1,35 @@ +import re + +from .common import InfoExtractor +class FranceInterIE(InfoExtractor): + + _VALID_URL=r'http://www.franceinter.fr/player/reecouter\?play=(?P[0-9]{6})' + IE_NAME='FranceInter' + + + #Easier to use python string matching than regex for a simple match + def get_download_url(self,webpage): + + start=webpage.index('&urlAOD=')+8 + end=webpage.index('&startTime') + return u'http://www.franceinter.fr/%s'%webpage[start:end] + + def get_title(self,webpage): + start=webpage.index('')+30 + end=webpage.index(' dans') + + return webpage[start:end] + def _real_extract(self,url): + + mobj = re.match(self._VALID_URL, url) + video_id = mobj.group('id') + + webpage=self._download_webpage(url,video_id) + + title=self.get_title(webpage) + + video_url=self.get_download_url(webpage) + + return{'id': video_id,u'url': video_url,u'title': title} + + From fd041d2bcb17453c2145b5b54b0ed286ef94322b Mon Sep 17 00:00:00 2001 From: Saimadhav Heblikar Date: Wed, 15 Jan 2014 11:19:40 +0530 Subject: [PATCH 2/4] Update __init__.py --- youtube_dl/extractor/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index b887c7f10..209f327ec 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -61,6 +61,7 @@ from .fktv import ( FKTVPosteckeIE, ) from .flickr import FlickrIE +from .franceinter import FranceInterIE from .francetv import ( PluzzIE, FranceTvInfoIE, From b441bce85d3d6368b1625082ec3cf04871b27119 Mon Sep 17 00:00:00 2001 From: Saimadhav Heblikar Date: Wed, 15 Jan 2014 11:22:34 +0530 Subject: [PATCH 3/4] Added franceinter [Issue #2105] --- youtube_dl/extractor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 209f327ec..84bbad7d2 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -61,7 +61,7 @@ from .fktv import ( FKTVPosteckeIE, ) from .flickr import FlickrIE -from .franceinter import FranceInterIE +from .franceinter import FranceInterIE from .francetv import ( PluzzIE, FranceTvInfoIE, From 6a9b3f55219669990f15543d0dbc19907dbe15fd Mon Sep 17 00:00:00 2001 From: Saimadhav Heblikar Date: Wed, 15 Jan 2014 11:22:44 +0530 Subject: [PATCH 4/4] Added franceinter [Issue #2105] --- youtube_dl/extractor/franceinter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/franceinter.py b/youtube_dl/extractor/franceinter.py index 89b5f6511..49ca14aab 100644 --- a/youtube_dl/extractor/franceinter.py +++ b/youtube_dl/extractor/franceinter.py @@ -31,5 +31,5 @@ class FranceInterIE(InfoExtractor): video_url=self.get_download_url(webpage) return{'id': video_id,u'url': video_url,u'title': title} - +