|
|
@ -6,6 +6,7 @@ from ..utils import (
|
|
|
|
int_or_none,
|
|
|
|
int_or_none,
|
|
|
|
parse_resolution,
|
|
|
|
parse_resolution,
|
|
|
|
str_or_none,
|
|
|
|
str_or_none,
|
|
|
|
|
|
|
|
traverse_obj,
|
|
|
|
try_get,
|
|
|
|
try_get,
|
|
|
|
unified_timestamp,
|
|
|
|
unified_timestamp,
|
|
|
|
url_or_none,
|
|
|
|
url_or_none,
|
|
|
@ -18,20 +19,21 @@ class PuhuTVIE(InfoExtractor):
|
|
|
|
IE_NAME = 'puhutv'
|
|
|
|
IE_NAME = 'puhutv'
|
|
|
|
_TESTS = [{
|
|
|
|
_TESTS = [{
|
|
|
|
# film
|
|
|
|
# film
|
|
|
|
'url': 'https://puhutv.com/sut-kardesler-izle',
|
|
|
|
'url': 'https://puhutv.com/bi-kucuk-eylul-meselesi-izle',
|
|
|
|
'md5': 'a347470371d56e1585d1b2c8dab01c96',
|
|
|
|
'md5': '4de98170ccb84c05779b1f046b3c86f8',
|
|
|
|
'info_dict': {
|
|
|
|
'info_dict': {
|
|
|
|
'id': '5085',
|
|
|
|
'id': '11909',
|
|
|
|
'display_id': 'sut-kardesler',
|
|
|
|
'display_id': 'bi-kucuk-eylul-meselesi',
|
|
|
|
'ext': 'mp4',
|
|
|
|
'ext': 'mp4',
|
|
|
|
'title': 'Süt Kardeşler',
|
|
|
|
'title': 'Bi Küçük Eylül Meselesi',
|
|
|
|
'description': 'md5:ca09da25b7e57cbb5a9280d6e48d17aa',
|
|
|
|
'description': 'md5:c2ab964c6542b7b26acacca0773adce2',
|
|
|
|
'thumbnail': r're:^https?://.*\.jpg$',
|
|
|
|
'thumbnail': r're:^https?://.*\.jpg$',
|
|
|
|
'duration': 4832.44,
|
|
|
|
'duration': 6176.96,
|
|
|
|
'creator': 'Arzu Film',
|
|
|
|
'creator': 'Ay Yapım',
|
|
|
|
'timestamp': 1561062602,
|
|
|
|
'creators': ['Ay Yapım'],
|
|
|
|
|
|
|
|
'timestamp': 1561062749,
|
|
|
|
'upload_date': '20190620',
|
|
|
|
'upload_date': '20190620',
|
|
|
|
'release_year': 1976,
|
|
|
|
'release_year': 2014,
|
|
|
|
'view_count': int,
|
|
|
|
'view_count': int,
|
|
|
|
'tags': list,
|
|
|
|
'tags': list,
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -181,7 +183,7 @@ class PuhuTVSerieIE(InfoExtractor):
|
|
|
|
'playlist_mincount': 205,
|
|
|
|
'playlist_mincount': 205,
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
# a film detail page which is using same url with serie page
|
|
|
|
# a film detail page which is using same url with serie page
|
|
|
|
'url': 'https://puhutv.com/kaybedenler-kulubu-detay',
|
|
|
|
'url': 'https://puhutv.com/bizim-icin-sampiyon-detay',
|
|
|
|
'only_matching': True,
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
|
@ -194,24 +196,19 @@ class PuhuTVSerieIE(InfoExtractor):
|
|
|
|
has_more = True
|
|
|
|
has_more = True
|
|
|
|
while has_more is True:
|
|
|
|
while has_more is True:
|
|
|
|
season = self._download_json(
|
|
|
|
season = self._download_json(
|
|
|
|
f'https://galadriel.puhutv.com/seasons/{season_id}',
|
|
|
|
f'https://appservice.puhutv.com/api/seasons/{season_id}/episodes?v=2',
|
|
|
|
season_id, f'Downloading page {page}', query={
|
|
|
|
season_id, f'Downloading page {page}', query={
|
|
|
|
'page': page,
|
|
|
|
'page': page,
|
|
|
|
'per': 40,
|
|
|
|
'per': 100,
|
|
|
|
})
|
|
|
|
})['data']
|
|
|
|
episodes = season.get('episodes')
|
|
|
|
|
|
|
|
if isinstance(episodes, list):
|
|
|
|
for episode in traverse_obj(season, ('episodes', lambda _, v: v.get('slug') or v['assets'][0]['slug'])):
|
|
|
|
for ep in episodes:
|
|
|
|
slug = episode.get('slug') or episode['assets'][0]['slug']
|
|
|
|
slug_path = str_or_none(ep.get('slugPath'))
|
|
|
|
yield self.url_result(
|
|
|
|
if not slug_path:
|
|
|
|
f'https://puhutv.com/{slug}', PuhuTVIE, episode.get('id'), episode.get('name'))
|
|
|
|
continue
|
|
|
|
|
|
|
|
video_id = str_or_none(int_or_none(ep.get('id')))
|
|
|
|
|
|
|
|
yield self.url_result(
|
|
|
|
|
|
|
|
f'https://puhutv.com/{slug_path}',
|
|
|
|
|
|
|
|
ie=PuhuTVIE.ie_key(), video_id=video_id,
|
|
|
|
|
|
|
|
video_title=ep.get('name') or ep.get('eventLabel'))
|
|
|
|
|
|
|
|
page += 1
|
|
|
|
page += 1
|
|
|
|
has_more = season.get('hasMore')
|
|
|
|
has_more = traverse_obj(season, 'has_more')
|
|
|
|
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
|
|
|
def _real_extract(self, url):
|
|
|
|
playlist_id = self._match_id(url)
|
|
|
|
playlist_id = self._match_id(url)
|
|
|
@ -226,7 +223,6 @@ class PuhuTVSerieIE(InfoExtractor):
|
|
|
|
self._extract_entries(seasons), playlist_id, info.get('name'))
|
|
|
|
self._extract_entries(seasons), playlist_id, info.get('name'))
|
|
|
|
|
|
|
|
|
|
|
|
# For films, these are using same url with series
|
|
|
|
# For films, these are using same url with series
|
|
|
|
video_id = info.get('slug') or info['assets'][0]['slug']
|
|
|
|
video_id = (info['slug'] or info['assets'][0]['slug']).removesuffix('-detay').removesuffix('-izle')
|
|
|
|
return self.url_result(
|
|
|
|
return self.url_result(
|
|
|
|
f'https://puhutv.com/{video_id}-izle',
|
|
|
|
f'https://puhutv.com/{video_id}-izle', PuhuTVIE, video_id)
|
|
|
|
PuhuTVIE.ie_key(), video_id)
|
|
|
|
|
|
|
|