mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 01:31:25 +01:00
Compare commits
4 Commits
d15516543b
...
d235676272
Author | SHA1 | Date | |
---|---|---|---|
|
d235676272 | ||
|
4b5eec0aaa | ||
|
886ae0c277 | ||
|
50cdbbaf9c |
|
@ -59,16 +59,15 @@ class ChaturbateIE(InfoExtractor):
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
}, fatal=False, impersonate=True) or {}
|
}, 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')
|
m3u8_url = response.get('url')
|
||||||
if not m3u8_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 {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
|
|
@ -8,12 +8,14 @@ from ..utils import (
|
||||||
str_or_none,
|
str_or_none,
|
||||||
try_call,
|
try_call,
|
||||||
unified_timestamp,
|
unified_timestamp,
|
||||||
|
update_url_query,
|
||||||
)
|
)
|
||||||
from ..utils.traversal import traverse_obj
|
from ..utils.traversal import traverse_obj
|
||||||
|
|
||||||
|
|
||||||
class DuoplayIE(InfoExtractor):
|
class DuoplayIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://duoplay\.ee/(?P<id>\d+)/[\w-]+/?(?:\?(?:[^#]+&)?ep=(?P<ep>\d+))?'
|
# https://duoplay.ee/9644?ep=185
|
||||||
|
_VALID_URL = r'https?://duoplay\.ee/(?P<id>\d+)(?:/[\w-]+/?(?:\?(?:[^#]+&))?ep=(?P<ep>\d+))?'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'note': 'Siberi võmm S02E12',
|
'note': 'Siberi võmm S02E12',
|
||||||
'url': 'https://duoplay.ee/4312/siberi-vomm?ep=24',
|
'url': 'https://duoplay.ee/4312/siberi-vomm?ep=24',
|
||||||
|
@ -79,11 +81,20 @@ class DuoplayIE(InfoExtractor):
|
||||||
if not video_player or not video_player.get('manifest-url'):
|
if not video_player or not video_player.get('manifest-url'):
|
||||||
raise ExtractorError('No video found', expected=True)
|
raise ExtractorError('No video found', expected=True)
|
||||||
|
|
||||||
|
manifest_url = video_player['manifest-url']
|
||||||
|
session_token = self._download_json(
|
||||||
|
'https://sts.postimees.ee/session/register', video_id, 'Registering session',
|
||||||
|
'Unable to register session', headers={
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'X-Original-URI': manifest_url,
|
||||||
|
})['session']
|
||||||
|
manifest_url = update_url_query(manifest_url, {'s': session_token})
|
||||||
|
|
||||||
episode_attr = self._parse_json(video_player.get(':episode') or '', video_id, fatal=False) or {}
|
episode_attr = self._parse_json(video_player.get(':episode') or '', video_id, fatal=False) or {}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'formats': self._extract_m3u8_formats(video_player['manifest-url'], video_id, 'mp4'),
|
'formats': self._extract_m3u8_formats(manifest_url, video_id, 'mp4'),
|
||||||
**traverse_obj(episode_attr, {
|
**traverse_obj(episode_attr, {
|
||||||
'title': 'title',
|
'title': 'title',
|
||||||
'description': 'synopsis',
|
'description': 'synopsis',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user