Compare commits
20 Commits
2014.04.04
...
2014.04.04
Author | SHA1 | Date | |
---|---|---|---|
|
98b7cf1ace | ||
|
c465afd736 | ||
|
b84d6e7fc4 | ||
|
2efd5d78c1 | ||
|
c8edf47b3a | ||
|
3b4c26a428 | ||
|
1525148114 | ||
|
9e0c5791c1 | ||
|
29a1ab2afc | ||
|
fa387d2d99 | ||
|
6d0d573eca | ||
|
bb799e811b | ||
|
04ee53eca1 | ||
|
659eb98a53 | ||
|
43df5a7e71 | ||
|
88f1c6de7b | ||
|
65a40ab82b | ||
|
4b9cced103 | ||
|
6344fa04bb | ||
|
e3ced9ed61 |
@@ -157,5 +157,11 @@ class TestAllURLsMatching(unittest.TestCase):
|
|||||||
'http://thedailyshow.cc.com/guests/michael-lewis/3efna8/exclusive---michael-lewis-extended-interview-pt--3',
|
'http://thedailyshow.cc.com/guests/michael-lewis/3efna8/exclusive---michael-lewis-extended-interview-pt--3',
|
||||||
['ComedyCentralShows'])
|
['ComedyCentralShows'])
|
||||||
|
|
||||||
|
def test_yahoo_https(self):
|
||||||
|
# https://github.com/rg3/youtube-dl/issues/2701
|
||||||
|
self.assertMatch(
|
||||||
|
'https://screen.yahoo.com/smartwatches-latest-wearable-gadgets-163745379-cbs.html',
|
||||||
|
['Yahoo'])
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
@@ -242,7 +242,7 @@ def parseOpts(overrideArguments=None):
|
|||||||
help='Use the specified HTTP/HTTPS proxy. Pass in an empty string (--proxy "") for direct connection')
|
help='Use the specified HTTP/HTTPS proxy. Pass in an empty string (--proxy "") for direct connection')
|
||||||
general.add_option('--no-check-certificate', action='store_true', dest='no_check_certificate', default=False, help='Suppress HTTPS certificate validation.')
|
general.add_option('--no-check-certificate', action='store_true', dest='no_check_certificate', default=False, help='Suppress HTTPS certificate validation.')
|
||||||
general.add_option(
|
general.add_option(
|
||||||
'--prefer-insecure', action='store_true', dest='prefer_insecure',
|
'--prefer-insecure', '--prefer-unsecure', action='store_true', dest='prefer_insecure',
|
||||||
help='Use an unencrypted connection to retrieve information about the video. (Currently supported only for YouTube)')
|
help='Use an unencrypted connection to retrieve information about the video. (Currently supported only for YouTube)')
|
||||||
general.add_option(
|
general.add_option(
|
||||||
'--cache-dir', dest='cachedir', default=get_cachedir(), metavar='DIR',
|
'--cache-dir', dest='cachedir', default=get_cachedir(), metavar='DIR',
|
||||||
|
@@ -4,9 +4,10 @@ import sys
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
|
compat_str,
|
||||||
encodeFilename,
|
encodeFilename,
|
||||||
timeconvert,
|
|
||||||
format_bytes,
|
format_bytes,
|
||||||
|
timeconvert,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -173,7 +174,7 @@ class FileDownloader(object):
|
|||||||
return
|
return
|
||||||
os.rename(encodeFilename(old_filename), encodeFilename(new_filename))
|
os.rename(encodeFilename(old_filename), encodeFilename(new_filename))
|
||||||
except (IOError, OSError) as err:
|
except (IOError, OSError) as err:
|
||||||
self.report_error(u'unable to rename file: %s' % str(err))
|
self.report_error(u'unable to rename file: %s' % compat_str(err))
|
||||||
|
|
||||||
def try_utime(self, filename, last_modified_hdr):
|
def try_utime(self, filename, last_modified_hdr):
|
||||||
"""Try to set the last-modified time of the given file."""
|
"""Try to set the last-modified time of the given file."""
|
||||||
|
@@ -27,9 +27,10 @@ class BreakIE(InfoExtractor):
|
|||||||
webpage, 'info json', flags=re.DOTALL)
|
webpage, 'info json', flags=re.DOTALL)
|
||||||
info = json.loads(info_json)
|
info = json.loads(info_json)
|
||||||
video_url = info['videoUri']
|
video_url = info['videoUri']
|
||||||
m_youtube = re.search(r'(https?://www\.youtube\.com/watch\?v=.*)', video_url)
|
youtube_id = info.get('youtubeId')
|
||||||
if m_youtube is not None:
|
if youtube_id:
|
||||||
return self.url_result(m_youtube.group(1), 'Youtube')
|
return self.url_result(youtube_id, 'Youtube')
|
||||||
|
|
||||||
final_url = video_url + '?' + info['AuthToken']
|
final_url = video_url + '?' + info['AuthToken']
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
@@ -8,7 +8,6 @@ from .subtitles import SubtitlesInfoExtractor
|
|||||||
from ..utils import (
|
from ..utils import (
|
||||||
compat_urllib_request,
|
compat_urllib_request,
|
||||||
compat_str,
|
compat_str,
|
||||||
get_element_by_attribute,
|
|
||||||
get_element_by_id,
|
get_element_by_id,
|
||||||
orderedSet,
|
orderedSet,
|
||||||
str_to_int,
|
str_to_int,
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@@ -11,22 +13,22 @@ from ..aes import (
|
|||||||
aes_decrypt_text
|
aes_decrypt_text
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class KeezMoviesIE(InfoExtractor):
|
class KeezMoviesIE(InfoExtractor):
|
||||||
_VALID_URL = r'^(?:https?://)?(?:www\.)?(?P<url>keezmovies\.com/video/.+?(?P<videoid>[0-9]+))(?:[/?&]|$)'
|
_VALID_URL = r'^https?://(?:www\.)?keezmovies\.com/video/.+?(?P<videoid>[0-9]+)(?:[/?&]|$)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
u'url': u'http://www.keezmovies.com/video/petite-asian-lady-mai-playing-in-bathtub-1214711',
|
'url': 'http://www.keezmovies.com/video/petite-asian-lady-mai-playing-in-bathtub-1214711',
|
||||||
u'file': u'1214711.mp4',
|
'file': '1214711.mp4',
|
||||||
u'md5': u'6e297b7e789329923fcf83abb67c9289',
|
'md5': '6e297b7e789329923fcf83abb67c9289',
|
||||||
u'info_dict': {
|
'info_dict': {
|
||||||
u"title": u"Petite Asian Lady Mai Playing In Bathtub",
|
'title': 'Petite Asian Lady Mai Playing In Bathtub',
|
||||||
u"age_limit": 18,
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
video_id = mobj.group('videoid')
|
video_id = mobj.group('videoid')
|
||||||
url = 'http://www.' + mobj.group('url')
|
|
||||||
|
|
||||||
req = compat_urllib_request.Request(url)
|
req = compat_urllib_request.Request(url)
|
||||||
req.add_header('Cookie', 'age_verified=1')
|
req.add_header('Cookie', 'age_verified=1')
|
||||||
@@ -38,10 +40,10 @@ class KeezMoviesIE(InfoExtractor):
|
|||||||
embedded_url = mobj.group(1)
|
embedded_url = mobj.group(1)
|
||||||
return self.url_result(embedded_url)
|
return self.url_result(embedded_url)
|
||||||
|
|
||||||
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'video_url=(.+?)&', webpage, u'video_url'))
|
video_url = compat_urllib_parse.unquote(self._html_search_regex(r'video_url=(.+?)&', webpage, 'video_url'))
|
||||||
if webpage.find('encrypted=true')!=-1:
|
if 'encrypted=true' in webpage:
|
||||||
password = self._html_search_regex(r'video_title=(.+?)&', webpage, u'password')
|
password = self._html_search_regex(r'video_title=(.+?)&', webpage, 'password')
|
||||||
video_url = aes_decrypt_text(video_url, password, 32).decode('utf-8')
|
video_url = aes_decrypt_text(video_url, password, 32).decode('utf-8')
|
||||||
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:]
|
||||||
|
@@ -1,17 +1,9 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import hashlib
|
|
||||||
import json
|
|
||||||
import re
|
import re
|
||||||
import time
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import (
|
|
||||||
compat_parse_qs,
|
|
||||||
compat_str,
|
|
||||||
int_or_none,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class MorningstarIE(InfoExtractor):
|
class MorningstarIE(InfoExtractor):
|
||||||
|
@@ -1,44 +1,81 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import json
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import compat_urllib_parse
|
from ..utils import int_or_none
|
||||||
|
|
||||||
|
|
||||||
class PornHdIE(InfoExtractor):
|
class PornHdIE(InfoExtractor):
|
||||||
_VALID_URL = r'(?:http://)?(?:www\.)?pornhd\.com/(?:[a-z]{2,4}/)?videos/(?P<video_id>[0-9]+)/(?P<video_title>.+)'
|
_VALID_URL = r'http://(?:www\.)?pornhd\.com/(?:[a-z]{2,4}/)?videos/(?P<id>\d+)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://www.pornhd.com/videos/1962/sierra-day-gets-his-cum-all-over-herself-hd-porn-video',
|
'url': 'http://www.pornhd.com/videos/1962/sierra-day-gets-his-cum-all-over-herself-hd-porn-video',
|
||||||
'file': '1962.flv',
|
'md5': '956b8ca569f7f4d8ec563e2c41598441',
|
||||||
'md5': '35272469887dca97abd30abecc6cdf75',
|
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
"title": "sierra-day-gets-his-cum-all-over-herself-hd-porn-video",
|
'id': '1962',
|
||||||
"age_limit": 18,
|
'ext': 'mp4',
|
||||||
|
'title': 'Sierra loves doing laundry',
|
||||||
|
'description': 'md5:8ff0523848ac2b8f9b065ba781ccf294',
|
||||||
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
video_id = mobj.group('id')
|
||||||
video_id = mobj.group('video_id')
|
|
||||||
video_title = mobj.group('video_title')
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
next_url = self._html_search_regex(
|
title = self._og_search_title(webpage)
|
||||||
r'&hd=(http.+?)&', webpage, 'video URL')
|
TITLE_SUFFIX = ' porn HD Video | PornHD.com '
|
||||||
next_url = compat_urllib_parse.unquote(next_url)
|
if title.endswith(TITLE_SUFFIX):
|
||||||
|
title = title[:-len(TITLE_SUFFIX)]
|
||||||
|
|
||||||
video_url = self._download_webpage(
|
description = self._html_search_regex(
|
||||||
next_url, video_id, note='Retrieving video URL',
|
r'<div class="description">([^<]+)</div>', webpage, 'description', fatal=False)
|
||||||
errnote='Could not retrieve video URL')
|
view_count = int_or_none(self._html_search_regex(
|
||||||
age_limit = 18
|
r'(\d+) views </span>', webpage, 'view count', fatal=False))
|
||||||
|
|
||||||
|
formats = [
|
||||||
|
{
|
||||||
|
'url': format_url,
|
||||||
|
'ext': format.lower(),
|
||||||
|
'format_id': '%s-%s' % (format.lower(), quality.lower()),
|
||||||
|
'quality': 1 if quality.lower() == 'high' else 0,
|
||||||
|
} for format, quality, format_url in re.findall(
|
||||||
|
r'var __video([\da-zA-Z]+?)(Low|High)StreamUrl = \'(http://.+?)\?noProxy=1\'', webpage)
|
||||||
|
]
|
||||||
|
|
||||||
|
mobj = re.search(r'flashVars = (?P<flashvars>{.+?});', webpage)
|
||||||
|
if mobj:
|
||||||
|
flashvars = json.loads(mobj.group('flashvars'))
|
||||||
|
formats.extend([
|
||||||
|
{
|
||||||
|
'url': flashvars['hashlink'].replace('?noProxy=1', ''),
|
||||||
|
'ext': 'flv',
|
||||||
|
'format_id': 'flv-low',
|
||||||
|
'quality': 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url': flashvars['hd'].replace('?noProxy=1', ''),
|
||||||
|
'ext': 'flv',
|
||||||
|
'format_id': 'flv-high',
|
||||||
|
'quality': 1,
|
||||||
|
}
|
||||||
|
])
|
||||||
|
thumbnail = flashvars['urlWallpaper']
|
||||||
|
else:
|
||||||
|
thumbnail = self._og_search_thumbnail(webpage)
|
||||||
|
|
||||||
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'url': video_url,
|
'title': title,
|
||||||
'ext': 'flv',
|
'description': description,
|
||||||
'title': video_title,
|
'thumbnail': thumbnail,
|
||||||
'age_limit': age_limit,
|
'view_count': view_count,
|
||||||
|
'formats': formats,
|
||||||
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
|
@@ -9,46 +9,133 @@ from ..utils import (
|
|||||||
parse_duration,
|
parse_duration,
|
||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
unescapeHTML,
|
unescapeHTML,
|
||||||
|
compat_str,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class RTSIE(InfoExtractor):
|
class RTSIE(InfoExtractor):
|
||||||
IE_DESC = 'RTS.ch'
|
IE_DESC = 'RTS.ch'
|
||||||
_VALID_URL = r'^https?://(?:www\.)?rts\.ch/archives/tv/[^/]+/(?P<id>[0-9]+)-.*?\.html'
|
_VALID_URL = r'^https?://(?:www\.)?rts\.ch/(?:[^/]+/){2,}(?P<id>[0-9]+)-.*?\.html'
|
||||||
|
|
||||||
_TEST = {
|
_TESTS = [
|
||||||
'url': 'http://www.rts.ch/archives/tv/divers/3449373-les-enfants-terribles.html',
|
{
|
||||||
'md5': '753b877968ad8afaeddccc374d4256a5',
|
'url': 'http://www.rts.ch/archives/tv/divers/3449373-les-enfants-terribles.html',
|
||||||
'info_dict': {
|
'md5': '753b877968ad8afaeddccc374d4256a5',
|
||||||
'id': '3449373',
|
'info_dict': {
|
||||||
'ext': 'mp4',
|
'id': '3449373',
|
||||||
'duration': 1488,
|
'ext': 'mp4',
|
||||||
'title': 'Les Enfants Terribles',
|
'duration': 1488,
|
||||||
'description': 'France Pommier et sa soeur Luce Feral, les deux filles de ce groupe de 5.',
|
'title': 'Les Enfants Terribles',
|
||||||
'uploader': 'Divers',
|
'description': 'France Pommier et sa soeur Luce Feral, les deux filles de ce groupe de 5.',
|
||||||
'upload_date': '19680921',
|
'uploader': 'Divers',
|
||||||
'timestamp': -40280400,
|
'upload_date': '19680921',
|
||||||
'thumbnail': 're:^https?://.*\.image'
|
'timestamp': -40280400,
|
||||||
|
'thumbnail': 're:^https?://.*\.image'
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
{
|
||||||
|
'url': 'http://www.rts.ch/emissions/passe-moi-les-jumelles/5624067-entre-ciel-et-mer.html',
|
||||||
|
'md5': 'c197f0b2421995c63a64cc73d800f42e',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '5738317',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'duration': 55,
|
||||||
|
'title': 'Bande de lancement de Passe-moi les jumelles',
|
||||||
|
'description': '',
|
||||||
|
'uploader': 'Passe-moi les jumelles',
|
||||||
|
'upload_date': '20140404',
|
||||||
|
'timestamp': 1396635300,
|
||||||
|
'thumbnail': 're:^https?://.*\.image'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url': 'http://www.rts.ch/video/sport/hockey/5745975-1-2-kloten-fribourg-5-2-second-but-pour-gotteron-par-kwiatowski.html',
|
||||||
|
'md5': 'b4326fecd3eb64a458ba73c73e91299d',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '5745975',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'duration': 48,
|
||||||
|
'title': '1/2, Kloten - Fribourg (5-2): second but pour Gottéron par Kwiatowski',
|
||||||
|
'description': 'Hockey - Playoff',
|
||||||
|
'uploader': 'Hockey',
|
||||||
|
'upload_date': '20140403',
|
||||||
|
'timestamp': 1396556882,
|
||||||
|
'thumbnail': 're:^https?://.*\.image'
|
||||||
|
},
|
||||||
|
'skip': 'Blocked outside Switzerland',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url': 'http://www.rts.ch/video/info/journal-continu/5745356-londres-cachee-par-un-epais-smog.html',
|
||||||
|
'md5': '9bb06503773c07ce83d3cbd793cebb91',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '5745356',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'duration': 33,
|
||||||
|
'title': 'Londres cachée par un épais smog',
|
||||||
|
'description': 'Un important voile de smog recouvre Londres depuis mercredi, provoqué par la pollution et du sable du Sahara.',
|
||||||
|
'uploader': 'Le Journal en continu',
|
||||||
|
'upload_date': '20140403',
|
||||||
|
'timestamp': 1396537322,
|
||||||
|
'thumbnail': 're:^https?://.*\.image'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url': 'http://www.rts.ch/audio/couleur3/programmes/la-belle-video-de-stephane-laurenceau/5706148-urban-hippie-de-damien-krisl-03-04-2014.html',
|
||||||
|
'md5': 'dd8ef6a22dff163d063e2a52bc8adcae',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '5706148',
|
||||||
|
'ext': 'mp3',
|
||||||
|
'duration': 123,
|
||||||
|
'title': '"Urban Hippie", de Damien Krisl',
|
||||||
|
'description': 'Des Hippies super glam.',
|
||||||
|
'upload_date': '20140403',
|
||||||
|
'timestamp': 1396551600,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
m = re.match(self._VALID_URL, url)
|
m = re.match(self._VALID_URL, url)
|
||||||
video_id = m.group('id')
|
video_id = m.group('id')
|
||||||
|
|
||||||
all_info = self._download_json(
|
def download_json(video_id):
|
||||||
'http://www.rts.ch/a/%s.html?f=json/article' % video_id, video_id)
|
return self._download_json(
|
||||||
info = all_info['video']['JSONinfo']
|
'http://www.rts.ch/a/%s.html?f=json/article' % video_id, video_id)
|
||||||
|
|
||||||
|
all_info = download_json(video_id)
|
||||||
|
|
||||||
|
# video_id extracted out of URL is not always a real id
|
||||||
|
if 'video' not in all_info and 'audio' not in all_info:
|
||||||
|
page = self._download_webpage(url, video_id)
|
||||||
|
video_id = self._html_search_regex(r'<(?:video|audio) data-id="(\d+)"', page, 'video id')
|
||||||
|
all_info = download_json(video_id)
|
||||||
|
|
||||||
|
info = all_info['video']['JSONinfo'] if 'video' in all_info else all_info['audio']
|
||||||
|
|
||||||
upload_timestamp = parse_iso8601(info.get('broadcast_date'))
|
upload_timestamp = parse_iso8601(info.get('broadcast_date'))
|
||||||
duration = parse_duration(info.get('duration'))
|
duration = info.get('duration') or info.get('cutout') or info.get('cutduration')
|
||||||
|
if isinstance(duration, compat_str):
|
||||||
|
duration = parse_duration(duration)
|
||||||
|
view_count = info.get('plays')
|
||||||
thumbnail = unescapeHTML(info.get('preview_image_url'))
|
thumbnail = unescapeHTML(info.get('preview_image_url'))
|
||||||
|
|
||||||
|
def extract_bitrate(url):
|
||||||
|
return int_or_none(self._search_regex(
|
||||||
|
r'-([0-9]+)k\.', url, 'bitrate', default=None))
|
||||||
|
|
||||||
formats = [{
|
formats = [{
|
||||||
'format_id': fid,
|
'format_id': fid,
|
||||||
'url': furl,
|
'url': furl,
|
||||||
'tbr': int_or_none(self._search_regex(
|
'tbr': extract_bitrate(furl),
|
||||||
r'-([0-9]+)k\.', furl, 'bitrate', default=None)),
|
|
||||||
} for fid, furl in info['streams'].items()]
|
} for fid, furl in info['streams'].items()]
|
||||||
|
|
||||||
|
if 'media' in info:
|
||||||
|
formats.extend([{
|
||||||
|
'format_id': '%s-%sk' % (media['ext'], media['rate']),
|
||||||
|
'url': 'http://download-video.rts.ch/%s' % media['url'],
|
||||||
|
'tbr': media['rate'] or extract_bitrate(media['url']),
|
||||||
|
} for media in info['media'] if media.get('rate')])
|
||||||
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -57,6 +144,7 @@ class RTSIE(InfoExtractor):
|
|||||||
'title': info['title'],
|
'title': info['title'],
|
||||||
'description': info.get('intro'),
|
'description': info.get('intro'),
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
|
'view_count': view_count,
|
||||||
'uploader': info.get('programName'),
|
'uploader': info.get('programName'),
|
||||||
'timestamp': upload_timestamp,
|
'timestamp': upload_timestamp,
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
|
@@ -9,8 +9,18 @@ from ..utils import (
|
|||||||
|
|
||||||
|
|
||||||
class TeamcocoIE(InfoExtractor):
|
class TeamcocoIE(InfoExtractor):
|
||||||
_VALID_URL = r'http://teamcoco\.com/video/(?P<url_title>.*)'
|
_VALID_URL = r'http://teamcoco\.com/video/(?P<video_id>[0-9]+)?/?(?P<url_title>.*)'
|
||||||
_TEST = {
|
_TESTS = [
|
||||||
|
{
|
||||||
|
'url': 'http://teamcoco.com/video/80187/conan-becomes-a-mary-kay-beauty-consultant',
|
||||||
|
'file': '80187.mp4',
|
||||||
|
'md5': '3f7746aa0dc86de18df7539903d399ea',
|
||||||
|
'info_dict': {
|
||||||
|
'title': 'Conan Becomes A Mary Kay Beauty Consultant',
|
||||||
|
'description': 'Mary Kay is perhaps the most trusted name in female beauty, so of course Conan is a natural choice to sell their products.'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
'url': 'http://teamcoco.com/video/louis-ck-interview-george-w-bush',
|
'url': 'http://teamcoco.com/video/louis-ck-interview-george-w-bush',
|
||||||
'file': '19705.mp4',
|
'file': '19705.mp4',
|
||||||
'md5': 'cde9ba0fa3506f5f017ce11ead928f9a',
|
'md5': 'cde9ba0fa3506f5f017ce11ead928f9a',
|
||||||
@@ -19,6 +29,7 @@ class TeamcocoIE(InfoExtractor):
|
|||||||
"title": "Louis C.K. Interview Pt. 1 11/3/11"
|
"title": "Louis C.K. Interview Pt. 1 11/3/11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
mobj = re.match(self._VALID_URL, url)
|
||||||
@@ -26,11 +37,13 @@ class TeamcocoIE(InfoExtractor):
|
|||||||
raise ExtractorError('Invalid URL: %s' % url)
|
raise ExtractorError('Invalid URL: %s' % url)
|
||||||
url_title = mobj.group('url_title')
|
url_title = mobj.group('url_title')
|
||||||
webpage = self._download_webpage(url, url_title)
|
webpage = self._download_webpage(url, url_title)
|
||||||
|
|
||||||
video_id = self._html_search_regex(
|
video_id = mobj.group("video_id")
|
||||||
r'<article class="video" data-id="(\d+?)"',
|
if video_id == '':
|
||||||
webpage, 'video id')
|
video_id = self._html_search_regex(
|
||||||
|
r'<article class="video" data-id="(\d+?)"',
|
||||||
|
webpage, 'video id')
|
||||||
|
|
||||||
self.report_extraction(video_id)
|
self.report_extraction(video_id)
|
||||||
|
|
||||||
data_url = 'http://teamcoco.com/cvp/2.0/%s.xml' % video_id
|
data_url = 'http://teamcoco.com/cvp/2.0/%s.xml' % video_id
|
||||||
|
@@ -15,22 +15,24 @@ from ..utils import (
|
|||||||
|
|
||||||
class YahooIE(InfoExtractor):
|
class YahooIE(InfoExtractor):
|
||||||
IE_DESC = 'Yahoo screen'
|
IE_DESC = 'Yahoo screen'
|
||||||
_VALID_URL = r'http://screen\.yahoo\.com/.*?-(?P<id>\d*?)\.html'
|
_VALID_URL = r'https?://screen\.yahoo\.com/.*?-(?P<id>[0-9]+)(?:-[a-z]+)?\.html'
|
||||||
_TESTS = [
|
_TESTS = [
|
||||||
{
|
{
|
||||||
'url': 'http://screen.yahoo.com/julian-smith-travis-legg-watch-214727115.html',
|
'url': 'http://screen.yahoo.com/julian-smith-travis-legg-watch-214727115.html',
|
||||||
'file': '214727115.mp4',
|
|
||||||
'md5': '4962b075c08be8690a922ee026d05e69',
|
'md5': '4962b075c08be8690a922ee026d05e69',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
|
'id': '214727115',
|
||||||
|
'ext': 'mp4',
|
||||||
'title': 'Julian Smith & Travis Legg Watch Julian Smith',
|
'title': 'Julian Smith & Travis Legg Watch Julian Smith',
|
||||||
'description': 'Julian and Travis watch Julian Smith',
|
'description': 'Julian and Travis watch Julian Smith',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'url': 'http://screen.yahoo.com/wired/codefellas-s1-ep12-cougar-lies-103000935.html',
|
'url': 'http://screen.yahoo.com/wired/codefellas-s1-ep12-cougar-lies-103000935.html',
|
||||||
'file': '103000935.mp4',
|
|
||||||
'md5': 'd6e6fc6e1313c608f316ddad7b82b306',
|
'md5': 'd6e6fc6e1313c608f316ddad7b82b306',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
|
'id': '103000935',
|
||||||
|
'ext': 'mp4',
|
||||||
'title': 'Codefellas - The Cougar Lies with Spanish Moss',
|
'title': 'Codefellas - The Cougar Lies with Spanish Moss',
|
||||||
'description': 'Agent Topple\'s mustache does its dirty work, and Nicole brokers a deal for peace. But why is the NSA collecting millions of Instagram brunch photos? And if your waffles have nothing to hide, what are they so worried about?',
|
'description': 'Agent Topple\'s mustache does its dirty work, and Nicole brokers a deal for peace. But why is the NSA collecting millions of Instagram brunch photos? And if your waffles have nothing to hide, what are they so worried about?',
|
||||||
},
|
},
|
||||||
@@ -60,10 +62,9 @@ class YahooIE(InfoExtractor):
|
|||||||
'env': 'prod',
|
'env': 'prod',
|
||||||
'format': 'json',
|
'format': 'json',
|
||||||
})
|
})
|
||||||
query_result_json = self._download_webpage(
|
query_result = self._download_json(
|
||||||
'http://video.query.yahoo.com/v1/public/yql?' + data,
|
'http://video.query.yahoo.com/v1/public/yql?' + data,
|
||||||
video_id, 'Downloading video info')
|
video_id, 'Downloading video info')
|
||||||
query_result = json.loads(query_result_json)
|
|
||||||
info = query_result['query']['results']['mediaObj'][0]
|
info = query_result['query']['results']['mediaObj'][0]
|
||||||
meta = info['meta']
|
meta = info['meta']
|
||||||
|
|
||||||
@@ -86,7 +87,6 @@ class YahooIE(InfoExtractor):
|
|||||||
else:
|
else:
|
||||||
format_url = compat_urlparse.urljoin(host, path)
|
format_url = compat_urlparse.urljoin(host, path)
|
||||||
format_info['url'] = format_url
|
format_info['url'] = format_url
|
||||||
|
|
||||||
formats.append(format_info)
|
formats.append(format_info)
|
||||||
|
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
@@ -134,27 +134,25 @@ class YahooSearchIE(SearchInfoExtractor):
|
|||||||
|
|
||||||
def _get_n_results(self, query, n):
|
def _get_n_results(self, query, n):
|
||||||
"""Get a specified number of results for a query"""
|
"""Get a specified number of results for a query"""
|
||||||
|
entries = []
|
||||||
res = {
|
for pagenum in itertools.count(0):
|
||||||
'_type': 'playlist',
|
|
||||||
'id': query,
|
|
||||||
'entries': []
|
|
||||||
}
|
|
||||||
for pagenum in itertools.count(0):
|
|
||||||
result_url = 'http://video.search.yahoo.com/search/?p=%s&fr=screen&o=js&gs=0&b=%d' % (compat_urllib_parse.quote_plus(query), pagenum * 30)
|
result_url = 'http://video.search.yahoo.com/search/?p=%s&fr=screen&o=js&gs=0&b=%d' % (compat_urllib_parse.quote_plus(query), pagenum * 30)
|
||||||
webpage = self._download_webpage(result_url, query,
|
info = self._download_json(result_url, query,
|
||||||
note='Downloading results page '+str(pagenum+1))
|
note='Downloading results page '+str(pagenum+1))
|
||||||
info = json.loads(webpage)
|
|
||||||
m = info['m']
|
m = info['m']
|
||||||
results = info['results']
|
results = info['results']
|
||||||
|
|
||||||
for (i, r) in enumerate(results):
|
for (i, r) in enumerate(results):
|
||||||
if (pagenum * 30) +i >= n:
|
if (pagenum * 30) + i >= n:
|
||||||
break
|
break
|
||||||
mobj = re.search(r'(?P<url>screen\.yahoo\.com/.*?-\d*?\.html)"', r)
|
mobj = re.search(r'(?P<url>screen\.yahoo\.com/.*?-\d*?\.html)"', r)
|
||||||
e = self.url_result('http://' + mobj.group('url'), 'Yahoo')
|
e = self.url_result('http://' + mobj.group('url'), 'Yahoo')
|
||||||
res['entries'].append(e)
|
entries.append(e)
|
||||||
if (pagenum * 30 +i >= n) or (m['last'] >= (m['total'] -1)):
|
if (pagenum * 30 + i >= n) or (m['last'] >= (m['total'] - 1)):
|
||||||
break
|
break
|
||||||
|
|
||||||
return res
|
return {
|
||||||
|
'_type': 'playlist',
|
||||||
|
'id': query,
|
||||||
|
'entries': entries,
|
||||||
|
}
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
|
|
||||||
__version__ = '2014.04.04.2'
|
__version__ = '2014.04.04.6'
|
||||||
|
Reference in New Issue
Block a user