Compare commits
3 Commits
2014.08.26
...
2014.08.27
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f514a353e | ||
|
|
da9ec3b932 | ||
|
|
191b7cbba9 |
@@ -209,6 +209,7 @@ from .mtv import (
|
|||||||
MTVIggyIE,
|
MTVIggyIE,
|
||||||
)
|
)
|
||||||
from .musicplayon import MusicPlayOnIE
|
from .musicplayon import MusicPlayOnIE
|
||||||
|
from .musicvault import MusicVaultIE
|
||||||
from .muzu import MuzuTVIE
|
from .muzu import MuzuTVIE
|
||||||
from .myspace import MySpaceIE
|
from .myspace import MySpaceIE
|
||||||
from .myspass import MySpassIE
|
from .myspass import MySpassIE
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ class InfoExtractor(object):
|
|||||||
upload_date: Video upload date (YYYYMMDD).
|
upload_date: Video upload date (YYYYMMDD).
|
||||||
If not explicitly set, calculated from timestamp.
|
If not explicitly set, calculated from timestamp.
|
||||||
uploader_id: Nickname or id of the video uploader.
|
uploader_id: Nickname or id of the video uploader.
|
||||||
location: Physical location of the video.
|
location: Physical location where the video was filmed.
|
||||||
subtitles: The subtitle file contents as a dictionary in the format
|
subtitles: The subtitle file contents as a dictionary in the format
|
||||||
{language: subtitles}.
|
{language: subtitles}.
|
||||||
duration: Length of the video in seconds, as an integer.
|
duration: Length of the video in seconds, as an integer.
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@@ -8,15 +10,17 @@ from ..utils import (
|
|||||||
compat_urllib_parse,
|
compat_urllib_parse,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class MofosexIE(InfoExtractor):
|
class MofosexIE(InfoExtractor):
|
||||||
_VALID_URL = r'^(?:https?://)?(?:www\.)?(?P<url>mofosex\.com/videos/(?P<videoid>[0-9]+)/.*?\.html)'
|
_VALID_URL = r'^https?://(?:www\.)?(?P<url>mofosex\.com/videos/(?P<videoid>[0-9]+)/.*?\.html)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
u'url': u'http://www.mofosex.com/videos/5018/japanese-teen-music-video.html',
|
'url': 'http://www.mofosex.com/videos/5018/japanese-teen-music-video.html',
|
||||||
u'file': u'5018.mp4',
|
'md5': '1b2eb47ac33cc75d4a80e3026b613c5a',
|
||||||
u'md5': u'1b2eb47ac33cc75d4a80e3026b613c5a',
|
'info_dict': {
|
||||||
u'info_dict': {
|
'id': '5018',
|
||||||
u"title": u"Japanese Teen Music Video",
|
'ext': 'mp4',
|
||||||
u"age_limit": 18,
|
'title': 'Japanese Teen Music Video',
|
||||||
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,8 +33,8 @@ class MofosexIE(InfoExtractor):
|
|||||||
req.add_header('Cookie', 'age_verified=1')
|
req.add_header('Cookie', 'age_verified=1')
|
||||||
webpage = self._download_webpage(req, video_id)
|
webpage = self._download_webpage(req, video_id)
|
||||||
|
|
||||||
video_title = self._html_search_regex(r'<h1>(.+?)<', webpage, u'title')
|
video_title = self._html_search_regex(r'<h1>(.+?)<', webpage, 'title')
|
||||||
video_url = compat_urllib_parse.unquote(self._html_search_regex(r'flashvars.video_url = \'([^\']+)', webpage, u'video_url'))
|
video_url = compat_urllib_parse.unquote(self._html_search_regex(r'flashvars.video_url = \'([^\']+)', webpage, 'video_url'))
|
||||||
path = compat_urllib_parse_urlparse(video_url).path
|
path = compat_urllib_parse_urlparse(video_url).path
|
||||||
extension = os.path.splitext(path)[1][1:]
|
extension = os.path.splitext(path)[1][1:]
|
||||||
format = path.split('/')[5].split('_')[:2]
|
format = path.split('/')[5].split('_')[:2]
|
||||||
|
|||||||
78
youtube_dl/extractor/musicvault.py
Normal file
78
youtube_dl/extractor/musicvault.py
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import json
|
||||||
|
import re
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
strip_jsonp,
|
||||||
|
parse_duration,
|
||||||
|
unified_strdate,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class MusicVaultIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://www\.musicvault\.com/(?P<uploader_id>[^/?#]*)/video/(?P<display_id>[^/?#]*)_(?P<id>[0-9]+)\.html'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://www.musicvault.com/the-allman-brothers-band/video/straight-from-the-heart_1010863.html',
|
||||||
|
'md5': '2cdbb3ae75f7fb3519821507d2fb3c15',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '1010863',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'uploader_id': 'the-allman-brothers-band',
|
||||||
|
'title': 'Straight from the Heart',
|
||||||
|
'duration': 244,
|
||||||
|
'uploader': 'The Allman Brothers Band',
|
||||||
|
'thumbnail': 're:^https?://.*/thumbnail/.*',
|
||||||
|
'upload_date': '19811216',
|
||||||
|
'location': 'Capitol Theatre (Passaic, NJ)',
|
||||||
|
'description': 'Listen to The Allman Brothers Band perform Straight from the Heart at Capitol Theatre (Passaic, NJ) on Dec 16, 1981',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
display_id = mobj.group('display_id')
|
||||||
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
|
||||||
|
thumbnail = self._search_regex(
|
||||||
|
r'<meta itemprop="thumbnail" content="([^"]+)"',
|
||||||
|
webpage, 'thumbnail', fatal=False)
|
||||||
|
|
||||||
|
data_div = self._search_regex(
|
||||||
|
r'(?s)<div class="data">(.*?)</div>', webpage, 'data fields')
|
||||||
|
uploader = self._html_search_regex(
|
||||||
|
r'<h1.*?>(.*?)</h1>', data_div, 'uploader', fatal=False)
|
||||||
|
title = self._html_search_regex(
|
||||||
|
r'<h2.*?>(.*?)</h2>', data_div, 'title')
|
||||||
|
upload_date = unified_strdate(self._html_search_regex(
|
||||||
|
r'<h3.*?>(.*?)</h3>', data_div, 'uploader', fatal=False))
|
||||||
|
location = self._html_search_regex(
|
||||||
|
r'<h4.*?>(.*?)</h4>', data_div, 'location', fatal=False)
|
||||||
|
|
||||||
|
duration = parse_duration(self._html_search_meta('duration', webpage))
|
||||||
|
|
||||||
|
VIDEO_URL_TEMPLATE = 'http://cdnapi.kaltura.com/p/%(uid)s/sp/%(wid)s/playManifest/entryId/%(entry_id)s/format/url/protocol/http'
|
||||||
|
kaltura_id = self._search_regex(
|
||||||
|
r'<div id="video-detail-player" data-kaltura-id="([^"]+)"',
|
||||||
|
webpage, 'kaltura ID')
|
||||||
|
video_url = VIDEO_URL_TEMPLATE % {
|
||||||
|
'entry_id': kaltura_id,
|
||||||
|
'wid': self._search_regex(r'/wid/_([0-9]+)/', webpage, 'wid'),
|
||||||
|
'uid': self._search_regex(r'uiconf_id/([0-9]+)/', webpage, 'uid'),
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': mobj.group('id'),
|
||||||
|
'url': video_url,
|
||||||
|
'ext': 'mp4',
|
||||||
|
'display_id': display_id,
|
||||||
|
'uploader_id': mobj.group('uploader_id'),
|
||||||
|
'thumbnail': thumbnail,
|
||||||
|
'description': self._html_search_meta('description', webpage),
|
||||||
|
'upload_date': upload_date,
|
||||||
|
'location': location,
|
||||||
|
'title': title,
|
||||||
|
'uploader': uploader,
|
||||||
|
'duration': duration,
|
||||||
|
}
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
|
|
||||||
__version__ = '2014.08.26'
|
__version__ = '2014.08.27'
|
||||||
|
|||||||
Reference in New Issue
Block a user