mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-22 16:44:32 +01:00
[Smashcustommusic] Add new extractor
git add youtube_dl/extractor/smashcustommusic.py
This commit is contained in:
parent
f0298f653e
commit
68ee45cdfd
@ -975,6 +975,7 @@ from .skysports import SkySportsIE
|
|||||||
from .slideshare import SlideshareIE
|
from .slideshare import SlideshareIE
|
||||||
from .slideslive import SlidesLiveIE
|
from .slideslive import SlidesLiveIE
|
||||||
from .slutload import SlutloadIE
|
from .slutload import SlutloadIE
|
||||||
|
from .smashcustommusic import SmashcustommusicIE
|
||||||
from .smotri import (
|
from .smotri import (
|
||||||
SmotriIE,
|
SmotriIE,
|
||||||
SmotriCommunityIE,
|
SmotriCommunityIE,
|
||||||
|
48
youtube_dl/extractor/smashcustommusic.py
Normal file
48
youtube_dl/extractor/smashcustommusic.py
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
from ..utils import (
|
||||||
|
urljoin,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
_BASE_URL_ = 'https://www.smashcustommusic.com'
|
||||||
|
|
||||||
|
class SmashcustommusicIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?smashcustommusic\.com/(?P<id>[0-9]+)'
|
||||||
|
_TESTS = [{
|
||||||
|
'url': 'https://smashcustommusic.com/1',
|
||||||
|
'md5': 'a5bc179893861998be3d12bfe47295a5',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '1',
|
||||||
|
'ext': 'mp3',
|
||||||
|
'title': 'Chrono Cross: Ancient Dragon\'s Stronghold',
|
||||||
|
},
|
||||||
|
}, {
|
||||||
|
'url': 'https://smashcustommusic.com/29660',
|
||||||
|
'md5': '17bd3fc26e0776ca6066058e1f118520',
|
||||||
|
'info_dict': {
|
||||||
|
'id': '29660',
|
||||||
|
'ext': 'mp3',
|
||||||
|
'title': 'Gyakuten Saiban 2 (GBA): Eccentric',
|
||||||
|
},
|
||||||
|
}]
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
playurl = '/play/'
|
||||||
|
song_id = self._match_id(url)
|
||||||
|
webpage = self._download_webpage(url, song_id)
|
||||||
|
|
||||||
|
title = self._html_search_regex(r'<h1 style="text-align:center;">(.+?)</h1>', webpage, 'title')
|
||||||
|
url = urljoin(_BASE_URL_, playurl)
|
||||||
|
url = urljoin(url, song_id)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': song_id,
|
||||||
|
'title': title,
|
||||||
|
'url': url,
|
||||||
|
'ext': 'mp3',
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user