Compare commits
16 Commits
2015.02.24
...
2015.02.26
Author | SHA1 | Date | |
---|---|---|---|
13cd97f3df | |||
183139340b | |||
1c69bca258 | |||
c10ea454dc | |||
13d8fbef30 | |||
37f885650c | |||
c8c34ccb20 | |||
e765ed3a9c | |||
59c7cbd482 | |||
41b264e77c | |||
df4bd0d53f | |||
4f3b21e1c7 | |||
54233c9080 | |||
db8e13ef71 | |||
5a42414b9c | |||
9c665ab72e |
@ -139,6 +139,8 @@ which means you can modify it, redistribute it or use it however you like.
|
|||||||
dislike_count <? 50 & description" .
|
dislike_count <? 50 & description" .
|
||||||
--no-playlist If the URL refers to a video and a
|
--no-playlist If the URL refers to a video and a
|
||||||
playlist, download only the video.
|
playlist, download only the video.
|
||||||
|
--yes-playlist If the URL refers to a video and a
|
||||||
|
playlist, download the playlist.
|
||||||
--age-limit YEARS download only videos suitable for the given
|
--age-limit YEARS download only videos suitable for the given
|
||||||
age
|
age
|
||||||
--download-archive FILE Download only videos not listed in the
|
--download-archive FILE Download only videos not listed in the
|
||||||
|
@ -85,6 +85,8 @@ class TestUtil(unittest.TestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
sanitize_filename('New World record at 0:12:34'),
|
sanitize_filename('New World record at 0:12:34'),
|
||||||
'New World record at 0_12_34')
|
'New World record at 0_12_34')
|
||||||
|
self.assertEqual(sanitize_filename('--gasdgf'), '_-gasdgf')
|
||||||
|
self.assertEqual(sanitize_filename('--gasdgf', is_id=True), '--gasdgf')
|
||||||
|
|
||||||
forbidden = '"\0\\/'
|
forbidden = '"\0\\/'
|
||||||
for fc in forbidden:
|
for fc in forbidden:
|
||||||
|
@ -35,10 +35,7 @@ class EpornerIE(InfoExtractor):
|
|||||||
title = self._html_search_regex(
|
title = self._html_search_regex(
|
||||||
r'<title>(.*?) - EPORNER', webpage, 'title')
|
r'<title>(.*?) - EPORNER', webpage, 'title')
|
||||||
|
|
||||||
redirect_code = self._html_search_regex(
|
redirect_url = 'http://www.eporner.com/config5/%s' % video_id
|
||||||
r'<script type="text/javascript" src="/config5/%s/([a-f\d]+)/">' % video_id,
|
|
||||||
webpage, 'redirect_code')
|
|
||||||
redirect_url = 'http://www.eporner.com/config5/%s/%s' % (video_id, redirect_code)
|
|
||||||
player_code = self._download_webpage(
|
player_code = self._download_webpage(
|
||||||
redirect_url, display_id, note='Downloading player config')
|
redirect_url, display_id, note='Downloading player config')
|
||||||
|
|
||||||
@ -69,5 +66,5 @@ class EpornerIE(InfoExtractor):
|
|||||||
'duration': duration,
|
'duration': duration,
|
||||||
'view_count': view_count,
|
'view_count': view_count,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'age_limit': self._rta_search(webpage),
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,14 @@ class EscapistIE(InfoExtractor):
|
|||||||
title = raw_title.partition(' : ')[2]
|
title = raw_title.partition(' : ')[2]
|
||||||
|
|
||||||
config_url = compat_urllib_parse.unquote(self._html_search_regex(
|
config_url = compat_urllib_parse.unquote(self._html_search_regex(
|
||||||
r'<param\s+name="flashvars"\s+value="config=([^"&]+)', webpage, 'config URL'))
|
r'''(?x)
|
||||||
|
(?:
|
||||||
|
<param\s+name="flashvars".*?\s+value="config=|
|
||||||
|
flashvars="config=
|
||||||
|
)
|
||||||
|
(https?://[^"&]+)
|
||||||
|
''',
|
||||||
|
webpage, 'config URL'))
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
|
|
||||||
|
@ -1208,7 +1208,9 @@ class GenericIE(InfoExtractor):
|
|||||||
return entries[0]
|
return entries[0]
|
||||||
else:
|
else:
|
||||||
for num, e in enumerate(entries, start=1):
|
for num, e in enumerate(entries, start=1):
|
||||||
e['title'] = '%s (%d)' % (e['title'], num)
|
# 'url' results don't have a title
|
||||||
|
if e.get('title') is not None:
|
||||||
|
e['title'] = '%s (%d)' % (e['title'], num)
|
||||||
return {
|
return {
|
||||||
'_type': 'playlist',
|
'_type': 'playlist',
|
||||||
'entries': entries,
|
'entries': entries,
|
||||||
|
@ -18,7 +18,7 @@ class MiTeleIE(InfoExtractor):
|
|||||||
IE_NAME = 'mitele.es'
|
IE_NAME = 'mitele.es'
|
||||||
_VALID_URL = r'http://www\.mitele\.es/[^/]+/[^/]+/[^/]+/(?P<id>[^/]+)/'
|
_VALID_URL = r'http://www\.mitele\.es/[^/]+/[^/]+/[^/]+/(?P<id>[^/]+)/'
|
||||||
|
|
||||||
_TEST = {
|
_TESTS = [{
|
||||||
'url': 'http://www.mitele.es/programas-tv/diario-de/la-redaccion/programa-144/',
|
'url': 'http://www.mitele.es/programas-tv/diario-de/la-redaccion/programa-144/',
|
||||||
'md5': '6a75fe9d0d3275bead0cb683c616fddb',
|
'md5': '6a75fe9d0d3275bead0cb683c616fddb',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
@ -29,7 +29,7 @@ class MiTeleIE(InfoExtractor):
|
|||||||
'display_id': 'programa-144',
|
'display_id': 'programa-144',
|
||||||
'duration': 2913,
|
'duration': 2913,
|
||||||
},
|
},
|
||||||
}
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
episode = self._match_id(url)
|
episode = self._match_id(url)
|
||||||
|
@ -4,6 +4,7 @@ from __future__ import unicode_literals
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..compat import compat_str
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
float_or_none,
|
float_or_none,
|
||||||
@ -158,7 +159,9 @@ class NRKTVIE(InfoExtractor):
|
|||||||
def _get_subtitles(self, subtitlesurl, video_id, baseurl):
|
def _get_subtitles(self, subtitlesurl, video_id, baseurl):
|
||||||
url = "%s%s" % (baseurl, subtitlesurl)
|
url = "%s%s" % (baseurl, subtitlesurl)
|
||||||
self._debug_print('%s: Subtitle url: %s' % (video_id, url))
|
self._debug_print('%s: Subtitle url: %s' % (video_id, url))
|
||||||
captions = self._download_xml(url, video_id, 'Downloading subtitles')
|
captions = self._download_xml(
|
||||||
|
url, video_id, 'Downloading subtitles',
|
||||||
|
transform_source=lambda s: s.replace(r'<br />', '\r\n'))
|
||||||
lang = captions.get('lang', 'no')
|
lang = captions.get('lang', 'no')
|
||||||
ps = captions.findall('./{0}body/{0}div/{0}p'.format('{http://www.w3.org/ns/ttml}'))
|
ps = captions.findall('./{0}body/{0}div/{0}p'.format('{http://www.w3.org/ns/ttml}'))
|
||||||
srt = ''
|
srt = ''
|
||||||
@ -167,8 +170,7 @@ class NRKTVIE(InfoExtractor):
|
|||||||
duration = parse_duration(p.get('dur'))
|
duration = parse_duration(p.get('dur'))
|
||||||
starttime = self._seconds2str(begin)
|
starttime = self._seconds2str(begin)
|
||||||
endtime = self._seconds2str(begin + duration)
|
endtime = self._seconds2str(begin + duration)
|
||||||
text = '\n'.join(p.itertext())
|
srt += '%s\r\n%s --> %s\r\n%s\r\n\r\n' % (compat_str(pos), starttime, endtime, p.text)
|
||||||
srt += '%s\r\n%s --> %s\r\n%s\r\n\r\n' % (str(pos), starttime, endtime, text)
|
|
||||||
return {lang: [
|
return {lang: [
|
||||||
{'ext': 'ttml', 'url': url},
|
{'ext': 'ttml', 'url': url},
|
||||||
{'ext': 'srt', 'data': srt},
|
{'ext': 'srt', 'data': srt},
|
||||||
|
@ -119,7 +119,8 @@ class RTVEALaCartaIE(InfoExtractor):
|
|||||||
subs = self._download_json(
|
subs = self._download_json(
|
||||||
sub_file + '.json', video_id,
|
sub_file + '.json', video_id,
|
||||||
'Downloading subtitles info')['page']['items']
|
'Downloading subtitles info')['page']['items']
|
||||||
return dict((s['lang'], [{'ext': 'vtt', 'url': s['src']}])
|
return dict(
|
||||||
|
(s['lang'], [{'ext': 'vtt', 'url': s['src']}])
|
||||||
for s in subs)
|
for s in subs)
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@ from .mitele import MiTeleIE
|
|||||||
|
|
||||||
class TelecincoIE(MiTeleIE):
|
class TelecincoIE(MiTeleIE):
|
||||||
IE_NAME = 'telecinco.es'
|
IE_NAME = 'telecinco.es'
|
||||||
_VALID_URL = r'https?://www\.telecinco\.es/[^/]+/[^/]+/[^/]+/(?P<id>.*?)\.html'
|
_VALID_URL = r'https?://www\.telecinco\.es/[^/]+/[^/]+/(?:[^/]+/)?(?P<id>.*?)\.html'
|
||||||
|
|
||||||
_TEST = {
|
_TESTS = [{
|
||||||
'url': 'http://www.telecinco.es/robinfood/temporada-01/t01xp14/Bacalao-cocochas-pil-pil_0_1876350223.html',
|
'url': 'http://www.telecinco.es/robinfood/temporada-01/t01xp14/Bacalao-cocochas-pil-pil_0_1876350223.html',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'MDSVID20141015_0058',
|
'id': 'MDSVID20141015_0058',
|
||||||
@ -16,4 +16,7 @@ class TelecincoIE(MiTeleIE):
|
|||||||
'title': 'Con Martín Berasategui, hacer un bacalao al ...',
|
'title': 'Con Martín Berasategui, hacer un bacalao al ...',
|
||||||
'duration': 662,
|
'duration': 662,
|
||||||
},
|
},
|
||||||
}
|
}, {
|
||||||
|
'url': 'http://www.telecinco.es/informativos/nacional/Pablo_Iglesias-Informativos_Telecinco-entrevista-Pedro_Piqueras_2_1945155182.html',
|
||||||
|
'only_matching': True,
|
||||||
|
}]
|
||||||
|
@ -272,6 +272,10 @@ def parseOpts(overrideArguments=None):
|
|||||||
'--no-playlist',
|
'--no-playlist',
|
||||||
action='store_true', dest='noplaylist', default=False,
|
action='store_true', dest='noplaylist', default=False,
|
||||||
help='If the URL refers to a video and a playlist, download only the video.')
|
help='If the URL refers to a video and a playlist, download only the video.')
|
||||||
|
selection.add_option(
|
||||||
|
'--yes-playlist',
|
||||||
|
action='store_false', dest='noplaylist', default=False,
|
||||||
|
help='If the URL refers to a video and a playlist, download the playlist.')
|
||||||
selection.add_option(
|
selection.add_option(
|
||||||
'--age-limit',
|
'--age-limit',
|
||||||
metavar='YEARS', dest='age_limit', default=None, type=int,
|
metavar='YEARS', dest='age_limit', default=None, type=int,
|
||||||
|
@ -54,7 +54,7 @@ from .compat import (
|
|||||||
compiled_regex_type = type(re.compile(''))
|
compiled_regex_type = type(re.compile(''))
|
||||||
|
|
||||||
std_headers = {
|
std_headers = {
|
||||||
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0 (Chrome)',
|
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/20.0 (Chrome)',
|
||||||
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
|
'Accept-Charset': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
|
||||||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
|
||||||
'Accept-Encoding': 'gzip, deflate',
|
'Accept-Encoding': 'gzip, deflate',
|
||||||
@ -304,6 +304,8 @@ def sanitize_filename(s, restricted=False, is_id=False):
|
|||||||
# Common case of "Foreign band name - English song title"
|
# Common case of "Foreign band name - English song title"
|
||||||
if restricted and result.startswith('-_'):
|
if restricted and result.startswith('-_'):
|
||||||
result = result[2:]
|
result = result[2:]
|
||||||
|
if result.startswith('-'):
|
||||||
|
result = '_' + result[len('-'):]
|
||||||
if not result:
|
if not result:
|
||||||
result = '_'
|
result = '_'
|
||||||
return result
|
return result
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
__version__ = '2015.02.24'
|
__version__ = '2015.02.26'
|
||||||
|
Reference in New Issue
Block a user