aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-09-29 00:36:55 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-09-29 00:36:55 +0200
commit457ac58cc72a0b7161a0369a8f282f38ff0f2f93 (patch)
tree600fa2c4b244182c257b467ae0b6933859b9934f /youtube_dl
parent9c44d2429b90dece734df778c63b04c15e91c1ca (diff)
parent67077b182b698ac56cec9525a2669d5cee394226 (diff)
Merge remote-tracking branch 'diffycat/thvideo-update'
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/__init__.py5
-rw-r--r--youtube_dl/extractor/thvideo.py24
2 files changed, 28 insertions, 1 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
index 86bff185b..89a9d8106 100644
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -371,7 +371,10 @@ from .thisav import ThisAVIE
from .tinypic import TinyPicIE
from .tlc import TlcIE, TlcDeIE
from .tnaflix import TNAFlixIE
-from .thvideo import THVideoIE
+from .thvideo import (
+ THVideoIE,
+ THVideoPlaylistIE
+)
from .toutv import TouTvIE
from .toypics import ToypicsUserIE, ToypicsIE
from .traileraddict import TrailerAddictIE
diff --git a/youtube_dl/extractor/thvideo.py b/youtube_dl/extractor/thvideo.py
index 607e947bb..0ae20ea30 100644
--- a/youtube_dl/extractor/thvideo.py
+++ b/youtube_dl/extractor/thvideo.py
@@ -57,3 +57,27 @@ class THVideoIE(InfoExtractor):
'description': description,
'upload_date': upload_date
}
+
+
+class THVideoPlaylistIE(InfoExtractor):
+ _VALID_URL = r'http?://(?:www\.)?thvideo\.tv/mylist(?P<id>[0-9]+)'
+ _TEST = {
+ 'url': 'http://thvideo.tv/mylist2',
+ 'info_dict': {
+ 'id': '2',
+ 'title': '幻想万華鏡',
+ },
+ 'playlist_mincount': 23,
+ }
+
+ def _real_extract(self, url):
+ webpage = self._download_webpage(url, 'playlist')
+ mobj = re.match(self._VALID_URL, url)
+ list_id = mobj.group('id')
+ list_title = self._html_search_regex(r'<h1 class="show_title">(.*?)<b id', webpage, 'playlist title')
+
+ entries = [
+ self.url_result('http://thvideo.tv/v/th' + id, 'THVideo')
+ for id in re.findall(r'<dd><a href="http://thvideo.tv/v/th(\d+)/" target=', webpage)]
+
+ return self.playlist_result(entries, list_id, list_title) \ No newline at end of file