Add ToukouCity to extractors
This commit is contained in:
parent
c1d293cfa6
commit
2004ccc0b0
@ -321,6 +321,7 @@ from .thisav import ThisAVIE
|
|||||||
from .tinypic import TinyPicIE
|
from .tinypic import TinyPicIE
|
||||||
from .tlc import TlcIE, TlcDeIE
|
from .tlc import TlcIE, TlcDeIE
|
||||||
from .toutv import TouTvIE
|
from .toutv import TouTvIE
|
||||||
|
from .toukoucity import ToukouCityIE
|
||||||
from .toypics import ToypicsUserIE, ToypicsIE
|
from .toypics import ToypicsUserIE, ToypicsIE
|
||||||
from .traileraddict import TrailerAddictIE
|
from .traileraddict import TrailerAddictIE
|
||||||
from .trilulilu import TriluliluIE
|
from .trilulilu import TriluliluIE
|
||||||
|
59
youtube_dl/extractor/toukoucity.py
Normal file
59
youtube_dl/extractor/toukoucity.py
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
import urllib2
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
unified_strdate,
|
||||||
|
)
|
||||||
|
|
||||||
|
class ToukouCityIE(InfoExtractor):
|
||||||
|
IE_NAME = 'ToukouCity'
|
||||||
|
IE_DESC = '無料アダルトビデオが豊富なカテゴリーで楽しめる'
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?toukoucity\.to/video/(?P<id>[\w\d]+)/?'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://toukoucity.to/video/igy3nBwTEb/',
|
||||||
|
'md5': 'd36db92d7a2034312ab692ba97f216ab',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'igy3nBwTEb',
|
||||||
|
'filesize': 366450899,
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': u'ドラえもん',
|
||||||
|
'description': u'のび太のブリキの迷宮(ラビリンス)',
|
||||||
|
'thumbnail': 'http://img.toukoucity.to/igy3nBwTEb/thumbnail_12.jpg',
|
||||||
|
'upload_date': '20140805',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
video_id = mobj.group('id')
|
||||||
|
|
||||||
|
self.report_extraction(video_id)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
title = self._html_search_regex(r'<h2 class="titles">(.+?)</h2>', webpage, u'title')
|
||||||
|
video_url = self._search_regex(r'so\.addVariable\(\'file\',\'(.+?\.mp4)\'\)', webpage, u'video_url')
|
||||||
|
thumbnail = self._search_regex(r'so\.addVariable\(\'image\',\'(.+?)\'\)', webpage, u'thumbnail')
|
||||||
|
upload_date = unified_strdate(self._search_regex(r'<span class="gray_s">(.+?)</span>', webpage, u'upload_date'))
|
||||||
|
extension = video_url.split(".")[-1]
|
||||||
|
view_count = self._html_search_regex(r'<span class="load">(.+?)</span>', webpage, u'view_count')
|
||||||
|
player_url = self._search_regex(r'SWFObject\(\'(.+?)\'.+?\)', webpage, u'player_url')
|
||||||
|
description = self._search_regex(r'<p class="dot">(.+?)</p>', webpage, u'description')
|
||||||
|
filesize = int(urllib2.urlopen(video_url).headers["Content-Length"])
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': title,
|
||||||
|
'url': video_url,
|
||||||
|
'thumbnail': thumbnail,
|
||||||
|
'upload_date': upload_date,
|
||||||
|
'ext': extension,
|
||||||
|
'player_url': player_url,
|
||||||
|
'description': description,
|
||||||
|
'view_count': view_count,
|
||||||
|
'webpage_url': url,
|
||||||
|
'filesize': filesize,
|
||||||
|
}
|
@ -829,6 +829,7 @@ def unified_strdate(date_str):
|
|||||||
'%Y-%m-%d',
|
'%Y-%m-%d',
|
||||||
'%d.%m.%Y',
|
'%d.%m.%Y',
|
||||||
'%d/%m/%Y',
|
'%d/%m/%Y',
|
||||||
|
'%Y/%m/%d %H:%M',
|
||||||
'%Y/%m/%d %H:%M:%S',
|
'%Y/%m/%d %H:%M:%S',
|
||||||
'%Y-%m-%d %H:%M:%S',
|
'%Y-%m-%d %H:%M:%S',
|
||||||
'%d.%m.%Y %H:%M',
|
'%d.%m.%Y %H:%M',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user