Compare commits

..

3 Commits

Author SHA1 Message Date
Dmitry Meyer
e81c2c5a18
Fix function call style
Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com>
2024-02-08 12:19:05 +03:00
Dmitry Meyer
c1bea1b88f Escape dots in regexes 2024-02-08 09:16:45 +00:00
Dmitry Meyer
8a936b2ac1
Format imports
Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com>
2024-02-08 12:09:37 +03:00

View File

@ -1,5 +1,13 @@
from .common import InfoExtractor from .common import InfoExtractor
from ..utils import ExtractorError, dict_get, qualities, traverse_obj from .youtube import YoutubeIE
from ..utils import (
ExtractorError,
int_or_none,
qualities,
str_or_none,
url_or_none,
)
from ..utils.traversal import traverse_obj
class BoostyIE(InfoExtractor): class BoostyIE(InfoExtractor):
@ -20,7 +28,7 @@ class BoostyIE(InfoExtractor):
'ext': 'mp4', 'ext': 'mp4',
'duration': 105, 'duration': 105,
'view_count': int, 'view_count': int,
'thumbnail': r're:^https://i.mycdn.me/videoPreview\?', 'thumbnail': r're:^https://i\.mycdn\.me/videoPreview\?',
}, },
}, { }, {
# multiple ok_video # multiple ok_video
@ -44,7 +52,7 @@ class BoostyIE(InfoExtractor):
'ext': 'mp4', 'ext': 'mp4',
'duration': 31204, 'duration': 31204,
'view_count': int, 'view_count': int,
'thumbnail': r're:^https://i.mycdn.me/videoPreview\?', 'thumbnail': r're:^https://i\.mycdn\.me/videoPreview\?',
}, },
}, { }, {
'info_dict': { 'info_dict': {
@ -53,7 +61,7 @@ class BoostyIE(InfoExtractor):
'ext': 'mp4', 'ext': 'mp4',
'duration': 25704, 'duration': 25704,
'view_count': int, 'view_count': int,
'thumbnail': r're:^https://i.mycdn.me/videoPreview\?', 'thumbnail': r're:^https://i\.mycdn\.me/videoPreview\?',
}, },
}, { }, {
'info_dict': { 'info_dict': {
@ -62,7 +70,7 @@ class BoostyIE(InfoExtractor):
'ext': 'mp4', 'ext': 'mp4',
'duration': 31867, 'duration': 31867,
'view_count': int, 'view_count': int,
'thumbnail': r're:^https://i.mycdn.me/videoPreview\?', 'thumbnail': r're:^https://i\.mycdn\.me/videoPreview\?',
}, },
}], }],
}, { }, {
@ -81,7 +89,7 @@ class BoostyIE(InfoExtractor):
'ext': 'mp4', 'ext': 'mp4',
'duration': 816, 'duration': 816,
'view_count': int, 'view_count': int,
'thumbnail': r're:^https://i.ytimg.com/', 'thumbnail': r're:^https://i\.ytimg\.com/',
# youtube fields # youtube fields
'age_limit': 0, 'age_limit': 0,
'availability': 'public', 'availability': 'public',
@ -89,7 +97,7 @@ class BoostyIE(InfoExtractor):
'channel_follower_count': int, 'channel_follower_count': int,
'channel_id': 'UCCzVNbWZfYpBfyofCCUD_0w', 'channel_id': 'UCCzVNbWZfYpBfyofCCUD_0w',
'channel_is_verified': bool, 'channel_is_verified': bool,
'channel_url': r're:^https://www.youtube.com/', 'channel_url': r're:^https://www\.youtube\.com/',
'comment_count': int, 'comment_count': int,
'description': str, 'description': str,
'heatmap': 'count:100', 'heatmap': 'count:100',
@ -97,17 +105,16 @@ class BoostyIE(InfoExtractor):
'playable_in_embed': bool, 'playable_in_embed': bool,
'uploader': str, 'uploader': str,
'uploader_id': str, 'uploader_id': str,
'uploader_url': r're:^https://www.youtube.com/', 'uploader_url': r're:^https://www\.youtube\.com/',
}, },
}] }]
def _real_extract(self, url): def _real_extract(self, url):
user, post_id = self._match_valid_url(url).group('user', 'post_id') user, post_id = self._match_valid_url(url).group('user', 'post_id')
post = self._download_json( post = self._download_json(
f'https://api.boosty.to/v1/blog/{user}/post/{post_id}', f'https://api.boosty.to/v1/blog/{user}/post/{post_id}', post_id,
post_id, note='Downloading post data', errnote='Unable to download post data')
note='Downloading post data',
errnote='Unable to download post data')
post_title = self._extract_title(post, post_id, url) post_title = self._extract_title(post, post_id, url)
entries = self._extract_entries(post, post_id, post_title) entries = self._extract_entries(post, post_id, post_title)
if not entries: if not entries: