aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-08-13 16:29:05 +0700
committerSergey M․ <dstftw@gmail.com>2016-08-13 16:29:05 +0700
commite97c55ee6aaf5170f86bc8146a20cef56e337a3d (patch)
tree32c1c0613531f47ea223532c3fbd78f0ffe4a675
parentacfccacad5555c21d649729c5e2cb237a70f46e6 (diff)
[expotv] Improve extraction and update test
-rw-r--r--youtube_dl/extractor/expotv.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/youtube_dl/extractor/expotv.py b/youtube_dl/extractor/expotv.py
index 1585a03bb..971c918a4 100644
--- a/youtube_dl/extractor/expotv.py
+++ b/youtube_dl/extractor/expotv.py
@@ -1,7 +1,5 @@
from __future__ import unicode_literals
-import re
-
from .common import InfoExtractor
from ..utils import (
int_or_none,
@@ -12,23 +10,22 @@ from ..utils import (
class ExpoTVIE(InfoExtractor):
_VALID_URL = r'https?://www\.expotv\.com/videos/[^?#]*/(?P<id>[0-9]+)($|[?#])'
_TEST = {
- 'url': 'http://www.expotv.com/videos/reviews/1/24/LinneCardscom/17561',
- 'md5': '2985e6d7a392b2f7a05e0ca350fe41d0',
+ 'url': 'http://www.expotv.com/videos/reviews/3/40/NYX-Butter-lipstick/667916',
+ 'md5': 'fe1d728c3a813ff78f595bc8b7a707a8',
'info_dict': {
- 'id': '17561',
+ 'id': '667916',
'ext': 'mp4',
- 'upload_date': '20060212',
- 'title': 'My Favorite Online Scrapbook Store',
- 'view_count': int,
- 'description': 'You\'ll find most everything you need at this virtual store front.',
- 'uploader': 'Anna T.',
+ 'title': 'NYX Butter Lipstick Little Susie',
+ 'description': 'Goes on like butter, but looks better!',
'thumbnail': 're:^https?://.*\.jpg$',
+ 'uploader': 'Stephanie S.',
+ 'upload_date': '20150520',
+ 'view_count': int,
}
}
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)
player_key = self._search_regex(
@@ -66,7 +63,7 @@ class ExpoTVIE(InfoExtractor):
fatal=False)
upload_date = unified_strdate(self._search_regex(
r'<h5>Reviewed on ([0-9/.]+)</h5>', webpage, 'upload date',
- fatal=False))
+ fatal=False), day_first=False)
return {
'id': video_id,