mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-29 10:41:23 +01:00
Compare commits
No commits in common. "ce38da900bab8150de684c5061b3016d8f7b0c77" and "e93c02ab90a69d505f11bc29613648b7259886e1" have entirely different histories.
ce38da900b
...
e93c02ab90
|
@ -1124,11 +1124,7 @@ from .musicdex import (
|
||||||
MusicdexArtistIE,
|
MusicdexArtistIE,
|
||||||
MusicdexPlaylistIE,
|
MusicdexPlaylistIE,
|
||||||
)
|
)
|
||||||
from .mx3 import (
|
from .mx3 import Mx3IE
|
||||||
Mx3IE,
|
|
||||||
Mx3NeoIE,
|
|
||||||
Mx3VolksmusikIE,
|
|
||||||
)
|
|
||||||
from .mxplayer import (
|
from .mxplayer import (
|
||||||
MxplayerIE,
|
MxplayerIE,
|
||||||
MxplayerShowIE,
|
MxplayerShowIE,
|
||||||
|
|
|
@ -6,7 +6,6 @@ from ..networking import HEADRequest
|
||||||
|
|
||||||
|
|
||||||
class Mx3IE(InfoExtractor):
|
class Mx3IE(InfoExtractor):
|
||||||
_MX3_DOMAIN = 'mx3.ch'
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?mx3\.ch/t/(?P<id>[0-9A-Za-z]+)'
|
_VALID_URL = r'https?://(?:www\.)?mx3\.ch/t/(?P<id>[0-9A-Za-z]+)'
|
||||||
_TESTS = [{
|
_TESTS = [{
|
||||||
'url': 'https://mx3.ch/t/1Cru',
|
'url': 'https://mx3.ch/t/1Cru',
|
||||||
|
@ -15,11 +14,10 @@ class Mx3IE(InfoExtractor):
|
||||||
'id': '1Cru',
|
'id': '1Cru',
|
||||||
# This one is audio-only. It's a mp3, but we have to make a HEAD request to find out.
|
# This one is audio-only. It's a mp3, but we have to make a HEAD request to find out.
|
||||||
'ext': 'mp3',
|
'ext': 'mp3',
|
||||||
'artist': 'Tortue Tortue, Godina',
|
'artist': 'Tortue Tortue',
|
||||||
'composer': 'Olivier Godinat',
|
|
||||||
'genre': 'Rock',
|
'genre': 'Rock',
|
||||||
'thumbnail': 'https://mx3.ch/pictures/mx3/file/0101/4643/square_xlarge/1-s-envoler-1.jpg?1630272813',
|
'thumbnail': 'https://mx3.ch/pictures/mx3/file/0101/4643/square_xlarge/1-s-envoler-1.jpg?1630272813',
|
||||||
'title': 'S\'envoler',
|
'title': 'Tortue Tortue - S\'envoler',
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
'url': 'https://mx3.ch/t/1LIY',
|
'url': 'https://mx3.ch/t/1LIY',
|
||||||
|
@ -28,8 +26,7 @@ class Mx3IE(InfoExtractor):
|
||||||
'id': '1LIY',
|
'id': '1LIY',
|
||||||
# This is a music video. 'file' says: ISO Media, MP4 Base Media v1 [ISO 14496-12:2003]
|
# This is a music video. 'file' says: ISO Media, MP4 Base Media v1 [ISO 14496-12:2003]
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'artist': 'The Broots, Tania Kimfumu',
|
'artist': 'The Broots',
|
||||||
'composer': 'Emmanuel Diserens',
|
|
||||||
'genre': 'Electro',
|
'genre': 'Electro',
|
||||||
'thumbnail': 'https://mx3.ch/pictures/mx3/file/0110/0003/video_xlarge/frame_0000.png?1686963670',
|
'thumbnail': 'https://mx3.ch/pictures/mx3/file/0110/0003/video_xlarge/frame_0000.png?1686963670',
|
||||||
'title': 'The Broots-Larytta remix "Begging For Help"',
|
'title': 'The Broots-Larytta remix "Begging For Help"',
|
||||||
|
@ -42,26 +39,21 @@ class Mx3IE(InfoExtractor):
|
||||||
# This one has a download button, yielding a WAV.
|
# This one has a download button, yielding a WAV.
|
||||||
'ext': 'wav',
|
'ext': 'wav',
|
||||||
'artist': 'Alien Bubblegum',
|
'artist': 'Alien Bubblegum',
|
||||||
'composer': 'Alien Bubblegum',
|
|
||||||
'genre': 'Punk',
|
'genre': 'Punk',
|
||||||
'thumbnail': 'https://mx3.ch/pictures/mx3/file/0101/1551/square_xlarge/pandora-s-box-cover-with-title.png?1627054733',
|
'thumbnail': 'https://mx3.ch/pictures/mx3/file/0101/1551/square_xlarge/pandora-s-box-cover-with-title.png?1627054733',
|
||||||
'title': 'Wide Awake',
|
'title': 'Alien Bubblegum - Wide Awake',
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
track_id = self._match_id(url)
|
track_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, track_id)
|
webpage = self._download_webpage(url, track_id)
|
||||||
json = self._download_json(f'https://{self._MX3_DOMAIN}/t/{track_id}.json', track_id)
|
json = self._download_json(f'https://mx3.ch/t/{track_id}.json', track_id)
|
||||||
|
|
||||||
artists = []
|
|
||||||
if json.get('artist'):
|
|
||||||
artists.append(json['artist'])
|
|
||||||
performer = json.get('performer_name')
|
|
||||||
if performer and performer not in artists:
|
|
||||||
artists.append(performer)
|
|
||||||
|
|
||||||
title = json['title']
|
title = json['title']
|
||||||
|
artist = json.get('artist')
|
||||||
|
if artist and not title.startswith(artist):
|
||||||
|
title = artist + ' - ' + title
|
||||||
|
|
||||||
genre = self._html_search_regex(r'<div\b[^>]+class="single-band-genre"[^>]*>([^<]+)</div>',
|
genre = self._html_search_regex(r'<div\b[^>]+class="single-band-genre"[^>]*>([^<]+)</div>',
|
||||||
webpage, 'genre', fatal=False, flags=re.DOTALL)
|
webpage, 'genre', fatal=False, flags=re.DOTALL)
|
||||||
|
@ -74,16 +66,15 @@ class Mx3IE(InfoExtractor):
|
||||||
fmt['ext'] = urlhandle_detect_ext(urlh)
|
fmt['ext'] = urlhandle_detect_ext(urlh)
|
||||||
formats.append(fmt)
|
formats.append(fmt)
|
||||||
|
|
||||||
base_url = 'https://' + self._MX3_DOMAIN + '/'
|
|
||||||
add_format({
|
add_format({
|
||||||
'url': base_url + json["url"],
|
'url': 'https://mx3.ch/' + json['url'],
|
||||||
'format_id': 'default',
|
'format_id': 'default',
|
||||||
'quality': 1,
|
'quality': 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
if 'hd_url' in json:
|
if 'hd_url' in json:
|
||||||
add_format({
|
add_format({
|
||||||
'url': base_url + json['hd_url'],
|
'url': 'https://mx3.ch/' + json['hd_url'],
|
||||||
'format_id': 'hd',
|
'format_id': 'hd',
|
||||||
'quality': 10,
|
'quality': 10,
|
||||||
})
|
})
|
||||||
|
@ -91,7 +82,7 @@ class Mx3IE(InfoExtractor):
|
||||||
# the "download" feature is not available everywhere
|
# the "download" feature is not available everywhere
|
||||||
if f'/tracks/{track_id}/download' in webpage:
|
if f'/tracks/{track_id}/download' in webpage:
|
||||||
add_format({
|
add_format({
|
||||||
'url': f'{base_url}tracks/{track_id}/download',
|
'url': f'https://mx3.ch/tracks/{track_id}/download',
|
||||||
'format_id': 'download',
|
'format_id': 'download',
|
||||||
'quality': 11,
|
'quality': 11,
|
||||||
'format_note': 'usually uncompressed WAV',
|
'format_note': 'usually uncompressed WAV',
|
||||||
|
@ -101,44 +92,7 @@ class Mx3IE(InfoExtractor):
|
||||||
'id': track_id,
|
'id': track_id,
|
||||||
'formats': formats,
|
'formats': formats,
|
||||||
'title': title,
|
'title': title,
|
||||||
'artist': ', '.join(artists),
|
'artist': artist,
|
||||||
'composer': json.get('composer_name', None),
|
|
||||||
'genre': genre,
|
'genre': genre,
|
||||||
'thumbnail': json.get('picture_url_xlarge') or json.get('picture_url'),
|
'thumbnail': json.get('picture_url_xlarge') or json.get('picture_url'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class Mx3NeoIE(Mx3IE):
|
|
||||||
_MX3_DOMAIN = 'neo.mx3.ch'
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?neo.mx3\.ch/t/(?P<id>[0-9A-Za-z]+)'
|
|
||||||
_TESTS = [{
|
|
||||||
'url': 'https://neo.mx3.ch/t/1hpd',
|
|
||||||
'md5': 'ff0b2b91ce0b8931c0a358715758dc78',
|
|
||||||
'info_dict': {
|
|
||||||
'id': '1hpd',
|
|
||||||
'ext': 'mp3',
|
|
||||||
'artist': 'Kammerorchester Basel, Baptiste Lopez',
|
|
||||||
'composer': 'Jannik Giger',
|
|
||||||
'genre': 'Composition, Orchestra',
|
|
||||||
'title': 'Troisième œil. Für Kammerorchester (2023)',
|
|
||||||
'thumbnail': 'https://neo.mx3.ch/pictures/neo/file/0000/0241/square_xlarge/kammerorchester-basel-group-photo-2_c_-lukasz-rajchert.jpg?1560341252'
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
|
|
||||||
|
|
||||||
class Mx3VolksmusikIE(Mx3IE):
|
|
||||||
_MX3_DOMAIN = 'volksmusik.mx3.ch'
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?volksmusik.mx3\.ch/t/(?P<id>[0-9A-Za-z]+)'
|
|
||||||
_TESTS = [{
|
|
||||||
'url': 'https://volksmusik.mx3.ch/t/Zx',
|
|
||||||
'md5': 'dd967a7b0c1ef898f3e072cf9c2eae3c',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'Zx',
|
|
||||||
'ext': 'mp3',
|
|
||||||
'artist': 'Ländlerkapelle GrischArt',
|
|
||||||
'composer': 'Urs Glauser',
|
|
||||||
'genre': 'Instrumental, Graubünden',
|
|
||||||
'title': 'Chämilouf',
|
|
||||||
'thumbnail': 'https://volksmusik.mx3.ch/pictures/vxm/file/0000/3815/square_xlarge/grischart1.jpg?1450530120',
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user