+
+
+class SVTPageIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?svt\.se/(?:[^/]+/)*(?P<id>[^/?&#]+)'
+ _TESTS = [{
+ 'url': 'https://www.svt.se/sport/oseedat/guide-sommartraningen-du-kan-gora-var-och-nar-du-vill',
+ 'info_dict': {
+ 'id': 'guide-sommartraningen-du-kan-gora-var-och-nar-du-vill',
+ 'title': 'GUIDE: Sommarträning du kan göra var och när du vill',
+ },
+ 'playlist_count': 7,
+ }, {
+ 'url': 'https://www.svt.se/nyheter/inrikes/ebba-busch-thor-kd-har-delvis-ratt-om-no-go-zoner',
+ 'info_dict': {
+ 'id': 'ebba-busch-thor-kd-har-delvis-ratt-om-no-go-zoner',
+ 'title': 'Ebba Busch Thor har bara delvis rätt om ”no-go-zoner”',
+ },
+ 'playlist_count': 1,
+ }, {
+ # only programTitle
+ 'url': 'http://www.svt.se/sport/ishockey/jagr-tacklar-giroux-under-intervjun',
+ 'info_dict': {
+ 'id': '2900353',
+ 'ext': 'mp4',
+ 'title': 'Stjärnorna skojar till det - under SVT-intervjun',
+ 'duration': 27,
+ 'age_limit': 0,
+ },
+ }, {
+ 'url': 'https://www.svt.se/nyheter/lokalt/vast/svt-testar-tar-nagon-upp-skrapet-1',
+ 'only_matching': True,
+ }, {
+ 'url': 'https://www.svt.se/vader/manadskronikor/maj2018',
+ 'only_matching': True,
+ }]
+
+ @classmethod
+ def suitable(cls, url):
+ return False if SVTIE.suitable(url) else super(SVTPageIE, cls).suitable(url)
+
+ def _real_extract(self, url):
+ playlist_id = self._match_id(url)
+
+ webpage = self._download_webpage(url, playlist_id)
+
+ entries = [
+ self.url_result(
+ 'svt:%s' % video_id, ie=SVTPlayIE.ie_key(), video_id=video_id)
+ for video_id in orderedSet(re.findall(
+ r'data-video-id=["\'](\d+)', webpage))]
+
+ title = strip_or_none(self._og_search_title(webpage, default=None))
+
+ return self.playlist_result(entries, playlist_id, title)