From f4f339529cfe19d09a0c7103f64ef60b15032a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sat, 3 Jan 2015 21:44:47 +0600 Subject: [PATCH] [ellentv] Clean up and simplify --- youtube_dl/extractor/ellentv.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/youtube_dl/extractor/ellentv.py b/youtube_dl/extractor/ellentv.py index 097317842..89fa9f7e4 100644 --- a/youtube_dl/extractor/ellentv.py +++ b/youtube_dl/extractor/ellentv.py @@ -1,7 +1,6 @@ # coding: utf-8 from __future__ import unicode_literals -import re import json from .common import InfoExtractor @@ -12,7 +11,7 @@ from ..utils import ( class EllenTVIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?(ellentv|ellentube)\.com/videos/(?P[a-z0-9_-]+)' + _VALID_URL = r'https?://(?:www\.)?(?:ellentv|ellentube)\.com/videos/(?P[a-z0-9_-]+)' _TESTS = [{ 'url': 'http://www.ellentv.com/videos/0-7jqrsr18/', 'md5': 'e4af06f3bf0d5f471921a18db5764642', @@ -23,8 +22,7 @@ class EllenTVIE(InfoExtractor): 'timestamp': 1406876400, 'upload_date': '20140801', } - }, - { + }, { 'url': 'http://ellentube.com/videos/0-dvzmabd5/', 'md5': '98238118eaa2bbdf6ad7f708e3e4f4eb', 'info_dict': { @@ -37,16 +35,12 @@ class EllenTVIE(InfoExtractor): }] def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') + video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) timestamp = parse_iso8601(self._search_regex( r'