mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-02 16:42:53 +01:00
[alaa] Add playlist extractor
This commit is contained in:
parent
c58afad362
commit
42c767c7a5
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user