Compare commits

...

6 Commits

Author SHA1 Message Date
E1ven
f409ff1232
Merge 5b379e508e into 4b5eec0aaa 2024-11-25 08:32:59 +05:30
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
bashonly
5b379e508e
Merge branch 'master' into dropout-show-fix 2024-06-12 02:04:02 -05:00
bashonly
31f1114ebd
Merge branch 'master' into dropout-show-fix 2024-05-28 15:54:23 -05:00
Git User
1f5be51ea1 linting fix 2024-02-26 15:03:16 -05:00
Git User
feb1ae5715 Add support for downloading a show from Dropout, with all seasons 2024-02-26 14:59:15 -05:00
3 changed files with 51 additions and 27 deletions

View File

@ -554,6 +554,7 @@
from .dropout import (
DropoutIE,
DropoutSeasonIE,
DropoutShowIE,
)
from .drtuber import DrTuberIE
from .drtv import (

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

@ -1,4 +1,5 @@
import functools
import re
from .common import InfoExtractor
from .vimeo import VHXEmbedIE
@ -167,7 +168,8 @@ def _real_extract(self, url):
class DropoutSeasonIE(InfoExtractor):
_PAGE_SIZE = 24
_VALID_URL = r'https?://(?:www\.)?dropout\.tv/(?P<id>[^\/$&?#]+)(?:/?$|/season:(?P<season>[0-9]+)/?$)'
_VALID_URL = r'https?://(?:www\.)?dropout\.tv/(?P<id>[^\/$&?#]+)(?:/season:(?P<season>[0-9]+))/?$'
_TESTS = [
{
'url': 'https://www.dropout.tv/dimension-20-fantasy-high/season:1',
@ -178,24 +180,6 @@ class DropoutSeasonIE(InfoExtractor):
'title': 'Dimension 20 Fantasy High - Season 1',
},
},
{
'url': 'https://www.dropout.tv/dimension-20-fantasy-high',
'note': 'Multi-season series with the season not in the url',
'playlist_count': 24,
'info_dict': {
'id': 'dimension-20-fantasy-high-season-1',
'title': 'Dimension 20 Fantasy High - Season 1',
},
},
{
'url': 'https://www.dropout.tv/dimension-20-shriek-week',
'note': 'Single-season series',
'playlist_count': 4,
'info_dict': {
'id': 'dimension-20-shriek-week-season-1',
'title': 'Dimension 20 Shriek Week - Season 1',
},
},
{
'url': 'https://www.dropout.tv/breaking-news-no-laugh-newsroom/season:3',
'note': 'Multi-season series with season in the url that requires pagination',
@ -222,3 +206,43 @@ def _real_extract(self, url):
return self.playlist_result(
OnDemandPagedList(functools.partial(self._fetch_page, url, season_id), self._PAGE_SIZE),
f'{season_id}-season-{season_num}', f'{season_title} - Season {season_num}')
class DropoutShowIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?dropout\.tv/(?P<id>[^\/$&?#]+)/?$'
_TEST = {
'url': 'https://www.dropout.tv/dirty-laundry/',
'info_dict': {
'id': 'dirty-laundry',
'title': 'Dirty Laundry',
},
'playlist_mincount': 3,
}
def _real_extract(self, url):
show_id = self._match_id(url)
webpage = self._download_webpage(url, show_id)
show_title = self._html_search_regex(
r'<h1[^>]*>(.+?)</h1>', webpage, 'show title',
default=None) or show_id.replace('-', ' ').title()
season_urls = re.findall(r'<option value="([^"]+)"', webpage)
entries = []
for season_url in season_urls:
season_id = self._search_regex(
r'/season:(\d+)', season_url, 'season id', default=None)
if not season_id: # This continues if the season ID wasn't found in the URL
continue
season_entries = self.url_result(
season_url,
ie=DropoutSeasonIE.ie_key(),
video_id=f'{show_id}-season-{season_id}')
entries.append(season_entries)
if not entries:
self.raise_no_formats('No seasons found on the show page.', video_id=show_id)
return self.playlist_result(entries, show_id, show_title)