Repository: yt-dlp/yt-dlp

Issue:
elonet.finna.fi - downloads only the film trailer
### Checklist

- [X] I'm reporting a broken site
- [X] I've verified that I'm running yt-dlp version **2022.02.04**. ([update instructions](https://github.com/yt-dlp/yt-dlp#update))
- [X] I've checked that all provided URLs are alive and playable in a browser
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/ytdl-org/youtube-dl#video-url-contains-an-ampersand-and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues including closed ones. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [ ] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### Region

_No response_

### Description

example video: https://elonet.finna.fi/Record/kavi.elonet_elokuva_117396?lng=en-gb

Rips the trailer, not the main feature.

### Verbose log

```shell
[debug] Command-line config: ['-vU', 'https://elonet.finna.fi/Record/kavi.elonet_elokuva_117396']
[debug] System config "/etc/yt-dlp.conf": ['-o', '/home/user/Videos/youtube-dl/%(title)s [%(id)s].%(ext)s', '--sponsorblock-remove', 'all', '--embed-metadata', '--embed-subs', '--restrict-filenames', '--compat-options', 'no-live-chat', '--no-write-comments']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2022.02.04 [c1653e9ef]
[debug] Lazy loading extractors is disabled
[debug] Compatibility options: no-live-chat
[debug] Python version 3.10.2 (CPython 64bit) - Linux-5.16.11-200.fc35.x86_64-x86_64-with-glibc2.34
[debug] exe versions: ffmpeg 4.4.1 (setts), ffprobe 4.4.1
[debug] Optional libraries: Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
Latest version: 2022.02.04, Current version: 2022.02.04
yt-dlp is up to date (2022.02.04)
[debug] [Elonet] Extracting URL: https://elonet.finna.fi/Record/kavi.elonet_elokuva_117396
[Elonet] 117396: Downloading webpage
[Elonet] 117396: Downloading m3u8 information
[SponsorBlock] SponsorBlock is not supported for Elonet
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 117396: Downloading 1 format(s): 3105
[debug] Invoking downloader on "http://elo.salama.tv.funet.fi/vod/_definst_/mp4:fi/kava/elonet/2013/1554345-Sampotraileri.mp4/chunklist_w133147641.m3u8"
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 21
[download] Destination: /home/user/Videos/youtube-dl/Sampo [117396].mp4
[download] 100% of 42.88MiB in 00:09
[debug] ffprobe command line: ffprobe -hide_banner -show_format -show_streams -print_format json 'file:/home/user/Videos/youtube-dl/Sampo [117396].mp4'
[FixupM3u8] Fixing MPEG-TS in MP4 container of "/home/user/Videos/youtube-dl/Sampo [117396].mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/user/Videos/youtube-dl/Sampo [117396].mp4' -map 0 -dn -ignore_unknown -c copy -f mp4 -bsf:a aac_adtstoasc -movflags +faststart 'file:/home/user/Videos/youtube-dl/Sampo [117396].temp.mp4'
[EmbedSubtitle] There aren't any subtitles to embed
[ModifyChapters] SponsorBlock information is unavailable
[Metadata] Adding metadata to "/home/user/Videos/youtube-dl/Sampo [117396].mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:/home/user/Videos/youtube-dl/Sampo [117396].mp4' -map 0 -dn -ignore_unknown -c copy -metadata title=Sampo -metadata 'description=Aleksandr Ptushkon ohjaama, neuvostoliittolais-suomalainen yhteistuotanto Sampo (1959) on Kalevalan tarustoon pohjautuva fantasiaelokuva. Pohjolan emäntä...' -metadata 'synopsis=Aleksandr Ptushkon ohjaama, neuvostoliittolais-suomalainen yhteistuotanto Sampo (1959) on Kalevalan tarustoon pohjautuva fantasiaelokuva. Pohjolan emäntä...' -metadata purl=https://elonet.finna.fi/Record/kavi.elonet_elokuva_117396 -metadata comment=https://elonet.finna.fi/Record/kavi.elonet_elokuva_117396 -movflags +faststart 'file:/home/user/Videos/youtube-dl/Sampo [117396].temp.mp4'
```



Discussion:

Resolving patch:
diff --git a/yt_dlp/extractor/common.py b/yt_dlp/extractor/common.py
--- a/yt_dlp/extractor/common.py
+++ b/yt_dlp/extractor/common.py
@@ -1297,8 +1297,8 @@ def _get_tfa_info(self, note='two-factor verification code'):
     @staticmethod
     def _og_regexes(prop):
         content_re = r'content=(?:"([^"]+?)"|\'([^\']+?)\'|\s*([^\s"\'=<>`]+?))'
-        property_re = (r'(?:name|property)=(?:\'og[:-]%(prop)s\'|"og[:-]%(prop)s"|\s*og[:-]%(prop)s\b)'
-                       % {'prop': re.escape(prop)})
+        property_re = (r'(?:name|property)=(?:\'og%(sep)s%(prop)s\'|"og%(sep)s%(prop)s"|\s*og%(sep)s%(prop)s\b)'
+                       % {'prop': re.escape(prop), 'sep': '(?:&#x3A;|[:-])'})
         template = r'<meta[^>]+?%s[^>]+?%s'
         return [
             template % (property_re, content_re),
diff --git a/yt_dlp/extractor/elonet.py b/yt_dlp/extractor/elonet.py
--- a/yt_dlp/extractor/elonet.py
+++ b/yt_dlp/extractor/elonet.py
@@ -1,30 +1,22 @@
 # coding: utf-8
 from __future__ import unicode_literals
 
-import re
-
 from .common import InfoExtractor
-from ..utils import (
-    base_url,
-    ExtractorError,
-    try_get,
-)
-from ..compat import compat_str
+from ..utils import determine_ext
 
 
 class ElonetIE(InfoExtractor):
     _VALID_URL = r'https?://elonet\.finna\.fi/Record/kavi\.elonet_elokuva_(?P<id>[0-9]+)'
     _TESTS = [{
-        # m3u8 with subtitles
         'url': 'https://elonet.finna.fi/Record/kavi.elonet_elokuva_107867',
-        'md5': '8efc954b96c543711707f87de757caea',
         'info_dict': {
             'id': '107867',
             'ext': 'mp4',
             'title': 'Valkoinen peura',
-            'description': 'Valkoinen peura (1952) on Erik Blombergin ohjaama ja yhdessä Mirjami Kuosmasen kanssa käsikirjoittama tarunomainen kertomus valkoisen peuran hahmossa lii...',
-            'thumbnail': 'https://elonet.finna.fi/Cover/Show?id=kavi.elonet_elokuva_107867&index=0&size=large',
+            'thumbnail': r're:^https?://elonet\.finna\.fi/Cover/Show\?id=kavi\.elonet_elokuva_107867.+',
+            'description': 'md5:bded4201c9677fab10854884fe8f7312',
         },
+        'params': {'skip_download': 'dash'},
     }, {
         # DASH with subtitles
         'url': 'https://elonet.finna.fi/Record/kavi.elonet_elokuva_116539',
@@ -32,58 +24,45 @@ class ElonetIE(InfoExtractor):
             'id': '116539',
             'ext': 'mp4',
             'title': 'Minulla on tiikeri',
-            'description': 'Pienellä pojalla, joka asuu kerrostalossa, on kotieläimenä tiikeri. Se on kuitenkin salaisuus. Kerrostalon räpätäti on Kotilaisen täti, joka on aina vali...',
-            'thumbnail': 'https://elonet.finna.fi/Cover/Show?id=kavi.elonet_elokuva_116539&index=0&size=large&source=Solr',
-        }
+            'thumbnail': r're:^https?://elonet\.finna\.fi/Cover/Show\?id=kavi\.elonet_elokuva_116539.+',
+            'description': 'md5:5ab72b3fe76d3414e46cc8f277104419',
+        },
+        'params': {'skip_download': 'dash'},
+    }, {
+        # Page with multiple videos, download the main one
+        'url': 'https://elonet.finna.fi/Record/kavi.elonet_elokuva_117396',
+        'info_dict': {
+            'id': '117396',
+            'ext': 'mp4',
+            'title': 'Sampo',
+            'thumbnail': r're:^https?://elonet\.finna\.fi/Cover/Show\?id=kavi\.elonet_elokuva_117396.+',
+            'description': 'md5:ec69572a5b054d0ecafe8086b1fa96f7',
+        },
+        'params': {'skip_download': 'dash'},
     }]
 
     def _real_extract(self, url):
         video_id = self._match_id(url)
         webpage = self._download_webpage(url, video_id)
 
-        title = self._html_search_regex(
-            r'<meta .*property="og&#x3A;title" .*content="(.+?)"', webpage, 'title')
-        description = self._html_search_regex(
-            r'<meta .*property="og&#x3A;description" .*content="(.+?)"', webpage, 'description')
-        thumbnail = self._html_search_regex(
-            r'<meta .*property="og&#x3A;image" .*content="(.+?)"', webpage, 'thumbnail')
+        src = self._parse_json(self._html_search_regex(
+            r'id=\'video-data\'[^>]+data-video-sources="([^"]+)"', webpage, 'json'), video_id)[0]['src']
+        ext = determine_ext(src)
 
-        json_s = self._html_search_regex(
-            r'data-video-sources="(.+?)"', webpage, 'json')
-        src = try_get(
-            self._parse_json(json_s, video_id),
-            lambda x: x[0]["src"], compat_str)
-        formats = []
-        subtitles = {}
-        if re.search(r'\.m3u8\??', src):
-            res = self._download_webpage_handle(
-                # elonet servers have certificate problems
-                src.replace('https:', 'http:'), video_id,
-                note='Downloading m3u8 information',
-                errnote='Failed to download m3u8 information')
-            if res:
-                doc, urlh = res
-                url = urlh.geturl()
-                formats, subtitles = self._parse_m3u8_formats_and_subtitles(doc, url)
-                for f in formats:
-                    f['ext'] = 'mp4'
-        elif re.search(r'\.mpd\??', src):
-            res = self._download_xml_handle(
-                src, video_id,
-                note='Downloading MPD manifest',
-                errnote='Failed to download MPD manifest')
-            if res:
-                doc, urlh = res
-                url = base_url(urlh.geturl())
-                formats, subtitles = self._parse_mpd_formats_and_subtitles(doc, mpd_base_url=url)
+        if ext == 'm3u8':
+            formats, subtitles = self._extract_m3u8_formats_and_subtitles(src, video_id, fatal=False)
+        elif ext == 'mpd':
+            formats, subtitles = self._extract_mpd_formats_and_subtitles(src, video_id, fatal=False)
         else:
-            raise ExtractorError("Unknown streaming format")
+            formats, subtitles = [], {}
+            self.raise_no_formats(f'Unknown streaming format {ext}')
+        self._sort_formats(formats)
 
         return {
             'id': video_id,
-            'title': title,
-            'description': description,
-            'thumbnail': thumbnail,
+            'title': self._og_search_title(webpage),
+            'description': self._og_search_description(webpage),
+            'thumbnail': self._og_search_thumbnail(webpage),
             'formats': formats,
             'subtitles': subtitles,
         }


Test patch: