homemoviestube extractor in working state
This commit is contained in:
parent
fe1010df3d
commit
9317b8c65d
@ -1,38 +1,39 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
class HomeMoviesTubeIE(InfoExtractor):
|
class HomeMoviesTubeIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?homemoviestube\.com/watch/(?P<id>[0-9]+)'
|
_VALID_URL = r'https?://(?:www\.)?homemoviestube\.com/videos/(?P<id>[0-9]+)/(?P<display_id>[^/]+)\.html'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'https://homemoviestube.com/watch/42',
|
'url': 'https://www.homemoviestube.com/videos/314747/creamed-again.html',
|
||||||
'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)',
|
'md5': 'a1f827520d82c0b70da391a8aed410c9',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '42',
|
'id': '314747',
|
||||||
|
'display_id': 'creamed-again',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Video title goes here',
|
'title': 'Creamed again',
|
||||||
'thumbnail': r're:^https?://.*\.jpg$',
|
|
||||||
# TODO more properties, either as:
|
|
||||||
# * A value
|
|
||||||
# * MD5 checksum; start the string with md5:
|
|
||||||
# * A regular expression; start the string with re:
|
|
||||||
# * Any Python type (for example int or float)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
video_id = self._match_id(url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
display_id = mobj.group('display_id')
|
||||||
|
video_id = mobj.group('id')
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
|
||||||
|
video_url = self._html_search_regex(
|
||||||
|
r'<source src="(.+?)"', webpage, 'video URL')
|
||||||
|
|
||||||
# TODO more code goes here, for example ...
|
|
||||||
title = self._html_search_regex(r'<h1>(.+?)</h1>', webpage, 'title')
|
title = self._html_search_regex(r'<h1>(.+?)</h1>', webpage, 'title')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
'display_id': display_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'description': self._og_search_description(webpage),
|
'url': video_url,
|
||||||
'uploader': self._search_regex(r'<div[^>]+id="uploader"[^>]*>([^<]+)<', webpage, 'uploader', fatal=False),
|
|
||||||
# TODO more properties (see youtube_dl/extractor/common.py)
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user