From 3c1b6b61351a80f2ca991a664ba6ebaf5c5ce2e1 Mon Sep 17 00:00:00 2001 From: Chih-Hsuan Yen Date: Thu, 4 Jan 2018 22:28:00 +0800 Subject: [PATCH 1/3] [ChangeLog] Update after #15137 [skip ci] --- ChangeLog | 1 + youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/rtvs.py | 38 ++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 youtube_dl/extractor/rtvs.py diff --git a/ChangeLog b/ChangeLog index 94b27b6a1..96bc471f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ version Extractors +* [youku] Fix list extraction (#15135) * [openload] Fix extraction (#15166) * [rtve.es:alacarta] Fix extraction of some new URLs diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index e64defe62..b56c45215 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -898,6 +898,7 @@ from .rtp import RTPIE from .rts import RTSIE from .rtve import RTVEALaCartaIE, RTVELiveIE, RTVEInfantilIE, RTVELiveIE, RTVETelevisionIE from .rtvnh import RTVNHIE +from .rtvs import RtvsExtractorIE from .rudo import RudoIE from .ruhd import RUHDIE from .ruleporn import RulePornIE diff --git a/youtube_dl/extractor/rtvs.py b/youtube_dl/extractor/rtvs.py new file mode 100644 index 000000000..9041356bf --- /dev/null +++ b/youtube_dl/extractor/rtvs.py @@ -0,0 +1,38 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + +class RtvsExtractorIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?rtvs\.sk/.*/archiv/[0-9]*/(?P[0-9]+)' + _TESTS = [{ + # radio archive + 'url': 'http://www.rtvs.sk/radio/archiv/11224/414872', + 'md5': '134d5d6debdeddf8a5d761cbc9edacb8', + 'info_dict': { + 'id': '414872', + 'ext': 'mp3', + 'title': u'Ostrov pokladov 1 časť.mp3', + } + }, { + # tv archive + 'url': 'http://www.rtvs.sk/televizia/archiv/8249/63118', + 'md5': '85e2c55cf988403b70cac24f5c086dc6', + 'info_dict': { + 'id': '63118', + 'ext': 'mp4', + 'title': u'Amaro Džives - Náš deň', + 'description': u'Galavečer pri príležitosti Medzinárodného dňa Rómov.' + } + }] + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + playlist_url = self._search_regex(r'"playlist": "(https?:.*)&', webpage, 'playlist_url') + self.to_screen("%s: Playlist URL: %s" % (video_id, playlist_url)) + playlist = self._download_json(playlist_url, video_id, "Downloading playlist") + jwplayer_data = playlist[0] + return self._parse_jwplayer_data(jwplayer_data, video_id=video_id) + From fd07f6dbd01c3b01f6217824ce0bff9101bf3bf4 Mon Sep 17 00:00:00 2001 From: Robert Trebula Date: Sat, 6 Jan 2018 19:39:03 +0100 Subject: [PATCH 2/3] [rtvs] Add new extractor --- youtube_dl/extractor/rtvs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/youtube_dl/extractor/rtvs.py b/youtube_dl/extractor/rtvs.py index 9041356bf..9e079c5bd 100644 --- a/youtube_dl/extractor/rtvs.py +++ b/youtube_dl/extractor/rtvs.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals from .common import InfoExtractor + class RtvsExtractorIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?rtvs\.sk/.*/archiv/[0-9]*/(?P[0-9]+)' _TESTS = [{ @@ -12,7 +13,7 @@ class RtvsExtractorIE(InfoExtractor): 'info_dict': { 'id': '414872', 'ext': 'mp3', - 'title': u'Ostrov pokladov 1 časť.mp3', + 'title': 'Ostrov pokladov 1 časť.mp3' } }, { # tv archive @@ -21,9 +22,9 @@ class RtvsExtractorIE(InfoExtractor): 'info_dict': { 'id': '63118', 'ext': 'mp4', - 'title': u'Amaro Džives - Náš deň', - 'description': u'Galavečer pri príležitosti Medzinárodného dňa Rómov.' - } + 'title': 'Amaro Džives - Náš deň', + 'description': 'Galavečer pri príležitosti Medzinárodného dňa Rómov.' + } }] def _real_extract(self, url): @@ -35,4 +36,3 @@ class RtvsExtractorIE(InfoExtractor): playlist = self._download_json(playlist_url, video_id, "Downloading playlist") jwplayer_data = playlist[0] return self._parse_jwplayer_data(jwplayer_data, video_id=video_id) - From c9e7f36267ebfe7174f2d41ed988f089ac818887 Mon Sep 17 00:00:00 2001 From: Robert Trebula Date: Tue, 16 Jan 2018 10:36:11 +0100 Subject: [PATCH 3/3] After review from upstream maintainer --- youtube_dl/extractor/extractors.py | 2 +- youtube_dl/extractor/rtvs.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index b56c45215..37afdf777 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -898,7 +898,7 @@ from .rtp import RTPIE from .rts import RTSIE from .rtve import RTVEALaCartaIE, RTVELiveIE, RTVEInfantilIE, RTVELiveIE, RTVETelevisionIE from .rtvnh import RTVNHIE -from .rtvs import RtvsExtractorIE +from .rtvs import RtvsIE from .rudo import RudoIE from .ruhd import RUHDIE from .ruleporn import RulePornIE diff --git a/youtube_dl/extractor/rtvs.py b/youtube_dl/extractor/rtvs.py index 9e079c5bd..61b21b64d 100644 --- a/youtube_dl/extractor/rtvs.py +++ b/youtube_dl/extractor/rtvs.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals from .common import InfoExtractor -class RtvsExtractorIE(InfoExtractor): +class RtvsIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?rtvs\.sk/.*/archiv/[0-9]*/(?P[0-9]+)' _TESTS = [{ # radio archive @@ -32,7 +32,6 @@ class RtvsExtractorIE(InfoExtractor): webpage = self._download_webpage(url, video_id) playlist_url = self._search_regex(r'"playlist": "(https?:.*)&', webpage, 'playlist_url') - self.to_screen("%s: Playlist URL: %s" % (video_id, playlist_url)) - playlist = self._download_json(playlist_url, video_id, "Downloading playlist") + playlist = self._download_json(playlist_url, video_id, 'Downloading playlist') jwplayer_data = playlist[0] return self._parse_jwplayer_data(jwplayer_data, video_id=video_id)