Skip to content

Commit

Permalink
[svtplay] Add support for svt.se/barnkanalen (closes ytdl-org#24817)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed Nov 21, 2020
1 parent 0ada1b9 commit 049f224
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions youtube_dl/extractor/svt.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ class SVTPlayIE(SVTPlayBaseIE):
IE_DESC = 'SVT Play and Öppet arkiv'
_VALID_URL = r'''(?x)
(?:
svt:(?P<svt_id>[^/?#&]+)|
(?:
svt:|
https?://(?:www\.)?svt\.se/barnkanalen/barnplay/[^/]+/
)
(?P<svt_id>[^/?#&]+)|
https?://(?:www\.)?(?:svtplay|oppetarkiv)\.se/(?:video|klipp|kanaler)/(?P<id>[^/?#&]+)
)
'''
Expand Down Expand Up @@ -185,6 +189,12 @@ class SVTPlayIE(SVTPlayBaseIE):
}, {
'url': 'svt:14278044',
'only_matching': True,
}, {
'url': 'https://www.svt.se/barnkanalen/barnplay/kar/eWv5MLX/',
'only_matching': True,
}, {
'url': 'svt:eWv5MLX',
'only_matching': True,
}]

def _adjust_title(self, info):
Expand Down Expand Up @@ -376,7 +386,7 @@ class SVTPageIE(InfoExtractor):

@classmethod
def suitable(cls, url):
return False if SVTIE.suitable(url) else super(SVTPageIE, cls).suitable(url)
return False if SVTIE.suitable(url) or SVTPlayIE.suitable(url) else super(SVTPageIE, cls).suitable(url)

def _real_extract(self, url):
path, display_id = re.match(self._VALID_URL, url).groups()
Expand Down

0 comments on commit 049f224

Please sign in to comment.