3 from .common
import InfoExtractor
4 from ..utils
import merge_dicts
, url_or_none
7 class AngelIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:www\.)?angel\.com/watch/(?P<series>[^/?#]+)/episode/(?P<id>[\w-]+)/season-(?P<season_number>\d+)/episode-(?P<episode_number>\d+)/(?P<title>[^/?#]+)'
10 'url': 'https://www.angel.com/watch/tuttle-twins/episode/2f3d0382-ea82-4cdc-958e-84fbadadc710/season-1/episode-1/when-laws-give-you-lemons',
11 'md5': '4734e5cfdd64a568e837246aa3eaa524',
13 'id': '2f3d0382-ea82-4cdc-958e-84fbadadc710',
15 'title': 'Tuttle Twins Season 1, Episode 1: When Laws Give You Lemons',
16 'description': 'md5:73b704897c20ab59c433a9c0a8202d5e',
17 'thumbnail': r
're:^https?://images.angelstudios.com/image/upload/angel-app/.*$',
21 'url': 'https://www.angel.com/watch/the-chosen/episode/8dfb714d-bca5-4812-8125-24fb9514cd10/season-1/episode-1/i-have-called-you-by-name',
22 'md5': 'e4774bad0a5f0ad2e90d175cafdb797d',
24 'id': '8dfb714d-bca5-4812-8125-24fb9514cd10',
26 'title': 'The Chosen Season 1, Episode 1: I Have Called You By Name',
27 'description': 'md5:aadfb4827a94415de5ff6426e6dee3be',
28 'thumbnail': r
're:^https?://images.angelstudios.com/image/upload/angel-app/.*$',
33 def _real_extract(self
, url
):
34 video_id
= self
._match
_id
(url
)
35 webpage
= self
._download
_webpage
(url
, video_id
)
37 json_ld
= self
._search
_json
_ld
(webpage
, video_id
)
39 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(
40 json_ld
.pop('url'), video_id
, note
='Downloading HD m3u8 information')
44 'title': self
._og
_search
_title
(webpage
),
45 'description': self
._og
_search
_description
(webpage
),
47 'subtitles': subtitles
,
50 # Angel uses cloudinary in the background and supports image transformations.
51 # We remove these transformations and return the source file
52 base_thumbnail_url
= url_or_none(self
._og
_search
_thumbnail
(webpage
)) or json_ld
.pop('thumbnails')
53 if base_thumbnail_url
:
54 info_dict
['thumbnail'] = re
.sub(r
'(/upload)/.+(/angel-app/.+)$', r
'\1\2', base_thumbnail_url
)
56 return merge_dicts(info_dict
, json_ld
)