Compare commits

...

8 Commits

Author SHA1 Message Date
Mozi
f6e80bd30e
Merge 8503b2b62c into 4b5eec0aaa 2024-11-25 11:36:36 +02:00
Jakob Kruse
4b5eec0aaa
[ie/chaturbate] Fix support for non-public streams (#11624)
Fix bug in 720b3dc453

Closes #11623
Authored by: jkruse
2024-11-24 22:20:30 +00:00
Mozi
8503b2b62c minor style changes 2024-11-22 16:11:13 +00:00
Mozi
2aeebc40ea merge 'master' 2024-11-22 16:08:04 +00:00
Mozi
25fbd01c3c no leading empty line 2024-10-17 15:43:55 +00:00
Mozi
8b5ba28892 merge 'master' 2024-10-17 15:37:02 +00:00
Mozi
ef9acc949e BRIGHTCOVE_URL_TEMPLATE 2024-10-17 15:35:51 +00:00
Mozi
7395ddbee1 [ie/DrTalks] Add extractor 2024-08-23 05:44:42 +00:00
3 changed files with 60 additions and 8 deletions

View File

@ -555,6 +555,7 @@
DropoutIE,
DropoutSeasonIE,
)
from .drtalks import DrTalksIE
from .drtuber import DrTuberIE
from .drtv import (
DRTVIE,

View File

@ -59,16 +59,15 @@ def _extract_from_api(self, video_id, tld):
'Accept': 'application/json',
}, fatal=False, impersonate=True) or {}
status = response.get('room_status')
if status != 'public':
if error := self._ERROR_MAP.get(status):
raise ExtractorError(error, expected=True)
self.report_warning('Falling back to webpage extraction')
return None
m3u8_url = response.get('url')
if not m3u8_url:
self.raise_geo_restricted()
status = response.get('room_status')
if error := self._ERROR_MAP.get(status):
raise ExtractorError(error, expected=True)
if status == 'public':
self.raise_geo_restricted()
self.report_warning(f'Got status "{status}" from API; falling back to webpage extraction')
return None
return {
'id': video_id,

View File

@ -0,0 +1,52 @@
from .brightcove import BrightcoveNewIE
from .common import InfoExtractor
from ..utils import extract_attributes, smuggle_url
class DrTalksIE(InfoExtractor):
_VALID_URL = r'https?://event\.drtalks\.com/(?P<id>.+/[^/]+)/?'
_TESTS = [{
'url': 'https://event.drtalks.com/reversing-heart-disease-summit/free-access-day-1',
'info_dict': {
'id': '1758074870279626053',
'title': 'Free Access Day 1 - Events at DrTalks',
'thumbnail': r're:https://event.drtalks.com/wp-content/uploads/.+',
},
'playlist_mincount': 11,
'params': {
'skip_download': True,
},
}, {
'url': 'https://event.drtalks.com/bioenergetics-2022/free-access-day-1/',
'info_dict': {
'id': '1747611460188466596',
'title': 'The BioEnergetics Summit',
'thumbnail': r're:https://event.drtalks.com/wp-content/uploads/.+',
},
'playlist_mincount': 8,
'params': {
'skip_download': True,
},
}, {
'url': 'https://event.drtalks.com/mitochondrial-summit/encore-access-day-6',
'only_matching': True,
}, {
'url': 'https://event.drtalks.com/medicine-of-mindset-summit/free-access-day-1/',
'only_matching': True,
}]
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/%s_%s/index.html?playlistId=%s'
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
player_attrs = extract_attributes(self._search_regex(
r'(<video-js[^>]+\bid=(["\'])myPlayerID\2[^>]*>)', webpage, 'player'))
bc_url = smuggle_url(self.BRIGHTCOVE_URL_TEMPLATE % (
player_attrs.get('data-account', '6314452011001'),
player_attrs.get('data-player', 'f3rfrCUjm'),
player_attrs.get('data-embed', 'default'),
player_attrs['data-playlist-id']), {'source_url': url})
return self.url_result(
bc_url, BrightcoveNewIE, video_id, self._og_search_title(webpage),
url_transparent=True, thumbnail=self._og_search_thumbnail(webpage))