mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-22 20:20:09 +09:00
Add kick.com support
This commit is contained in:
parent
2dd6c6edd8
commit
4ae18a5a93
@ -554,6 +554,7 @@ from .khanacademy import (
|
|||||||
KhanAcademyIE,
|
KhanAcademyIE,
|
||||||
KhanAcademyUnitIE,
|
KhanAcademyUnitIE,
|
||||||
)
|
)
|
||||||
|
from .kick import KickIE
|
||||||
from .kickstarter import KickStarterIE
|
from .kickstarter import KickStarterIE
|
||||||
from .kinja import KinjaEmbedIE
|
from .kinja import KinjaEmbedIE
|
||||||
from .kinopoisk import KinoPoiskIE
|
from .kinopoisk import KinoPoiskIE
|
||||||
|
42
youtube_dl/extractor/kick.py
Normal file
42
youtube_dl/extractor/kick.py
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
class KickIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?kick\.com/video/(?P<id>[0-9a-zA-Z-]+)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'https://kick.com/video/82a3c11d-7a17-4747-aecb-2e61413eb11f',
|
||||||
|
'md5': 'f052bc1046cd9ca6751925dd12420010',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '82a3c11d-7a17-4747-aecb-2e61413eb11f',
|
||||||
|
'ext': 'm3u8',
|
||||||
|
'title': 'Weekly Stake Stream',
|
||||||
|
'uploader': 'Eddie',
|
||||||
|
'thumbnail': r're:^https?://.*\.jpg.*$',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
id = self._match_id(url)
|
||||||
|
|
||||||
|
headers = {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'User-Agent': 'Mozilla',
|
||||||
|
}
|
||||||
|
|
||||||
|
data = self._download_json('https://kick.com/api/v1/video/%s' % id, id, headers=headers)
|
||||||
|
|
||||||
|
video_url = data['source']
|
||||||
|
title = data['livestream']['session_title']
|
||||||
|
uploader = data['livestream']['channel']['user']['username']
|
||||||
|
thumbnail = data['livestream']['thumbnail']
|
||||||
|
|
||||||
|
return {
|
||||||
|
'url': video_url,
|
||||||
|
'id': id,
|
||||||
|
'title': title,
|
||||||
|
'uploader': uploader,
|
||||||
|
'thumbnail': thumbnail,
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user