]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/plays.py
3 from .common
import InfoExtractor
4 from ..utils
import int_or_none
7 class PlaysTVIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:www\.)?plays\.tv/(?:video|embeds)/(?P<id>[0-9a-f]{18})'
10 'url': 'https://plays.tv/video/56af17f56c95335490/when-you-outplay-the-azir-wall',
11 'md5': 'dfeac1198506652b5257a62762cec7bc',
13 'id': '56af17f56c95335490',
15 'title': 'Bjergsen - When you outplay the Azir wall',
16 'description': 'Posted by Bjergsen',
19 'url': 'https://plays.tv/embeds/56af17f56c95335490',
20 'only_matching': True,
23 def _real_extract(self
, url
):
24 video_id
= self
._match
_id
(url
)
25 webpage
= self
._download
_webpage
(
26 'https://plays.tv/video/%s' % video_id
, video_id
)
28 info
= self
._search
_json
_ld
(webpage
, video_id
,)
30 mpd_url
, sources
= re
.search(
31 r
'(?s)<video[^>]+data-mpd="([^"]+)"[^>]*>(.+?)</video>',
33 formats
= self
._extract
_mpd
_formats
(
34 self
._proto
_relative
_url
(mpd_url
), video_id
, mpd_id
='DASH')
35 for format_id
, height
, format_url
in re
.findall(r
'<source\s+res="((\d+)h?)"\s+src="([^"]+)"', sources
):
37 'url': self
._proto
_relative
_url
(format_url
),
38 'format_id': 'http-' + format_id
,
39 'height': int_or_none(height
),
41 self
._sort
_formats
(formats
)
45 'description': self
._og
_search
_description
(webpage
),
46 'thumbnail': info
.get('thumbnail') or self
._og
_search
_thumbnail
(webpage
),