A feature-rich command-line audio/video downloader
[movingimage] Adapt to the new domain name and fix extraction
Yen Chi Hsuan05d4612947d6
diff --git a/ChangeLog b/ChangeLogindex 0f8076d96d..877e8112e4 100644--- a/ChangeLog+++ b/ChangeLog@@ -1,3 +1,9 @@+version <unreleased>++Extractors+* [movingimage] Fix for the new site name (#10466)++version 2016.08.31Extractorsdiff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.pyindex 21efa96b23..8d0688f539 100644--- a/youtube_dl/extractor/extractors.py+++ b/youtube_dl/extractor/extractors.py@@ -486,6 +486,7 @@ from .motherless import MotherlessIEfrom .motorsport import MotorsportIEfrom .movieclips import MovieClipsIEfrom .moviezine import MoviezineIE+from .movingimage import MovingImageIEfrom .msn import MSNIEfrom .mtv import (MTVIE,@@ -806,7 +807,6 @@ from .srgssr import (SRGSSRPlayIE,)from .srmediathek import SRMediathekIE-from .ssa import SSAIEfrom .stanfordoc import StanfordOpenClassroomIEfrom .steam import SteamIEfrom .streamable import StreamableIEdiff --git a/youtube_dl/extractor/ssa.py b/youtube_dl/extractor/movingimage.pysimilarity index 65%rename from youtube_dl/extractor/ssa.pyrename to youtube_dl/extractor/movingimage.pyindex 54d1843f22..bb789c32ed 100644--- a/youtube_dl/extractor/ssa.py+++ b/youtube_dl/extractor/movingimage.py@@ -7,22 +7,19 @@ from ..utils import ()-class SSAIE(InfoExtractor):- _VALID_URL = r'https?://ssa\.nls\.uk/film/(?P<id>\d+)'+class MovingImageIE(InfoExtractor):+ _VALID_URL = r'https?://movingimage\.nls\.uk/film/(?P<id>\d+)'_TEST = {- 'url': 'http://ssa.nls.uk/film/3561',+ 'url': 'http://movingimage.nls.uk/film/3561',+ 'md5': '4caa05c2b38453e6f862197571a7be2f','info_dict': {'id': '3561',- 'ext': 'flv',+ 'ext': 'mp4','title': 'SHETLAND WOOL','description': 'md5:c5afca6871ad59b4271e7704fe50ab04','duration': 900,'thumbnail': 're:^https?://.*\.jpg$',},- 'params': {- # rtmp download- 'skip_download': True,- },}def _real_extract(self, url):@@ -30,10 +27,9 @@ class SSAIE(InfoExtractor):webpage = self._download_webpage(url, video_id)- streamer = self._search_regex(- r"'streamer'\s*,\S*'(rtmp[^']+)'", webpage, 'streamer')- play_path = self._search_regex(- r"'file'\s*,\s*'([^']+)'", webpage, 'file').rpartition('.')[0]+ formats = self._extract_m3u8_formats(+ self._html_search_regex(r'file\s*:\s*"([^"]+)"', webpage, 'm3u8 manifest URL'),+ video_id, ext='mp4', entry_protocol='m3u8_native')def search_field(field_name, fatal=False):return self._search_regex(@@ -44,13 +40,11 @@ class SSAIE(InfoExtractor):description = unescapeHTML(search_field('Description'))duration = parse_duration(search_field('Running time'))thumbnail = self._search_regex(- r"'image'\s*,\s*'([^']+)'", webpage, 'thumbnails', fatal=False)+ r"image\s*:\s*'([^']+)'", webpage, 'thumbnail', fatal=False)return {'id': video_id,- 'url': streamer,- 'play_path': play_path,- 'ext': 'flv',+ 'formats': formats,'title': title,'description': description,'duration': duration,