mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-05-30 01:22:40 +09:00
Compare commits
6 Commits
62f5c74713
...
0ca85c5195
Author | SHA1 | Date | |
---|---|---|---|
![]() |
0ca85c5195 | ||
![]() |
3eb8d22ddb | ||
![]() |
4e714f9df1 | ||
![]() |
c1ea7f5a24 | ||
![]() |
48d0994b5b | ||
![]() |
7561727db6 |
@ -32,7 +32,7 @@ class BokeCCBaseIE(InfoExtractor):
|
|||||||
|
|
||||||
|
|
||||||
class BokeCCIE(BokeCCBaseIE):
|
class BokeCCIE(BokeCCBaseIE):
|
||||||
_IE_DESC = 'CC视频'
|
IE_DESC = 'CC视频'
|
||||||
_VALID_URL = r'https?://union\.bokecc\.com/playvideo\.bo\?(?P<query>.*)'
|
_VALID_URL = r'https?://union\.bokecc\.com/playvideo\.bo\?(?P<query>.*)'
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
|
@ -9,7 +9,7 @@ from ..utils import (
|
|||||||
|
|
||||||
|
|
||||||
class CloudyIE(InfoExtractor):
|
class CloudyIE(InfoExtractor):
|
||||||
_IE_DESC = 'cloudy.ec'
|
IE_DESC = 'cloudy.ec'
|
||||||
_VALID_URL = r'https?://(?:www\.)?cloudy\.ec/(?:v/|embed\.php\?.*?\bid=)(?P<id>[A-Za-z0-9]+)'
|
_VALID_URL = r'https?://(?:www\.)?cloudy\.ec/(?:v/|embed\.php\?.*?\bid=)(?P<id>[A-Za-z0-9]+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://www.cloudy.ec/v/af511e2527aac',
|
'url': 'https://www.cloudy.ec/v/af511e2527aac',
|
||||||
|
@ -422,6 +422,8 @@ class InfoExtractor(object):
|
|||||||
_GEO_COUNTRIES = None
|
_GEO_COUNTRIES = None
|
||||||
_GEO_IP_BLOCKS = None
|
_GEO_IP_BLOCKS = None
|
||||||
_WORKING = True
|
_WORKING = True
|
||||||
|
# supply this in public subclasses: used in supported sites list, etc
|
||||||
|
# IE_DESC = 'short description of IE'
|
||||||
|
|
||||||
def __init__(self, downloader=None):
|
def __init__(self, downloader=None):
|
||||||
"""Constructor. Receives an optional downloader."""
|
"""Constructor. Receives an optional downloader."""
|
||||||
|
@ -371,7 +371,6 @@ from .esri import EsriVideoIE
|
|||||||
from .europa import EuropaIE
|
from .europa import EuropaIE
|
||||||
from .expotv import ExpoTVIE
|
from .expotv import ExpoTVIE
|
||||||
from .expressen import ExpressenIE
|
from .expressen import ExpressenIE
|
||||||
from .extremetube import ExtremeTubeIE
|
|
||||||
from .eyedotv import EyedoTVIE
|
from .eyedotv import EyedoTVIE
|
||||||
from .facebook import (
|
from .facebook import (
|
||||||
FacebookIE,
|
FacebookIE,
|
||||||
@ -562,7 +561,6 @@ from .kaltura import KalturaIE
|
|||||||
from .kankan import KankanIE
|
from .kankan import KankanIE
|
||||||
from .karaoketv import KaraoketvIE
|
from .karaoketv import KaraoketvIE
|
||||||
from .karrierevideos import KarriereVideosIE
|
from .karrierevideos import KarriereVideosIE
|
||||||
from .keezmovies import KeezMoviesIE
|
|
||||||
from .ketnet import KetnetIE
|
from .ketnet import KetnetIE
|
||||||
from .khanacademy import (
|
from .khanacademy import (
|
||||||
KhanAcademyIE,
|
KhanAcademyIE,
|
||||||
@ -713,10 +711,6 @@ from .mlb import (
|
|||||||
)
|
)
|
||||||
from .mnet import MnetIE
|
from .mnet import MnetIE
|
||||||
from .moevideo import MoeVideoIE
|
from .moevideo import MoeVideoIE
|
||||||
from .mofosex import (
|
|
||||||
MofosexIE,
|
|
||||||
MofosexEmbedIE,
|
|
||||||
)
|
|
||||||
from .mojvideo import MojvideoIE
|
from .mojvideo import MojvideoIE
|
||||||
from .morningstar import MorningstarIE
|
from .morningstar import MorningstarIE
|
||||||
from .motherless import (
|
from .motherless import (
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
from ..utils import str_to_int
|
|
||||||
from .keezmovies import KeezMoviesIE
|
|
||||||
|
|
||||||
|
|
||||||
class ExtremeTubeIE(KeezMoviesIE):
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?extremetube\.com/(?:[^/]+/)?video/(?P<id>[^/#?&]+)'
|
|
||||||
_TESTS = [{
|
|
||||||
'url': 'http://www.extremetube.com/video/music-video-14-british-euro-brit-european-cumshots-swallow-652431',
|
|
||||||
'md5': '92feaafa4b58e82f261e5419f39c60cb',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'music-video-14-british-euro-brit-european-cumshots-swallow-652431',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'Music Video 14 british euro brit european cumshots swallow',
|
|
||||||
'uploader': 'anonim',
|
|
||||||
'view_count': int,
|
|
||||||
'age_limit': 18,
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
'url': 'http://www.extremetube.com/gay/video/abcde-1234',
|
|
||||||
'only_matching': True,
|
|
||||||
}, {
|
|
||||||
'url': 'http://www.extremetube.com/video/latina-slut-fucked-by-fat-black-dick',
|
|
||||||
'only_matching': True,
|
|
||||||
}, {
|
|
||||||
'url': 'http://www.extremetube.com/video/652431',
|
|
||||||
'only_matching': True,
|
|
||||||
}]
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
webpage, info = self._extract_info(url)
|
|
||||||
|
|
||||||
if not info['title']:
|
|
||||||
info['title'] = self._search_regex(
|
|
||||||
r'<h1[^>]+title="([^"]+)"[^>]*>', webpage, 'title')
|
|
||||||
|
|
||||||
uploader = self._html_search_regex(
|
|
||||||
r'Uploaded by:\s*</[^>]+>\s*<a[^>]+>(.+?)</a>',
|
|
||||||
webpage, 'uploader', fatal=False)
|
|
||||||
view_count = str_to_int(self._search_regex(
|
|
||||||
r'Views:\s*</[^>]+>\s*<[^>]+>([\d,\.]+)</',
|
|
||||||
webpage, 'view count', fatal=False))
|
|
||||||
|
|
||||||
info.update({
|
|
||||||
'uploader': uploader,
|
|
||||||
'view_count': view_count,
|
|
||||||
})
|
|
||||||
|
|
||||||
return info
|
|
@ -66,7 +66,6 @@ from .tnaflix import TNAFlixNetworkEmbedIE
|
|||||||
from .drtuber import DrTuberIE
|
from .drtuber import DrTuberIE
|
||||||
from .redtube import RedTubeIE
|
from .redtube import RedTubeIE
|
||||||
from .tube8 import Tube8IE
|
from .tube8 import Tube8IE
|
||||||
from .mofosex import MofosexEmbedIE
|
|
||||||
from .spankwire import SpankwireIE
|
from .spankwire import SpankwireIE
|
||||||
from .youporn import YouPornIE
|
from .youporn import YouPornIE
|
||||||
from .vimeo import (
|
from .vimeo import (
|
||||||
@ -3044,11 +3043,6 @@ class GenericIE(InfoExtractor):
|
|||||||
if tube8_urls:
|
if tube8_urls:
|
||||||
return self.playlist_from_matches(tube8_urls, video_id, video_title, ie=Tube8IE.ie_key())
|
return self.playlist_from_matches(tube8_urls, video_id, video_title, ie=Tube8IE.ie_key())
|
||||||
|
|
||||||
# Look for embedded Mofosex player
|
|
||||||
mofosex_urls = MofosexEmbedIE._extract_urls(webpage)
|
|
||||||
if mofosex_urls:
|
|
||||||
return self.playlist_from_matches(mofosex_urls, video_id, video_title, ie=MofosexEmbedIE.ie_key())
|
|
||||||
|
|
||||||
# Look for embedded Spankwire player
|
# Look for embedded Spankwire player
|
||||||
spankwire_urls = SpankwireIE._extract_urls(webpage)
|
spankwire_urls = SpankwireIE._extract_urls(webpage)
|
||||||
if spankwire_urls:
|
if spankwire_urls:
|
||||||
|
@ -35,15 +35,6 @@ from ..utils import (
|
|||||||
|
|
||||||
class ITVBaseIE(InfoExtractor):
|
class ITVBaseIE(InfoExtractor):
|
||||||
|
|
||||||
def _search_nextjs_data(self, webpage, video_id, **kw):
|
|
||||||
transform_source = kw.pop('transform_source', None)
|
|
||||||
fatal = kw.pop('fatal', True)
|
|
||||||
return self._parse_json(
|
|
||||||
self._search_regex(
|
|
||||||
r'''<script\b[^>]+\bid=('|")__NEXT_DATA__\1[^>]*>(?P<js>[^<]+)</script>''',
|
|
||||||
webpage, 'next.js data', group='js', fatal=fatal, **kw),
|
|
||||||
video_id, transform_source=transform_source, fatal=fatal)
|
|
||||||
|
|
||||||
def __handle_request_webpage_error(self, err, video_id=None, errnote=None, fatal=True):
|
def __handle_request_webpage_error(self, err, video_id=None, errnote=None, fatal=True):
|
||||||
if errnote is False:
|
if errnote is False:
|
||||||
return False
|
return False
|
||||||
@ -109,7 +100,9 @@ class ITVBaseIE(InfoExtractor):
|
|||||||
|
|
||||||
class ITVIE(ITVBaseIE):
|
class ITVIE(ITVBaseIE):
|
||||||
_VALID_URL = r'https?://(?:www\.)?itv\.com/(?:(?P<w>watch)|hub)/[^/]+/(?(w)[\w-]+/)(?P<id>\w+)'
|
_VALID_URL = r'https?://(?:www\.)?itv\.com/(?:(?P<w>watch)|hub)/[^/]+/(?(w)[\w-]+/)(?P<id>\w+)'
|
||||||
_IE_DESC = 'ITVX'
|
IE_DESC = 'ITVX'
|
||||||
|
_WORKING = False
|
||||||
|
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'note': 'Hub URLs redirect to ITVX',
|
'note': 'Hub URLs redirect to ITVX',
|
||||||
'url': 'https://www.itv.com/hub/liar/2a4547a0012',
|
'url': 'https://www.itv.com/hub/liar/2a4547a0012',
|
||||||
@ -270,7 +263,7 @@ class ITVIE(ITVBaseIE):
|
|||||||
'ext': determine_ext(href, 'vtt'),
|
'ext': determine_ext(href, 'vtt'),
|
||||||
})
|
})
|
||||||
|
|
||||||
next_data = self._search_nextjs_data(webpage, video_id, fatal=False, default='{}')
|
next_data = self._search_nextjs_data(webpage, video_id, fatal=False, default={})
|
||||||
video_data.update(traverse_obj(next_data, ('props', 'pageProps', ('title', 'episode')), expected_type=dict)[0] or {})
|
video_data.update(traverse_obj(next_data, ('props', 'pageProps', ('title', 'episode')), expected_type=dict)[0] or {})
|
||||||
title = traverse_obj(video_data, 'headerTitle', 'episodeTitle')
|
title = traverse_obj(video_data, 'headerTitle', 'episodeTitle')
|
||||||
info = self._og_extract(webpage, require_title=not title)
|
info = self._og_extract(webpage, require_title=not title)
|
||||||
@ -323,7 +316,7 @@ class ITVIE(ITVBaseIE):
|
|||||||
|
|
||||||
class ITVBTCCIE(ITVBaseIE):
|
class ITVBTCCIE(ITVBaseIE):
|
||||||
_VALID_URL = r'https?://(?:www\.)?itv\.com/(?!(?:watch|hub)/)(?:[^/]+/)+(?P<id>[^/?#&]+)'
|
_VALID_URL = r'https?://(?:www\.)?itv\.com/(?!(?:watch|hub)/)(?:[^/]+/)+(?P<id>[^/?#&]+)'
|
||||||
_IE_DESC = 'ITV articles: News, British Touring Car Championship'
|
IE_DESC = 'ITV articles: News, British Touring Car Championship'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'note': 'British Touring Car Championship',
|
'note': 'British Touring Car Championship',
|
||||||
'url': 'https://www.itv.com/btcc/articles/btcc-2018-all-the-action-from-brands-hatch',
|
'url': 'https://www.itv.com/btcc/articles/btcc-2018-all-the-action-from-brands-hatch',
|
||||||
|
@ -1,133 +0,0 @@
|
|||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
|
||||||
from ..aes import aes_decrypt_text
|
|
||||||
from ..compat import compat_urllib_parse_unquote
|
|
||||||
from ..utils import (
|
|
||||||
determine_ext,
|
|
||||||
ExtractorError,
|
|
||||||
int_or_none,
|
|
||||||
str_to_int,
|
|
||||||
strip_or_none,
|
|
||||||
url_or_none,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class KeezMoviesIE(InfoExtractor):
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?keezmovies\.com/video/(?:(?P<display_id>[^/]+)-)?(?P<id>\d+)'
|
|
||||||
_TESTS = [{
|
|
||||||
'url': 'https://www.keezmovies.com/video/arab-wife-want-it-so-bad-i-see-she-thirsty-and-has-tiny-money-18070681',
|
|
||||||
'md5': '2ac69cdb882055f71d82db4311732a1a',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '18070681',
|
|
||||||
'display_id': 'arab-wife-want-it-so-bad-i-see-she-thirsty-and-has-tiny-money',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'Arab wife want it so bad I see she thirsty and has tiny money.',
|
|
||||||
'thumbnail': None,
|
|
||||||
'view_count': int,
|
|
||||||
'age_limit': 18,
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
'url': 'http://www.keezmovies.com/video/18070681',
|
|
||||||
'only_matching': True,
|
|
||||||
}]
|
|
||||||
|
|
||||||
def _extract_info(self, url, fatal=True):
|
|
||||||
mobj = re.match(self._VALID_URL, url)
|
|
||||||
video_id = mobj.group('id')
|
|
||||||
display_id = (mobj.group('display_id')
|
|
||||||
if 'display_id' in mobj.groupdict()
|
|
||||||
else None) or mobj.group('id')
|
|
||||||
|
|
||||||
webpage = self._download_webpage(
|
|
||||||
url, display_id, headers={'Cookie': 'age_verified=1'})
|
|
||||||
|
|
||||||
formats = []
|
|
||||||
format_urls = set()
|
|
||||||
|
|
||||||
title = None
|
|
||||||
thumbnail = None
|
|
||||||
duration = None
|
|
||||||
encrypted = False
|
|
||||||
|
|
||||||
def extract_format(format_url, height=None):
|
|
||||||
format_url = url_or_none(format_url)
|
|
||||||
if not format_url or not format_url.startswith(('http', '//')):
|
|
||||||
return
|
|
||||||
if format_url in format_urls:
|
|
||||||
return
|
|
||||||
format_urls.add(format_url)
|
|
||||||
tbr = int_or_none(self._search_regex(
|
|
||||||
r'[/_](\d+)[kK][/_]', format_url, 'tbr', default=None))
|
|
||||||
if not height:
|
|
||||||
height = int_or_none(self._search_regex(
|
|
||||||
r'[/_](\d+)[pP][/_]', format_url, 'height', default=None))
|
|
||||||
if encrypted:
|
|
||||||
format_url = aes_decrypt_text(
|
|
||||||
video_url, title, 32).decode('utf-8')
|
|
||||||
formats.append({
|
|
||||||
'url': format_url,
|
|
||||||
'format_id': '%dp' % height if height else None,
|
|
||||||
'height': height,
|
|
||||||
'tbr': tbr,
|
|
||||||
})
|
|
||||||
|
|
||||||
flashvars = self._parse_json(
|
|
||||||
self._search_regex(
|
|
||||||
r'flashvars\s*=\s*({.+?});', webpage,
|
|
||||||
'flashvars', default='{}'),
|
|
||||||
display_id, fatal=False)
|
|
||||||
|
|
||||||
if flashvars:
|
|
||||||
title = flashvars.get('video_title')
|
|
||||||
thumbnail = flashvars.get('image_url')
|
|
||||||
duration = int_or_none(flashvars.get('video_duration'))
|
|
||||||
encrypted = flashvars.get('encrypted') is True
|
|
||||||
for key, value in flashvars.items():
|
|
||||||
mobj = re.search(r'quality_(\d+)[pP]', key)
|
|
||||||
if mobj:
|
|
||||||
extract_format(value, int(mobj.group(1)))
|
|
||||||
video_url = flashvars.get('video_url')
|
|
||||||
if video_url and determine_ext(video_url, None):
|
|
||||||
extract_format(video_url)
|
|
||||||
|
|
||||||
video_url = self._html_search_regex(
|
|
||||||
r'flashvars\.video_url\s*=\s*(["\'])(?P<url>http.+?)\1',
|
|
||||||
webpage, 'video url', default=None, group='url')
|
|
||||||
if video_url:
|
|
||||||
extract_format(compat_urllib_parse_unquote(video_url))
|
|
||||||
|
|
||||||
if not formats:
|
|
||||||
if 'title="This video is no longer available"' in webpage:
|
|
||||||
raise ExtractorError(
|
|
||||||
'Video %s is no longer available' % video_id, expected=True)
|
|
||||||
|
|
||||||
try:
|
|
||||||
self._sort_formats(formats)
|
|
||||||
except ExtractorError:
|
|
||||||
if fatal:
|
|
||||||
raise
|
|
||||||
|
|
||||||
if not title:
|
|
||||||
title = self._html_search_regex(
|
|
||||||
r'<h1[^>]*>([^<]+)', webpage, 'title')
|
|
||||||
|
|
||||||
return webpage, {
|
|
||||||
'id': video_id,
|
|
||||||
'display_id': display_id,
|
|
||||||
'title': strip_or_none(title),
|
|
||||||
'thumbnail': thumbnail,
|
|
||||||
'duration': duration,
|
|
||||||
'age_limit': 18,
|
|
||||||
'formats': formats,
|
|
||||||
}
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
webpage, info = self._extract_info(url, fatal=False)
|
|
||||||
if not info['formats']:
|
|
||||||
return self.url_result(url, 'Generic')
|
|
||||||
info['view_count'] = str_to_int(self._search_regex(
|
|
||||||
r'<b>([\d,.]+)</b> Views?', webpage, 'view count', fatal=False))
|
|
||||||
return info
|
|
@ -1,79 +0,0 @@
|
|||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
|
||||||
from ..utils import (
|
|
||||||
int_or_none,
|
|
||||||
str_to_int,
|
|
||||||
unified_strdate,
|
|
||||||
)
|
|
||||||
from .keezmovies import KeezMoviesIE
|
|
||||||
|
|
||||||
|
|
||||||
class MofosexIE(KeezMoviesIE):
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?mofosex\.com/videos/(?P<id>\d+)/(?P<display_id>[^/?#&.]+)\.html'
|
|
||||||
_TESTS = [{
|
|
||||||
'url': 'http://www.mofosex.com/videos/318131/amateur-teen-playing-and-masturbating-318131.html',
|
|
||||||
'md5': '558fcdafbb63a87c019218d6e49daf8a',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '318131',
|
|
||||||
'display_id': 'amateur-teen-playing-and-masturbating-318131',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'amateur teen playing and masturbating',
|
|
||||||
'thumbnail': r're:^https?://.*\.jpg$',
|
|
||||||
'upload_date': '20121114',
|
|
||||||
'view_count': int,
|
|
||||||
'like_count': int,
|
|
||||||
'dislike_count': int,
|
|
||||||
'age_limit': 18,
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
# This video is no longer available
|
|
||||||
'url': 'http://www.mofosex.com/videos/5018/japanese-teen-music-video.html',
|
|
||||||
'only_matching': True,
|
|
||||||
}]
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
webpage, info = self._extract_info(url)
|
|
||||||
|
|
||||||
view_count = str_to_int(self._search_regex(
|
|
||||||
r'VIEWS:</span>\s*([\d,.]+)', webpage, 'view count', fatal=False))
|
|
||||||
like_count = int_or_none(self._search_regex(
|
|
||||||
r'id=["\']amountLikes["\'][^>]*>(\d+)', webpage,
|
|
||||||
'like count', fatal=False))
|
|
||||||
dislike_count = int_or_none(self._search_regex(
|
|
||||||
r'id=["\']amountDislikes["\'][^>]*>(\d+)', webpage,
|
|
||||||
'like count', fatal=False))
|
|
||||||
upload_date = unified_strdate(self._html_search_regex(
|
|
||||||
r'Added:</span>([^<]+)', webpage, 'upload date', fatal=False))
|
|
||||||
|
|
||||||
info.update({
|
|
||||||
'view_count': view_count,
|
|
||||||
'like_count': like_count,
|
|
||||||
'dislike_count': dislike_count,
|
|
||||||
'upload_date': upload_date,
|
|
||||||
'thumbnail': self._og_search_thumbnail(webpage),
|
|
||||||
})
|
|
||||||
|
|
||||||
return info
|
|
||||||
|
|
||||||
|
|
||||||
class MofosexEmbedIE(InfoExtractor):
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?mofosex\.com/embed/?\?.*?\bvideoid=(?P<id>\d+)'
|
|
||||||
_TESTS = [{
|
|
||||||
'url': 'https://www.mofosex.com/embed/?videoid=318131&referrer=KM',
|
|
||||||
'only_matching': True,
|
|
||||||
}]
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def _extract_urls(webpage):
|
|
||||||
return re.findall(
|
|
||||||
r'<iframe[^>]+\bsrc=["\']((?:https?:)?//(?:www\.)?mofosex\.com/embed/?\?.*?\bvideoid=\d+)',
|
|
||||||
webpage)
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
video_id = self._match_id(url)
|
|
||||||
return self.url_result(
|
|
||||||
'http://www.mofosex.com/videos/{0}/{0}.html'.format(video_id),
|
|
||||||
ie=MofosexIE.ie_key(), video_id=video_id)
|
|
@ -47,7 +47,7 @@ class SenateISVPIE(InfoExtractor):
|
|||||||
['vetaff', '76462', 'http://vetaff-f.akamaihd.net'],
|
['vetaff', '76462', 'http://vetaff-f.akamaihd.net'],
|
||||||
['arch', '', 'http://ussenate-f.akamaihd.net/']
|
['arch', '', 'http://ussenate-f.akamaihd.net/']
|
||||||
]
|
]
|
||||||
_IE_NAME = 'senate.gov'
|
IE_NAME = 'senate.gov'
|
||||||
_VALID_URL = r'https?://(?:www\.)?senate\.gov/isvp/?\?(?P<qs>.+)'
|
_VALID_URL = r'https?://(?:www\.)?senate\.gov/isvp/?\?(?P<qs>.+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.senate.gov/isvp/?comm=judiciary&type=live&stt=&filename=judiciary031715&auto_play=false&wmode=transparent&poster=http%3A%2F%2Fwww.judiciary.senate.gov%2Fthemes%2Fjudiciary%2Fimages%2Fvideo-poster-flash-fit.png',
|
'url': 'http://www.senate.gov/isvp/?comm=judiciary&type=live&stt=&filename=judiciary031715&auto_play=false&wmode=transparent&poster=http%3A%2F%2Fwww.judiciary.senate.gov%2Fthemes%2Fjudiciary%2Fimages%2Fvideo-poster-flash-fit.png',
|
||||||
|
@ -3,32 +3,33 @@ from __future__ import unicode_literals
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
determine_ext,
|
||||||
|
ExtractorError,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
str_to_int,
|
str_to_int,
|
||||||
|
url_or_none,
|
||||||
)
|
)
|
||||||
from .keezmovies import KeezMoviesIE
|
from .common import InfoExtractor
|
||||||
|
from ..aes import aes_decrypt_text
|
||||||
|
from ..compat import compat_urllib_parse_unquote
|
||||||
|
|
||||||
|
|
||||||
class Tube8IE(KeezMoviesIE):
|
class Tube8IE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?tube8\.com/(?:[^/]+/)+(?P<display_id>[^/]+)/(?P<id>\d+)'
|
_VALID_URL = r'https?://(?:www\.)?tube8\.com/(?:[^/]+/)+(?P<display_id>[^/]+)/(?P<id>\d+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'http://www.tube8.com/teen/kasia-music-video/229795/',
|
'url': 'https://www.tube8.com/erotic/playtime/81807731/',
|
||||||
'md5': '65e20c48e6abff62ed0c3965fff13a39',
|
'md5': 'fefa69ff76debaa63aa59374bfc51c95',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '229795',
|
'id': '81807731',
|
||||||
'display_id': 'kasia-music-video',
|
'display_id': 'playtime',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'description': 'hot teen Kasia grinding',
|
'uploader': 'kikkijay-ph',
|
||||||
'uploader': 'unknown',
|
'title': 'Playtime',
|
||||||
'title': 'Kasia music video',
|
|
||||||
'age_limit': 18,
|
'age_limit': 18,
|
||||||
'duration': 230,
|
'duration': 988,
|
||||||
'categories': ['Teen'],
|
'categories': ['Erotic'],
|
||||||
'tags': ['dancing'],
|
'tags': ['adult toys', 'big boobs', 'butt', 'masturbate'],
|
||||||
},
|
},
|
||||||
}, {
|
|
||||||
'url': 'http://www.tube8.com/shemale/teen/blonde-cd-gets-kidnapped-by-two-blacks-and-punished-for-being-a-slutty-girl/19569151/',
|
|
||||||
'only_matching': True,
|
|
||||||
}]
|
}]
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
@ -38,49 +39,121 @@ class Tube8IE(KeezMoviesIE):
|
|||||||
webpage)
|
webpage)
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
webpage, info = self._extract_info(url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
video_id = mobj.group('id')
|
||||||
|
display_id = mobj.group('display_id')
|
||||||
|
|
||||||
if not info['title']:
|
webpage = self._download_webpage(
|
||||||
info['title'] = self._html_search_regex(
|
url, display_id, headers={'Cookie': 'age_verified=1'})
|
||||||
r'videoTitle\s*=\s*"([^"]+)', webpage, 'title')
|
|
||||||
|
|
||||||
description = self._html_search_regex(
|
formats = []
|
||||||
r'(?s)Description:</dt>\s*<dd>(.+?)</dd>', webpage, 'description', fatal=False)
|
format_urls = set()
|
||||||
uploader = self._html_search_regex(
|
|
||||||
r'<span class="username">\s*(.+?)\s*<',
|
title = None
|
||||||
webpage, 'uploader', fatal=False)
|
thumbnail = None
|
||||||
|
duration = None
|
||||||
|
encrypted = False
|
||||||
|
|
||||||
|
def extract_format(format_url, height=None):
|
||||||
|
format_url = url_or_none(format_url)
|
||||||
|
if not format_url or not format_url.startswith(('http', '//')):
|
||||||
|
return
|
||||||
|
if format_url in format_urls:
|
||||||
|
return
|
||||||
|
format_urls.add(format_url)
|
||||||
|
tbr = int_or_none(self._search_regex(
|
||||||
|
r'[/_](\d+)[kK][/_]', format_url, 'tbr', default=None))
|
||||||
|
if not height:
|
||||||
|
height = int_or_none(self._search_regex(
|
||||||
|
r'[/_](\d+)[pP][/_]', format_url, 'height', default=None))
|
||||||
|
if encrypted:
|
||||||
|
format_url = aes_decrypt_text(
|
||||||
|
video_url, title, 32).decode('utf-8')
|
||||||
|
formats.append({
|
||||||
|
'url': format_url,
|
||||||
|
'format_id': '%dp' % height if height else None,
|
||||||
|
'height': height,
|
||||||
|
'tbr': tbr,
|
||||||
|
})
|
||||||
|
|
||||||
|
flashvars = self._parse_json(
|
||||||
|
self._search_regex(
|
||||||
|
r'flashvars\s*=\s*({.+?});', webpage,
|
||||||
|
'flashvars', default='{}'),
|
||||||
|
display_id, fatal=False)
|
||||||
|
|
||||||
|
if flashvars:
|
||||||
|
title = flashvars.get('video_title')
|
||||||
|
thumbnail = flashvars.get('image_url')
|
||||||
|
duration = int_or_none(flashvars.get('video_duration'))
|
||||||
|
encrypted = flashvars.get('encrypted') is True
|
||||||
|
uploader = flashvars.get('sponsor')
|
||||||
|
for key, value in flashvars.items():
|
||||||
|
mobj = re.search(r'quality_(\d+)[pP]', key)
|
||||||
|
if mobj:
|
||||||
|
extract_format(value, int(mobj.group(1)))
|
||||||
|
video_url = flashvars.get('video_url')
|
||||||
|
for key, value in flashvars.items():
|
||||||
|
mobj = re.search(r'quality_(\d+)[pP]', key)
|
||||||
|
if mobj:
|
||||||
|
extract_format(value, int(mobj.group(1)))
|
||||||
|
video_url = flashvars.get('video_url')
|
||||||
|
if video_url and determine_ext(video_url, None):
|
||||||
|
extract_format(video_url)
|
||||||
|
|
||||||
|
video_url = self._html_search_regex(
|
||||||
|
r'flashvars\.video_url\s*=\s*(["\'])(?P<url>http.+?)\1',
|
||||||
|
webpage, 'video url', default=None, group='url')
|
||||||
|
if video_url:
|
||||||
|
extract_format(compat_urllib_parse_unquote(video_url))
|
||||||
|
|
||||||
|
if not formats:
|
||||||
|
if 'title="This video is no longer available"' in webpage:
|
||||||
|
raise ExtractorError(
|
||||||
|
'Video %s is no longer available' % video_id, expected=True)
|
||||||
|
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
|
if not title:
|
||||||
|
title = self._html_search_regex([
|
||||||
|
r'<h1[^>]*>([^<]+)'
|
||||||
|
r'videoTitle\s*=\s*"([^"]+)'], webpage, 'title', default=display_id.capitalize())
|
||||||
|
|
||||||
like_count = int_or_none(self._search_regex(
|
like_count = int_or_none(self._search_regex(
|
||||||
r'rupVar\s*=\s*"(\d+)"', webpage, 'like count', fatal=False))
|
r'rupVar\s*=\s*(\d+);', webpage, 'like count', fatal=False))
|
||||||
dislike_count = int_or_none(self._search_regex(
|
dislike_count = int_or_none(self._search_regex(
|
||||||
r'rdownVar\s*=\s*"(\d+)"', webpage, 'dislike count', fatal=False))
|
r'rdownVar\s*=\s*(\d+);', webpage, 'dislike count', fatal=False))
|
||||||
view_count = str_to_int(self._search_regex(
|
view_count = str_to_int(self._search_regex(
|
||||||
r'Views:\s*</dt>\s*<dd>([\d,\.]+)',
|
r'Views:\s*</dt>\s*<dd>([\d,\.]+)',
|
||||||
webpage, 'view count', fatal=False))
|
webpage, 'view count', fatal=False))
|
||||||
comment_count = str_to_int(self._search_regex(
|
comment_count = str_to_int(self._search_regex(
|
||||||
r'<span id="allCommentsCount">(\d+)</span>',
|
r'<span id="allCommentsCount">\((\d+)\)</span>',
|
||||||
webpage, 'comment count', fatal=False))
|
webpage, 'comment count', fatal=False))
|
||||||
|
|
||||||
category = self._search_regex(
|
category = self._search_regex(
|
||||||
r'Category:\s*</dt>\s*<dd>\s*<a[^>]+href=[^>]+>([^<]+)',
|
r'videoCategoryByName\s*=\s*"([^"]+)";',
|
||||||
webpage, 'category', fatal=False)
|
webpage, 'category', fatal=False)
|
||||||
categories = [category] if category else None
|
categories = [category] if category else None
|
||||||
|
|
||||||
tags_str = self._search_regex(
|
tags_str = self._search_regex(
|
||||||
r'(?s)Tags:\s*</dt>\s*<dd>(.+?)</(?!a)',
|
r"(?s)<li\s+class\s*=\s*'video-tag'\s+data-esp-node\s*=\s*'tag'>(.*?)</div>",
|
||||||
webpage, 'tags', fatal=False)
|
webpage, 'tags', fatal=False)
|
||||||
tags = [t for t in re.findall(
|
tags = [t for t in re.findall(
|
||||||
r'<a[^>]+href=[^>]+>([^<]+)', tags_str)] if tags_str else None
|
r'<a[^>]+href=[^>]+>([^<]+)', tags_str)] if tags_str else None
|
||||||
|
|
||||||
info.update({
|
return {
|
||||||
'description': description,
|
|
||||||
'uploader': uploader,
|
'uploader': uploader,
|
||||||
|
'id': video_id,
|
||||||
|
'display_id': display_id,
|
||||||
|
'title': title,
|
||||||
|
'thumbnail': thumbnail,
|
||||||
|
'duration': duration,
|
||||||
|
'age_limit': 18,
|
||||||
|
'formats': formats,
|
||||||
'view_count': view_count,
|
'view_count': view_count,
|
||||||
'like_count': like_count,
|
'like_count': like_count,
|
||||||
'dislike_count': dislike_count,
|
'dislike_count': dislike_count,
|
||||||
'comment_count': comment_count,
|
'comment_count': comment_count,
|
||||||
'categories': categories,
|
'categories': categories,
|
||||||
'tags': tags,
|
'tags': tags,
|
||||||
})
|
}
|
||||||
|
|
||||||
return info
|
|
||||||
|
@ -686,6 +686,8 @@ class JSInterpreter(object):
|
|||||||
raise self.Exception('Cannot get index {idx!r:.100}'.format(**locals()), expr=repr(obj), cause=e)
|
raise self.Exception('Cannot get index {idx!r:.100}'.format(**locals()), expr=repr(obj), cause=e)
|
||||||
|
|
||||||
def _dump(self, obj, namespace):
|
def _dump(self, obj, namespace):
|
||||||
|
if obj is JS_Undefined:
|
||||||
|
return 'undefined'
|
||||||
try:
|
try:
|
||||||
return json.dumps(obj)
|
return json.dumps(obj)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user