From 98d13be5d52fe3690010b857a5251872fca83d40 Mon Sep 17 00:00:00 2001 From: Teemu Ikonen Date: Sun, 24 May 2020 18:45:08 +0300 Subject: [PATCH] [ruutu] Accept embedded video URLs Ruutu videos embedded to websites have URLs starting with static.nelonenmedia.fi. Add support for these. --- youtube_dl/extractor/ruutu.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/ruutu.py b/youtube_dl/extractor/ruutu.py index f984040aa..ac40f210f 100644 --- a/youtube_dl/extractor/ruutu.py +++ b/youtube_dl/extractor/ruutu.py @@ -13,7 +13,7 @@ from ..utils import ( class RuutuIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?(?:ruutu|supla)\.fi/(?:video|supla)/(?P\d+)' + _VALID_URL = r'https?://(?:www\.)?(?:ruutu|supla|static\.nelonenmedia)\.fi/(?:video/|supla/|player/misc/embed_player.html\?nid=)(?P\d+)' _TESTS = [ { 'url': 'http://www.ruutu.fi/video/2058907', @@ -72,7 +72,20 @@ class RuutuIE(InfoExtractor): 'age_limit': 0, }, 'expected_warnings': ['HTTP Error 502: Bad Gateway'], - } + }, + # URL from embedded video + { + 'url': 'https://static.nelonenmedia.fi/player/misc/embed_player.html?nid=3618790', + 'md5': '71cca94775f29ef2fba12af92262647e', + 'info_dict': { + 'id': '3618790', + 'ext': 'mp4', + 'title': 'Kaukokärry hoitaa intialaisinsinöörin kauppareissut turvallisesti', + 'thumbnail': r're:^https?://.*\.jpg$', + 'duration': 77, + 'age_limit': 0, + }, + }, ] def _real_extract(self, url):