From f5b669113fc530922280987ff9e19afa780b8844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Thu, 2 Apr 2015 22:32:16 +0600 Subject: [PATCH] [miomio] Simplify and fix python 2.6 issue --- youtube_dl/extractor/miomio_tv.py | 101 ++++++++++++++++++------------ 1 file changed, 60 insertions(+), 41 deletions(-) diff --git a/youtube_dl/extractor/miomio_tv.py b/youtube_dl/extractor/miomio_tv.py index ae20a32fa..dc2ba7cb4 100644 --- a/youtube_dl/extractor/miomio_tv.py +++ b/youtube_dl/extractor/miomio_tv.py @@ -1,74 +1,93 @@ # coding: utf-8 from __future__ import unicode_literals +import random + from .common import InfoExtractor +from ..utils import ( + xpath_text, + int_or_none, +) class MiomioTvIE(InfoExtractor): IE_NAME = 'miomio.tv' _VALID_URL = r'https?://(?:www\.)?miomio\.tv/watch/cc(?P[0-9]+)' - _TEST = { + _TESTS = [{ 'url': 'http://www.miomio.tv/watch/cc179734/', 'md5': '48de02137d0739c15b440a224ad364b9', 'info_dict': { 'id': '179734', - 'title': u'\u624b\u7ed8\u52a8\u6f2b\u9b3c\u6ce3\u4f46\u4e01\u5168\u7a0b\u753b\u6cd5', - 'ext': 'flv' - } - } + 'ext': 'flv', + 'title': '手绘动漫鬼泣但丁全程画法', + 'duration': 354, + }, + }, { + 'url': 'http://www.miomio.tv/watch/cc184024/', + 'info_dict': { + 'id': '43729', + 'title': '《动漫同人插画绘制》', + }, + 'playlist_mincount': 86, + }] def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - title = self._html_search_regex(r'