From 35dfca43ea763b08f321004cd9bf207d4c4e6c89 Mon Sep 17 00:00:00 2001 From: nimeir Date: Tue, 26 Mar 2019 20:32:38 +0000 Subject: [PATCH 1/2] tvple extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/tvple.py | 31 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 youtube_dl/extractor/tvple.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 8e7a5bf41..59e592f43 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -1222,6 +1222,7 @@ from .tvplay import ( TVPlayHomeIE, ) from .tvplayer import TVPlayerIE +from .tvple import TvPleIE from .tweakers import TweakersIE from .twentyfourvideo import TwentyFourVideoIE from .twentymin import TwentyMinutenIE diff --git a/youtube_dl/extractor/tvple.py b/youtube_dl/extractor/tvple.py new file mode 100644 index 000000000..7025a092c --- /dev/null +++ b/youtube_dl/extractor/tvple.py @@ -0,0 +1,31 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor +import re + + +class TvPleIE(InfoExtractor): + _VALID_URL = r'https?://tvple.com/.+' + _TEST = { + 'url': 'http://tvple.com/381843', + 'info_dict': { + 'id': '381843', + 'ext': 'mp4', + 'title': '티비플 » [팀 달캬] 마더즈 로자리오(Mother`s Rosario) 프로젝트 » 퍼가기', + } + } + + def _real_extract(self, url): + video_id = re.findall('\d.+', url) + webpage = self._download_webpage(url, video_id) + title = re.findall(u'(.+)<\/title>', webpage) + api_request_url = re.findall(r'(http:\/\/api\.tvple\.com\/v1.*?)"', webpage) + api_page = self._download_webpage(api_request_url[0], video_id) + urlh = re.findall(r'(http:\/\/media.*?)"', api_page) + return { + 'id': video_id[0], + 'title': title, + 'ext': 'mp4', + 'url': urlh[0] + } From 16843103e1683598798b8d840326cb4a340db934 Mon Sep 17 00:00:00 2001 From: nimeir <rj8205562@gmail.com> Date: Tue, 26 Mar 2019 22:09:50 +0000 Subject: [PATCH 2/2] fixed compatibily error --- youtube_dl/extractor/tvple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/tvple.py b/youtube_dl/extractor/tvple.py index 7025a092c..cbf555903 100644 --- a/youtube_dl/extractor/tvple.py +++ b/youtube_dl/extractor/tvple.py @@ -19,7 +19,7 @@ class TvPleIE(InfoExtractor): def _real_extract(self, url): video_id = re.findall('\d.+', url) webpage = self._download_webpage(url, video_id) - title = re.findall(u'<title>(.+)<\/title>', webpage) + title = re.findall(r'<title>(.+)<\/title>', webpage) api_request_url = re.findall(r'(http:\/\/api\.tvple\.com\/v1.*?)"', webpage) api_page = self._download_webpage(api_request_url[0], video_id) urlh = re.findall(r'(http:\/\/media.*?)"', api_page)