[alaa] Add playlist extractor

This commit is contained in:
mimvahedi 2023-12-13 00:24:16 +03:30
parent c58afad362
commit 42c767c7a5
2 changed files with 24 additions and 1 deletions

View File

@ -50,3 +50,23 @@ class AlaaIE(InfoExtractor):
'thumbnail': url_or_none(video_image),
'duration': int_or_none(parse_duration(video_details.get('duration') + ":00"))
}
class AlaaPlaylistIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?alaatv.com/set/(?P<id>[0-9]+)'
_TEST = {
'url': 'https://alaatv.com/set/181',
'info_dict': {
'title': 'صفر تا صد فیزیک یازدهم - فرشید داداشی',
'id': '181',
},
'playlist_count': 81,
}
def _real_extract(self, url):
set_id = self._match_id(url)
set_data = self._download_json('https://alaatv.com/api/v2/set/{0}'.format(set_id), set_id)
set_title = set_data['data']['title']
set_content = map(lambda x: x['url']['web'], set_data['data']['content'])
return self.playlist_result(set_content, set_id, set_title)

View File

@ -39,7 +39,10 @@ from .aenetworks import (
from .afreecatv import AfreecaTVIE
from .airmozilla import AirMozillaIE
from .aljazeera import AlJazeeraIE
from .alaa import AlaaIE
from .alaa import (
AlaaIE,
AlaaPlaylistIE
)
from .alphaporno import AlphaPornoIE
from .amara import AmaraIE
from .amcnetworks import AMCNetworksIE