summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortpikonen <[email protected]>2021-01-25 15:43:41 +0200
committerGitHub <[email protected]>2021-01-25 14:43:41 +0100
commit395981288ba0b2e1afabd4e595cb9c959ef62356 (patch)
tree8bf6f9076463496cb7eee68be7d400c5e10120b8
parent55bb3556c8c5ec088ef88edbdef925860e0926dc (diff)
downloadyoutube-dl-395981288ba0b2e1afabd4e595cb9c959ef62356.tar.gz
youtube-dl-395981288ba0b2e1afabd4e595cb9c959ef62356.zip
[tv2] Add support for mtvuutiset.fi (#27744)
-rw-r--r--youtube_dl/extractor/extractors.py1
-rw-r--r--youtube_dl/extractor/tv2.py29
2 files changed, 30 insertions, 0 deletions
diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py
index ef57f5556..2331b0e15 100644
--- a/youtube_dl/extractor/extractors.py
+++ b/youtube_dl/extractor/extractors.py
@@ -1260,6 +1260,7 @@ from .tv2 import (
TV2IE,
TV2ArticleIE,
KatsomoIE,
+ MTVuutisetIE,
)
from .tv2dk import (
TV2DKIE,
diff --git a/youtube_dl/extractor/tv2.py b/youtube_dl/extractor/tv2.py
index 4a19b9be6..42a9af126 100644
--- a/youtube_dl/extractor/tv2.py
+++ b/youtube_dl/extractor/tv2.py
@@ -190,3 +190,32 @@ class KatsomoIE(TV2IE):
_API_DOMAIN = 'api.katsomo.fi'
_PROTOCOLS = ('HLS', 'MPD')
_GEO_COUNTRIES = ['FI']
+
+
+class MTVuutisetIE(KatsomoIE):
+ _VALID_URL = r'https?://(?:www\.)mtvuutiset\.fi/(?:artikkeli/[0-9a-z-]+/|video/prog)(?P<id>\d+)'
+ _TEST = {
+ 'url': 'https://www.mtvuutiset.fi/artikkeli/tallaisia-vaurioita-viking-amorellassa-on-useamman-osaston-alla-vetta/7931384',
+ 'info_dict': {
+ 'id': '1311159',
+ 'ext': 'mp4',
+ 'title': 'MTV Uutiset Live',
+ 'description': 'Viking Amorellan matkustajien evakuointi on alkanut – tältä operaatio näyttää laivalla',
+ 'timestamp': 1600608966,
+ 'upload_date': '20200920',
+ 'duration': 153.7886666,
+ 'view_count': int,
+ 'categories': list,
+ },
+ 'params': {
+ # m3u8 download
+ 'skip_download': True,
+ },
+ }
+
+ def _real_extract(self, url):
+ art_id = self._match_id(url)
+ webpage = self._download_webpage(url, art_id)
+ video_id = self._html_search_regex(
+ r'<div class=\'player-container\' .*data-katsomoid="(.+?)"', webpage, 'video_id')
+ return self.url_result("http://mtv.fi/a/0/a/%s" % video_id, video_id=video_id, ie="Katsomo")