[cleanup] Misc (#8968)
[yt-dlp.git] / yt_dlp / extractor / beatbump.py
blob777a1b3268dfd5c90a21f5d2f1fa9d62cf20618e
1 from .common import InfoExtractor
2 from .youtube import YoutubeIE, YoutubeTabIE
5 class BeatBumpVideoIE(InfoExtractor):
6 _VALID_URL = r'https?://beatbump\.(?:ml|io)/listen\?id=(?P<id>[\w-]+)'
7 _TESTS = [{
8 'url': 'https://beatbump.ml/listen?id=MgNrAu2pzNs',
9 'md5': '5ff3fff41d3935b9810a9731e485fe66',
10 'info_dict': {
11 'id': 'MgNrAu2pzNs',
12 'ext': 'mp4',
13 'artist': 'Stephen',
14 'thumbnail': 'https://i.ytimg.com/vi_webp/MgNrAu2pzNs/maxresdefault.webp',
15 'channel_url': 'https://www.youtube.com/channel/UC-pWHpBjdGG69N9mM2auIAA',
16 'upload_date': '20190312',
17 'categories': ['Music'],
18 'playable_in_embed': True,
19 'duration': 169,
20 'like_count': int,
21 'alt_title': 'Voyeur Girl',
22 'view_count': int,
23 'track': 'Voyeur Girl',
24 'uploader': 'Stephen',
25 'title': 'Voyeur Girl',
26 'channel_follower_count': int,
27 'age_limit': 0,
28 'availability': 'public',
29 'live_status': 'not_live',
30 'album': 'it\'s too much love to know my dear',
31 'channel': 'Stephen',
32 'comment_count': int,
33 'description': 'md5:7ae382a65843d6df2685993e90a8628f',
34 'tags': 'count:11',
35 'creator': 'Stephen',
36 'channel_id': 'UC-pWHpBjdGG69N9mM2auIAA',
37 'channel_is_verified': True,
38 'heatmap': 'count:100',
40 }, {
41 'url': 'https://beatbump.io/listen?id=LDGZAprNGWo',
42 'only_matching': True,
45 def _real_extract(self, url):
46 id_ = self._match_id(url)
47 return self.url_result(f'https://music.youtube.com/watch?v={id_}', YoutubeIE, id_)
50 class BeatBumpPlaylistIE(InfoExtractor):
51 _VALID_URL = r'https?://beatbump\.(?:ml|io)/(?:release\?id=|artist/|playlist/)(?P<id>[\w-]+)'
52 _TESTS = [{
53 'url': 'https://beatbump.ml/release?id=MPREb_gTAcphH99wE',
54 'playlist_count': 50,
55 'info_dict': {
56 'id': 'OLAK5uy_l1m0thk3g31NmIIz_vMIbWtyv7eZixlH0',
57 'availability': 'unlisted',
58 'view_count': int,
59 'title': 'Album - Royalty Free Music Library V2 (50 Songs)',
60 'description': '',
61 'tags': [],
62 'modified_date': '20231110',
64 'expected_warnings': ['YouTube Music is not directly supported'],
65 }, {
66 'url': 'https://beatbump.ml/artist/UC_aEa8K-EOJ3D6gOs7HcyNg',
67 'playlist_mincount': 1,
68 'params': {'flatplaylist': True},
69 'info_dict': {
70 'id': 'UC_aEa8K-EOJ3D6gOs7HcyNg',
71 'uploader_url': 'https://www.youtube.com/@NoCopyrightSounds',
72 'channel_url': 'https://www.youtube.com/channel/UC_aEa8K-EOJ3D6gOs7HcyNg',
73 'uploader_id': '@NoCopyrightSounds',
74 'channel_follower_count': int,
75 'title': 'NoCopyrightSounds',
76 'uploader': 'NoCopyrightSounds',
77 'description': 'md5:cd4fd53d81d363d05eee6c1b478b491a',
78 'channel': 'NoCopyrightSounds',
79 'tags': 'count:65',
80 'channel_id': 'UC_aEa8K-EOJ3D6gOs7HcyNg',
81 'channel_is_verified': True,
83 'expected_warnings': ['YouTube Music is not directly supported'],
84 }, {
85 'url': 'https://beatbump.ml/playlist/VLPLRBp0Fe2GpgmgoscNFLxNyBVSFVdYmFkq',
86 'playlist_mincount': 1,
87 'params': {'flatplaylist': True},
88 'info_dict': {
89 'id': 'PLRBp0Fe2GpgmgoscNFLxNyBVSFVdYmFkq',
90 'uploader_url': 'https://www.youtube.com/@NoCopyrightSounds',
91 'description': 'Providing you with copyright free / safe music for gaming, live streaming, studying and more!',
92 'view_count': int,
93 'channel_url': 'https://www.youtube.com/channel/UC_aEa8K-EOJ3D6gOs7HcyNg',
94 'uploader_id': '@NoCopyrightSounds',
95 'title': 'NCS : All Releases 💿',
96 'uploader': 'NoCopyrightSounds',
97 'availability': 'public',
98 'channel': 'NoCopyrightSounds',
99 'tags': [],
100 'modified_date': '20231112',
101 'channel_id': 'UC_aEa8K-EOJ3D6gOs7HcyNg',
103 'expected_warnings': ['YouTube Music is not directly supported'],
104 }, {
105 'url': 'https://beatbump.io/playlist/VLPLFCHGavqRG-q_2ZhmgU2XB2--ZY6irT1c',
106 'only_matching': True,
109 def _real_extract(self, url):
110 id_ = self._match_id(url)
111 return self.url_result(f'https://music.youtube.com/browse/{id_}', YoutubeTabIE, id_)