1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-23 00:16:48 +00:00

Add kick.com support

This commit is contained in:
Jamil Karami 2023-02-17 16:56:39 +01:00
parent 57802e632f
commit f728a2f01c
2 changed files with 43 additions and 0 deletions

View File

@ -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

View 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,
}