Merge branch 'master' of https://github.com/rg3/youtube-dl
This commit is contained in:
commit
900eabd8e3
1
AUTHORS
1
AUTHORS
@ -167,3 +167,4 @@ Kacper Michajłow
|
|||||||
José Joaquín Atria
|
José Joaquín Atria
|
||||||
Viťas Strádal
|
Viťas Strádal
|
||||||
Kagami Hiiragi
|
Kagami Hiiragi
|
||||||
|
Philip Huppert
|
||||||
|
@ -83,7 +83,7 @@ class ARDMediathekIE(InfoExtractor):
|
|||||||
subtitle_url = media_info.get('_subtitleUrl')
|
subtitle_url = media_info.get('_subtitleUrl')
|
||||||
if subtitle_url:
|
if subtitle_url:
|
||||||
subtitles['de'] = [{
|
subtitles['de'] = [{
|
||||||
'ext': 'srt',
|
'ext': 'ttml',
|
||||||
'url': subtitle_url,
|
'url': subtitle_url,
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
@ -337,7 +337,7 @@ class ArteTVEmbedIE(ArteTVPlus7IE):
|
|||||||
IE_NAME = 'arte.tv:embed'
|
IE_NAME = 'arte.tv:embed'
|
||||||
_VALID_URL = r'''(?x)
|
_VALID_URL = r'''(?x)
|
||||||
http://www\.arte\.tv
|
http://www\.arte\.tv
|
||||||
/playerv2/embed\.php\?json_url=
|
/(?:playerv2/embed|arte_vp/index)\.php\?json_url=
|
||||||
(?P<json_url>
|
(?P<json_url>
|
||||||
http://arte\.tv/papi/tvguide/videos/stream/player/
|
http://arte\.tv/papi/tvguide/videos/stream/player/
|
||||||
(?P<lang>[^/]+)/(?P<id>[^/]+)[^&]*
|
(?P<lang>[^/]+)/(?P<id>[^/]+)[^&]*
|
||||||
|
@ -336,7 +336,6 @@ from .ivi import (
|
|||||||
)
|
)
|
||||||
from .ivideon import IvideonIE
|
from .ivideon import IvideonIE
|
||||||
from .izlesene import IzleseneIE
|
from .izlesene import IzleseneIE
|
||||||
from .jadorecettepub import JadoreCettePubIE
|
|
||||||
from .jeuxvideo import JeuxVideoIE
|
from .jeuxvideo import JeuxVideoIE
|
||||||
from .jove import JoveIE
|
from .jove import JoveIE
|
||||||
from .jwplatform import JWPlatformIE
|
from .jwplatform import JWPlatformIE
|
||||||
@ -584,6 +583,7 @@ from .pornhub import (
|
|||||||
from .pornotube import PornotubeIE
|
from .pornotube import PornotubeIE
|
||||||
from .pornovoisines import PornoVoisinesIE
|
from .pornovoisines import PornoVoisinesIE
|
||||||
from .pornoxo import PornoXOIE
|
from .pornoxo import PornoXOIE
|
||||||
|
from .presstv import PressTVIE
|
||||||
from .primesharetv import PrimeShareTVIE
|
from .primesharetv import PrimeShareTVIE
|
||||||
from .promptfile import PromptFileIE
|
from .promptfile import PromptFileIE
|
||||||
from .prosiebensat1 import ProSiebenSat1IE
|
from .prosiebensat1 import ProSiebenSat1IE
|
||||||
|
@ -1128,6 +1128,18 @@ class GenericIE(InfoExtractor):
|
|||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
# Another form of arte.tv embed
|
||||||
|
{
|
||||||
|
'url': 'http://www.tv-replay.fr/redirection/09-04-16/arte-reportage-arte-11508975.html',
|
||||||
|
'md5': '850bfe45417ddf221288c88a0cffe2e2',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '030273-562_PLUS7-F',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'ARTE Reportage - Nulle part, en France',
|
||||||
|
'description': 'md5:e3a0e8868ed7303ed509b9e3af2b870d',
|
||||||
|
'upload_date': '20160409',
|
||||||
|
},
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
def report_following_redirect(self, new_url):
|
def report_following_redirect(self, new_url):
|
||||||
@ -1702,7 +1714,7 @@ class GenericIE(InfoExtractor):
|
|||||||
|
|
||||||
# Look for embedded arte.tv player
|
# Look for embedded arte.tv player
|
||||||
mobj = re.search(
|
mobj = re.search(
|
||||||
r'<script [^>]*?src="(?P<url>http://www\.arte\.tv/playerv2/embed[^"]+)"',
|
r'<(?:script|iframe) [^>]*?src="(?P<url>http://www\.arte\.tv/(?:playerv2/embed|arte_vp/index)[^"]+)"',
|
||||||
webpage)
|
webpage)
|
||||||
if mobj is not None:
|
if mobj is not None:
|
||||||
return self.url_result(mobj.group('url'), 'ArteTVEmbed')
|
return self.url_result(mobj.group('url'), 'ArteTVEmbed')
|
||||||
|
@ -14,13 +14,13 @@ class GoshgayIE(InfoExtractor):
|
|||||||
_VALID_URL = r'https?://www\.goshgay\.com/video(?P<id>\d+?)($|/)'
|
_VALID_URL = r'https?://www\.goshgay\.com/video(?P<id>\d+?)($|/)'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'http://www.goshgay.com/video299069/diesel_sfw_xxx_video',
|
'url': 'http://www.goshgay.com/video299069/diesel_sfw_xxx_video',
|
||||||
'md5': '027fcc54459dff0feb0bc06a7aeda680',
|
'md5': '4b6db9a0a333142eb9f15913142b0ed1',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': '299069',
|
'id': '299069',
|
||||||
'ext': 'flv',
|
'ext': 'flv',
|
||||||
'title': 'DIESEL SFW XXX Video',
|
'title': 'DIESEL SFW XXX Video',
|
||||||
'thumbnail': 're:^http://.*\.jpg$',
|
'thumbnail': 're:^http://.*\.jpg$',
|
||||||
'duration': 79,
|
'duration': 80,
|
||||||
'age_limit': 18,
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -47,5 +47,5 @@ class GoshgayIE(InfoExtractor):
|
|||||||
'title': title,
|
'title': title,
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
'duration': duration,
|
'duration': duration,
|
||||||
'age_limit': self._family_friendly_search(webpage),
|
'age_limit': 18,
|
||||||
}
|
}
|
||||||
|
@ -16,14 +16,14 @@ class GrouponIE(InfoExtractor):
|
|||||||
'playlist': [{
|
'playlist': [{
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'tubGNycTo_9Uxg82uESj4i61EYX8nyuf',
|
'id': 'tubGNycTo_9Uxg82uESj4i61EYX8nyuf',
|
||||||
'ext': 'mp4',
|
'ext': 'flv',
|
||||||
'title': 'Bikram Yoga Huntington Beach | Orange County',
|
'title': 'Bikram Yoga Huntington Beach | Orange County',
|
||||||
'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
|
'description': 'md5:d41d8cd98f00b204e9800998ecf8427e',
|
||||||
'duration': 44.961,
|
'duration': 44.961,
|
||||||
},
|
},
|
||||||
}],
|
}],
|
||||||
'params': {
|
'params': {
|
||||||
'skip_download': 'HLS',
|
'skip_download': 'HDS',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ class GrouponIE(InfoExtractor):
|
|||||||
webpage = self._download_webpage(url, playlist_id)
|
webpage = self._download_webpage(url, playlist_id)
|
||||||
|
|
||||||
payload = self._parse_json(self._search_regex(
|
payload = self._parse_json(self._search_regex(
|
||||||
r'var\s+payload\s*=\s*(.*?);\n', webpage, 'payload'), playlist_id)
|
r'(?:var\s+|window\.)payload\s*=\s*(.*?);\n', webpage, 'payload'), playlist_id)
|
||||||
videos = payload['carousel'].get('dealVideos', [])
|
videos = payload['carousel'].get('dealVideos', [])
|
||||||
entries = []
|
entries = []
|
||||||
for v in videos:
|
for v in videos:
|
||||||
|
@ -24,6 +24,7 @@ class HowStuffWorksIE(InfoExtractor):
|
|||||||
'thumbnail': 're:^https?://.*\.jpg$',
|
'thumbnail': 're:^https?://.*\.jpg$',
|
||||||
'duration': 161,
|
'duration': 161,
|
||||||
},
|
},
|
||||||
|
'skip': 'Video broken',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'url': 'http://adventure.howstuffworks.com/7199-survival-zone-food-and-water-in-the-savanna-video.htm',
|
'url': 'http://adventure.howstuffworks.com/7199-survival-zone-food-and-water-in-the-savanna-video.htm',
|
||||||
|
@ -29,7 +29,7 @@ class IzleseneIE(InfoExtractor):
|
|||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Sevinçten Çıldırtan Doğum Günü Hediyesi',
|
'title': 'Sevinçten Çıldırtan Doğum Günü Hediyesi',
|
||||||
'description': 'md5:253753e2655dde93f59f74b572454f6d',
|
'description': 'md5:253753e2655dde93f59f74b572454f6d',
|
||||||
'thumbnail': 're:^http://.*\.jpg',
|
'thumbnail': 're:^https?://.*\.jpg',
|
||||||
'uploader_id': 'pelikzzle',
|
'uploader_id': 'pelikzzle',
|
||||||
'timestamp': int,
|
'timestamp': int,
|
||||||
'upload_date': '20140702',
|
'upload_date': '20140702',
|
||||||
@ -44,8 +44,7 @@ class IzleseneIE(InfoExtractor):
|
|||||||
'id': '17997',
|
'id': '17997',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': 'Tarkan Dortmund 2006 Konseri',
|
'title': 'Tarkan Dortmund 2006 Konseri',
|
||||||
'description': 'Tarkan Dortmund 2006 Konseri',
|
'thumbnail': 're:^https://.*\.jpg',
|
||||||
'thumbnail': 're:^http://.*\.jpg',
|
|
||||||
'uploader_id': 'parlayankiz',
|
'uploader_id': 'parlayankiz',
|
||||||
'timestamp': int,
|
'timestamp': int,
|
||||||
'upload_date': '20061112',
|
'upload_date': '20061112',
|
||||||
@ -62,7 +61,7 @@ class IzleseneIE(InfoExtractor):
|
|||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
title = self._og_search_title(webpage)
|
title = self._og_search_title(webpage)
|
||||||
description = self._og_search_description(webpage)
|
description = self._og_search_description(webpage, default=None)
|
||||||
thumbnail = self._proto_relative_url(
|
thumbnail = self._proto_relative_url(
|
||||||
self._og_search_thumbnail(webpage), scheme='http:')
|
self._og_search_thumbnail(webpage), scheme='http:')
|
||||||
|
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
# coding: utf-8
|
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
|
||||||
from .youtube import YoutubeIE
|
|
||||||
|
|
||||||
|
|
||||||
class JadoreCettePubIE(InfoExtractor):
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?jadorecettepub\.com/[0-9]{4}/[0-9]{2}/(?P<id>.*?)\.html'
|
|
||||||
|
|
||||||
_TEST = {
|
|
||||||
'url': 'http://www.jadorecettepub.com/2010/12/star-wars-massacre-par-les-japonais.html',
|
|
||||||
'md5': '401286a06067c70b44076044b66515de',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'jLMja3tr7a4',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'La pire utilisation de Star Wars',
|
|
||||||
'description': "Jadorecettepub.com vous a gratifié de plusieurs pubs géniales utilisant Star Wars et Dark Vador plus particulièrement... Mais l'heure est venue de vous proposer une version totalement massacrée, venue du Japon. Quand les Japonais détruisent l'image de Star Wars pour vendre du thon en boite, ça promet...",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
mobj = re.match(self._VALID_URL, url)
|
|
||||||
display_id = mobj.group('id')
|
|
||||||
|
|
||||||
webpage = self._download_webpage(url, display_id)
|
|
||||||
|
|
||||||
title = self._html_search_regex(
|
|
||||||
r'<span style="font-size: x-large;"><b>(.*?)</b></span>',
|
|
||||||
webpage, 'title')
|
|
||||||
description = self._html_search_regex(
|
|
||||||
r'(?s)<div id="fb-root">(.*?)<script>', webpage, 'description',
|
|
||||||
fatal=False)
|
|
||||||
real_url = self._search_regex(
|
|
||||||
r'\[/postlink\](.*)endofvid', webpage, 'video URL')
|
|
||||||
video_id = YoutubeIE.extract_id(real_url)
|
|
||||||
|
|
||||||
return {
|
|
||||||
'_type': 'url_transparent',
|
|
||||||
'url': real_url,
|
|
||||||
'id': video_id,
|
|
||||||
'title': title,
|
|
||||||
'description': description,
|
|
||||||
}
|
|
@ -7,6 +7,7 @@ from ..compat import compat_urllib_parse_unquote
|
|||||||
from ..utils import (
|
from ..utils import (
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
HEADRequest,
|
HEADRequest,
|
||||||
|
NO_DEFAULT,
|
||||||
parse_count,
|
parse_count,
|
||||||
str_to_int,
|
str_to_int,
|
||||||
)
|
)
|
||||||
@ -63,8 +64,17 @@ class MixcloudIE(InfoExtractor):
|
|||||||
|
|
||||||
webpage = self._download_webpage(url, track_id)
|
webpage = self._download_webpage(url, track_id)
|
||||||
|
|
||||||
|
message = self._html_search_regex(
|
||||||
|
r'(?s)<div[^>]+class="global-message cloudcast-disabled-notice-light"[^>]*>(.+?)<(?:a|/div)',
|
||||||
|
webpage, 'error message', default=None)
|
||||||
|
|
||||||
preview_url = self._search_regex(
|
preview_url = self._search_regex(
|
||||||
r'\s(?:data-preview-url|m-preview)="([^"]+)"', webpage, 'preview url')
|
r'\s(?:data-preview-url|m-preview)="([^"]+)"',
|
||||||
|
webpage, 'preview url', default=None if message else NO_DEFAULT)
|
||||||
|
|
||||||
|
if message:
|
||||||
|
raise ExtractorError('%s said: %s' % (self.IE_NAME, message), expected=True)
|
||||||
|
|
||||||
song_url = re.sub(r'audiocdn(\d+)', r'stream\1', preview_url)
|
song_url = re.sub(r'audiocdn(\d+)', r'stream\1', preview_url)
|
||||||
song_url = song_url.replace('/previews/', '/c/originals/')
|
song_url = song_url.replace('/previews/', '/c/originals/')
|
||||||
if not self._check_url(song_url, track_id, 'mp3'):
|
if not self._check_url(song_url, track_id, 'mp3'):
|
||||||
|
@ -89,6 +89,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE):
|
|||||||
'timestamp': 1431878400,
|
'timestamp': 1431878400,
|
||||||
'description': 'md5:a10a54589c2860300d02e1de821eb2ef',
|
'description': 'md5:a10a54589c2860300d02e1de821eb2ef',
|
||||||
},
|
},
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}, {
|
}, {
|
||||||
'note': 'No lyrics translation.',
|
'note': 'No lyrics translation.',
|
||||||
'url': 'http://music.163.com/#/song?id=29822014',
|
'url': 'http://music.163.com/#/song?id=29822014',
|
||||||
@ -101,6 +102,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE):
|
|||||||
'timestamp': 1419523200,
|
'timestamp': 1419523200,
|
||||||
'description': 'md5:a4d8d89f44656af206b7b2555c0bce6c',
|
'description': 'md5:a4d8d89f44656af206b7b2555c0bce6c',
|
||||||
},
|
},
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}, {
|
}, {
|
||||||
'note': 'No lyrics.',
|
'note': 'No lyrics.',
|
||||||
'url': 'http://music.163.com/song?id=17241424',
|
'url': 'http://music.163.com/song?id=17241424',
|
||||||
@ -112,6 +114,7 @@ class NetEaseMusicIE(NetEaseMusicBaseIE):
|
|||||||
'upload_date': '20080211',
|
'upload_date': '20080211',
|
||||||
'timestamp': 1202745600,
|
'timestamp': 1202745600,
|
||||||
},
|
},
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}, {
|
}, {
|
||||||
'note': 'Has translated name.',
|
'note': 'Has translated name.',
|
||||||
'url': 'http://music.163.com/#/song?id=22735043',
|
'url': 'http://music.163.com/#/song?id=22735043',
|
||||||
@ -124,7 +127,8 @@ class NetEaseMusicIE(NetEaseMusicBaseIE):
|
|||||||
'upload_date': '20100127',
|
'upload_date': '20100127',
|
||||||
'timestamp': 1264608000,
|
'timestamp': 1264608000,
|
||||||
'alt_title': '说出愿望吧(Genie)',
|
'alt_title': '说出愿望吧(Genie)',
|
||||||
}
|
},
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _process_lyrics(self, lyrics_info):
|
def _process_lyrics(self, lyrics_info):
|
||||||
@ -192,6 +196,7 @@ class NetEaseMusicAlbumIE(NetEaseMusicBaseIE):
|
|||||||
'title': 'B\'day',
|
'title': 'B\'day',
|
||||||
},
|
},
|
||||||
'playlist_count': 23,
|
'playlist_count': 23,
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
@ -223,6 +228,7 @@ class NetEaseMusicSingerIE(NetEaseMusicBaseIE):
|
|||||||
'title': '张惠妹 - aMEI;阿密特',
|
'title': '张惠妹 - aMEI;阿密特',
|
||||||
},
|
},
|
||||||
'playlist_count': 50,
|
'playlist_count': 50,
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}, {
|
}, {
|
||||||
'note': 'Singer has translated name.',
|
'note': 'Singer has translated name.',
|
||||||
'url': 'http://music.163.com/#/artist?id=124098',
|
'url': 'http://music.163.com/#/artist?id=124098',
|
||||||
@ -231,6 +237,7 @@ class NetEaseMusicSingerIE(NetEaseMusicBaseIE):
|
|||||||
'title': '李昇基 - 이승기',
|
'title': '李昇基 - 이승기',
|
||||||
},
|
},
|
||||||
'playlist_count': 50,
|
'playlist_count': 50,
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
@ -266,6 +273,7 @@ class NetEaseMusicListIE(NetEaseMusicBaseIE):
|
|||||||
'description': 'md5:12fd0819cab2965b9583ace0f8b7b022'
|
'description': 'md5:12fd0819cab2965b9583ace0f8b7b022'
|
||||||
},
|
},
|
||||||
'playlist_count': 99,
|
'playlist_count': 99,
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}, {
|
}, {
|
||||||
'note': 'Toplist/Charts sample',
|
'note': 'Toplist/Charts sample',
|
||||||
'url': 'http://music.163.com/#/discover/toplist?id=3733003',
|
'url': 'http://music.163.com/#/discover/toplist?id=3733003',
|
||||||
@ -275,6 +283,7 @@ class NetEaseMusicListIE(NetEaseMusicBaseIE):
|
|||||||
'description': 'md5:73ec782a612711cadc7872d9c1e134fc',
|
'description': 'md5:73ec782a612711cadc7872d9c1e134fc',
|
||||||
},
|
},
|
||||||
'playlist_count': 50,
|
'playlist_count': 50,
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
@ -314,6 +323,7 @@ class NetEaseMusicMvIE(NetEaseMusicBaseIE):
|
|||||||
'creator': '白雅言',
|
'creator': '白雅言',
|
||||||
'upload_date': '20150520',
|
'upload_date': '20150520',
|
||||||
},
|
},
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}
|
}
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
@ -357,6 +367,7 @@ class NetEaseMusicProgramIE(NetEaseMusicBaseIE):
|
|||||||
'upload_date': '20150613',
|
'upload_date': '20150613',
|
||||||
'duration': 900,
|
'duration': 900,
|
||||||
},
|
},
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}, {
|
}, {
|
||||||
'note': 'This program has accompanying songs.',
|
'note': 'This program has accompanying songs.',
|
||||||
'url': 'http://music.163.com/#/program?id=10141022',
|
'url': 'http://music.163.com/#/program?id=10141022',
|
||||||
@ -366,6 +377,7 @@ class NetEaseMusicProgramIE(NetEaseMusicBaseIE):
|
|||||||
'description': 'md5:8d594db46cc3e6509107ede70a4aaa3b',
|
'description': 'md5:8d594db46cc3e6509107ede70a4aaa3b',
|
||||||
},
|
},
|
||||||
'playlist_count': 4,
|
'playlist_count': 4,
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}, {
|
}, {
|
||||||
'note': 'This program has accompanying songs.',
|
'note': 'This program has accompanying songs.',
|
||||||
'url': 'http://music.163.com/#/program?id=10141022',
|
'url': 'http://music.163.com/#/program?id=10141022',
|
||||||
@ -379,7 +391,8 @@ class NetEaseMusicProgramIE(NetEaseMusicBaseIE):
|
|||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
'noplaylist': True
|
'noplaylist': True
|
||||||
}
|
},
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
@ -438,6 +451,7 @@ class NetEaseMusicDjRadioIE(NetEaseMusicBaseIE):
|
|||||||
'description': 'md5:766220985cbd16fdd552f64c578a6b15'
|
'description': 'md5:766220985cbd16fdd552f64c578a6b15'
|
||||||
},
|
},
|
||||||
'playlist_mincount': 40,
|
'playlist_mincount': 40,
|
||||||
|
'skip': 'Blocked outside Mainland China',
|
||||||
}
|
}
|
||||||
_PAGE_SIZE = 1000
|
_PAGE_SIZE = 1000
|
||||||
|
|
||||||
|
74
youtube_dl/extractor/presstv.py
Normal file
74
youtube_dl/extractor/presstv.py
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import remove_start
|
||||||
|
|
||||||
|
|
||||||
|
class PressTVIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?presstv\.ir/[^/]+/(?P<y>\d+)/(?P<m>\d+)/(?P<d>\d+)/(?P<id>\d+)/(?P<display_id>[^/]+)?'
|
||||||
|
|
||||||
|
_TEST = {
|
||||||
|
'url': 'http://www.presstv.ir/Detail/2016/04/09/459911/Australian-sewerage-treatment-facility-/',
|
||||||
|
'md5': '5d7e3195a447cb13e9267e931d8dd5a5',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '459911',
|
||||||
|
'display_id': 'Australian-sewerage-treatment-facility-',
|
||||||
|
'ext': 'mp4',
|
||||||
|
'title': 'Organic mattresses used to clean waste water',
|
||||||
|
'upload_date': '20160409',
|
||||||
|
'thumbnail': 're:^https?://.*\.jpg',
|
||||||
|
'description': 'md5:20002e654bbafb6908395a5c0cfcd125'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
mobj = re.match(self._VALID_URL, url)
|
||||||
|
video_id = mobj.group('id')
|
||||||
|
display_id = mobj.group('display_id') or video_id
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, display_id)
|
||||||
|
|
||||||
|
# extract video URL from webpage
|
||||||
|
video_url = self._hidden_inputs(webpage)['inpPlayback']
|
||||||
|
|
||||||
|
# build list of available formats
|
||||||
|
# specified in http://www.presstv.ir/Scripts/playback.js
|
||||||
|
base_url = 'http://192.99.219.222:82/presstv'
|
||||||
|
_formats = [
|
||||||
|
(180, '_low200.mp4'),
|
||||||
|
(360, '_low400.mp4'),
|
||||||
|
(720, '_low800.mp4'),
|
||||||
|
(1080, '.mp4')
|
||||||
|
]
|
||||||
|
|
||||||
|
formats = [{
|
||||||
|
'url': base_url + video_url[:-4] + extension,
|
||||||
|
'format_id': '%dp' % height,
|
||||||
|
'height': height,
|
||||||
|
} for height, extension in _formats]
|
||||||
|
|
||||||
|
# extract video metadata
|
||||||
|
title = remove_start(
|
||||||
|
self._html_search_meta('title', webpage, fatal=True), 'PressTV-')
|
||||||
|
|
||||||
|
thumbnail = self._og_search_thumbnail(webpage)
|
||||||
|
description = self._og_search_description(webpage)
|
||||||
|
|
||||||
|
upload_date = '%04d%02d%02d' % (
|
||||||
|
int(mobj.group('y')),
|
||||||
|
int(mobj.group('m')),
|
||||||
|
int(mobj.group('d')),
|
||||||
|
)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'display_id': display_id,
|
||||||
|
'title': title,
|
||||||
|
'formats': formats,
|
||||||
|
'thumbnail': thumbnail,
|
||||||
|
'upload_date': upload_date,
|
||||||
|
'description': description
|
||||||
|
}
|
@ -1884,7 +1884,7 @@ class YoutubePlaylistIE(YoutubePlaylistBaseInfoExtractor):
|
|||||||
if video:
|
if video:
|
||||||
return video
|
return video
|
||||||
|
|
||||||
if playlist_id.startswith('RD') or playlist_id.startswith('UL'):
|
if playlist_id.startswith(('RD', 'UL', 'PU')):
|
||||||
# Mixes require a custom extraction process
|
# Mixes require a custom extraction process
|
||||||
return self._extract_mix(playlist_id)
|
return self._extract_mix(playlist_id)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user