aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/rtvs.py
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2021-06-09 17:54:27 -0500
committerJesús <heckyel@hyperbola.info>2021-06-09 17:54:27 -0500
commit27fe903c511691c078942bef5ee9a05a43b15c8f (patch)
tree50f30ab2ec749b965869518c0a28651f8677f0d3 /hypervideo_dl/extractor/rtvs.py
downloadhypervideo-27fe903c511691c078942bef5ee9a05a43b15c8f.tar.lz
hypervideo-27fe903c511691c078942bef5ee9a05a43b15c8f.tar.xz
hypervideo-27fe903c511691c078942bef5ee9a05a43b15c8f.zip
initial
Diffstat (limited to 'hypervideo_dl/extractor/rtvs.py')
-rw-r--r--hypervideo_dl/extractor/rtvs.py47
1 files changed, 47 insertions, 0 deletions
diff --git a/hypervideo_dl/extractor/rtvs.py b/hypervideo_dl/extractor/rtvs.py
new file mode 100644
index 0000000..6573b26
--- /dev/null
+++ b/hypervideo_dl/extractor/rtvs.py
@@ -0,0 +1,47 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+
+
+class RTVSIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?rtvs\.sk/(?:radio|televizia)/archiv/\d+/(?P<id>\d+)'
+ _TESTS = [{
+ # radio archive
+ 'url': 'http://www.rtvs.sk/radio/archiv/11224/414872',
+ 'md5': '134d5d6debdeddf8a5d761cbc9edacb8',
+ 'info_dict': {
+ 'id': '414872',
+ 'ext': 'mp3',
+ 'title': 'Ostrov pokladov 1 časť.mp3'
+ },
+ 'params': {
+ 'skip_download': True,
+ }
+ }, {
+ # tv archive
+ 'url': 'http://www.rtvs.sk/televizia/archiv/8249/63118',
+ 'md5': '85e2c55cf988403b70cac24f5c086dc6',
+ 'info_dict': {
+ 'id': '63118',
+ 'ext': 'mp4',
+ 'title': 'Amaro Džives - Náš deň',
+ 'description': 'Galavečer pri príležitosti Medzinárodného dňa Rómov.'
+ },
+ 'params': {
+ 'skip_download': True,
+ }
+ }]
+
+ 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["\']?\s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage,
+ 'playlist url', group='url')
+
+ data = self._download_json(
+ playlist_url, video_id, 'Downloading playlist')[0]
+ return self._parse_jwplayer_data(data, video_id=video_id)