1 from .common
import InfoExtractor
2 from .zype
import ZypeIE
3 from ..utils
import traverse_obj
6 class OfTVIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?:www\.)?of\.tv/video/(?P<id>\w+)'
9 'url': 'https://of.tv/video/627d7d95b353db0001dadd1a',
10 'md5': 'cb9cd5db3bb9ee0d32bfd7e373d6ef0a',
12 'id': '627d7d95b353db0001dadd1a',
14 'title': 'E1: Jacky vs Eric',
15 'thumbnail': r
're:^https?://.*\.jpg',
17 'description': 'md5:dd16e3e2a8d27d922e7a989f85986853',
20 'timestamp': 1652391300,
21 'upload_date': '20220512',
23 'creator': 'This is Fire',
27 def _real_extract(self
, url
):
28 video_id
= self
._match
_id
(url
)
29 webpage
= self
._download
_webpage
(url
, video_id
)
30 info
= next(ZypeIE
.extract_from_webpage(self
._downloader
, url
, webpage
))
31 info
['_type'] = 'url_transparent'
32 info
['creator'] = self
._search
_regex
(r
'<a[^>]+class=\"creator-name\"[^>]+>([^<]+)', webpage
, 'creator')
36 class OfTVPlaylistIE(InfoExtractor
):
37 _VALID_URL
= r
'https?://(?:www\.)?of\.tv/creators/(?P<id>[a-zA-Z0-9-]+)/?(?:$|[?#])'
39 'url': 'https://of.tv/creators/this-is-fire/',
46 def _real_extract(self
, url
):
47 playlist_id
= self
._match
_id
(url
)
48 webpage
= self
._download
_webpage
(url
, playlist_id
)
50 json_match
= self
._search
_json
(
51 r
'var\s*remaining_videos\s*=', webpage
, 'oftv playlists', playlist_id
, contains_pattern
=r
'\[.+\]')
53 return self
.playlist_from_matches(
54 traverse_obj(json_match
, (..., 'discovery_url')), playlist_id
)