1 from .vidyard
import VidyardBaseIE
2 from ..utils
import ExtractorError
, int_or_none
, make_archive_id
5 class SwearnetEpisodeIE(VidyardBaseIE
):
6 _VALID_URL
= r
'https?://www\.swearnet\.com/shows/(?P<id>[\w-]+)/seasons/(?P<season_num>\d+)/episodes/(?P<episode_num>\d+)'
8 'url': 'https://www.swearnet.com/shows/gettin-learnt-with-ricky/seasons/1/episodes/1',
10 'id': 'wicK2EOzjOdxkUXGDIgcPw',
11 'display_id': '232819',
14 'episode': 'Episode 1',
16 'description': r
're:Are you drunk and high and craving a grilled cheese sandwich.+',
18 'title': 'Episode 1 - Grilled Cheese Sammich',
20 'thumbnail': 'https://cdn.vidyard.com/thumbnails/custom/0dd74f9b-388a-452e-b570-b407fb64435b_small.jpg',
21 'tags': ['Getting Learnt with Ricky', 'drunk', 'grilled cheese', 'high'],
22 '_old_archive_ids': ['swearnetepisode 232819'],
26 def _real_extract(self
, url
):
27 slug
, season_number
, episode_number
= self
._match
_valid
_url
(url
).group('id', 'season_num', 'episode_num')
28 webpage
= self
._download
_webpage
(url
, slug
)
31 external_id
= self
._search
_regex
(r
'externalid\s*=\s*"([^"]+)', webpage
, 'externalid')
32 except ExtractorError
:
33 if 'Upgrade Now' in webpage
:
34 self
.raise_login_required()
37 info
= self
._process
_video
_json
(self
._fetch
_video
_json
(external_id
)['chapters'][0], external_id
)
38 if info
.get('display_id'):
39 info
['_old_archive_ids'] = [make_archive_id(self
, info
['display_id'])]
43 'season_number': int_or_none(season_number
),
44 'episode_number': int_or_none(episode_number
),