1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-23 00:16:48 +00:00

[movingimage] Adapt to the new domain name and fix extraction

Closes #10466
This commit is contained in:
Yen Chi Hsuan 2016-09-01 16:58:16 +08:00
parent 746a695b36
commit 05d4612947
No known key found for this signature in database
GPG Key ID: 3FDDD575826C5C30
3 changed files with 17 additions and 17 deletions

View File

@ -1,3 +1,9 @@
version <unreleased>
Extractors
* [movingimage] Fix for the new site name (#10466)
version 2016.08.31 version 2016.08.31
Extractors Extractors

View File

@ -486,6 +486,7 @@ from .motherless import MotherlessIE
from .motorsport import MotorsportIE from .motorsport import MotorsportIE
from .movieclips import MovieClipsIE from .movieclips import MovieClipsIE
from .moviezine import MoviezineIE from .moviezine import MoviezineIE
from .movingimage import MovingImageIE
from .msn import MSNIE from .msn import MSNIE
from .mtv import ( from .mtv import (
MTVIE, MTVIE,
@ -806,7 +807,6 @@ from .srgssr import (
SRGSSRPlayIE, SRGSSRPlayIE,
) )
from .srmediathek import SRMediathekIE from .srmediathek import SRMediathekIE
from .ssa import SSAIE
from .stanfordoc import StanfordOpenClassroomIE from .stanfordoc import StanfordOpenClassroomIE
from .steam import SteamIE from .steam import SteamIE
from .streamable import StreamableIE from .streamable import StreamableIE

View File

@ -7,22 +7,19 @@ from ..utils import (
) )
class SSAIE(InfoExtractor): class MovingImageIE(InfoExtractor):
_VALID_URL = r'https?://ssa\.nls\.uk/film/(?P<id>\d+)' _VALID_URL = r'https?://movingimage\.nls\.uk/film/(?P<id>\d+)'
_TEST = { _TEST = {
'url': 'http://ssa.nls.uk/film/3561', 'url': 'http://movingimage.nls.uk/film/3561',
'md5': '4caa05c2b38453e6f862197571a7be2f',
'info_dict': { 'info_dict': {
'id': '3561', 'id': '3561',
'ext': 'flv', 'ext': 'mp4',
'title': 'SHETLAND WOOL', 'title': 'SHETLAND WOOL',
'description': 'md5:c5afca6871ad59b4271e7704fe50ab04', 'description': 'md5:c5afca6871ad59b4271e7704fe50ab04',
'duration': 900, 'duration': 900,
'thumbnail': 're:^https?://.*\.jpg$', 'thumbnail': 're:^https?://.*\.jpg$',
}, },
'params': {
# rtmp download
'skip_download': True,
},
} }
def _real_extract(self, url): def _real_extract(self, url):
@ -30,10 +27,9 @@ class SSAIE(InfoExtractor):
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)
streamer = self._search_regex( formats = self._extract_m3u8_formats(
r"'streamer'\s*,\S*'(rtmp[^']+)'", webpage, 'streamer') self._html_search_regex(r'file\s*:\s*"([^"]+)"', webpage, 'm3u8 manifest URL'),
play_path = self._search_regex( video_id, ext='mp4', entry_protocol='m3u8_native')
r"'file'\s*,\s*'([^']+)'", webpage, 'file').rpartition('.')[0]
def search_field(field_name, fatal=False): def search_field(field_name, fatal=False):
return self._search_regex( return self._search_regex(
@ -44,13 +40,11 @@ class SSAIE(InfoExtractor):
description = unescapeHTML(search_field('Description')) description = unescapeHTML(search_field('Description'))
duration = parse_duration(search_field('Running time')) duration = parse_duration(search_field('Running time'))
thumbnail = self._search_regex( thumbnail = self._search_regex(
r"'image'\s*,\s*'([^']+)'", webpage, 'thumbnails', fatal=False) r"image\s*:\s*'([^']+)'", webpage, 'thumbnail', fatal=False)
return { return {
'id': video_id, 'id': video_id,
'url': streamer, 'formats': formats,
'play_path': play_path,
'ext': 'flv',
'title': title, 'title': title,
'description': description, 'description': description,
'duration': duration, 'duration': duration,