mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-02-06 18:20:02 +00:00
[weeklybeats] Add new extractor weeklybeats
This commit is contained in:
parent
609850acfb
commit
dd64d69b7b
@ -1299,6 +1299,7 @@ from .webofstories import (
|
|||||||
WebOfStoriesIE,
|
WebOfStoriesIE,
|
||||||
WebOfStoriesPlaylistIE,
|
WebOfStoriesPlaylistIE,
|
||||||
)
|
)
|
||||||
|
from .weeklybeats import WeeklyBeatsIE
|
||||||
from .weibo import (
|
from .weibo import (
|
||||||
WeiboIE,
|
WeiboIE,
|
||||||
WeiboMobileIE
|
WeiboMobileIE
|
||||||
|
35
youtube_dl/extractor/weeklybeats.py
Normal file
35
youtube_dl/extractor/weeklybeats.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# coding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
class WeeklyBeatsIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?weeklybeats\.com/(.+)/music/(.+)'
|
||||||
|
_TEST = {
|
||||||
|
'url': 'https://weeklybeats.com/pulsn/music/week-1-bass-drop',
|
||||||
|
'md5': '03465d0fa355147822d2ba1100a82c7c',
|
||||||
|
'info_dict': {
|
||||||
|
'id': 'week-1-bass-drop',
|
||||||
|
'ext': 'mp3',
|
||||||
|
'title': 'Week 1: Bass Drip ',
|
||||||
|
'url': 'https://weeklybeats.s3.amazonaws.com/music/2012/pulsn_weeklybeats-2012_1_week-1-bass-drop.mp3',
|
||||||
|
'uploader': 'pulsn',
|
||||||
|
'description': 'A blend of IDM noises mixed with Berlin styled arps and ambient pads.'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
video_id = self._search_regex(r'https://weeklybeats.com/[^/]+/music/([^/]*)/?', url, 'video_id')
|
||||||
|
print(video_id)
|
||||||
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
|
# TODO more code goes here, for example ...
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'title': self._search_regex(r'<meta[^>]+property="og:title"[^>]+content="([^\"]+)"[^>]*>', webpage, 'title', fatal=False),
|
||||||
|
'description': self._search_regex(r'<meta[^>]+property="og:description"[^>]+content="([^\"]*)"[^>]*>', webpage, 'description', fatal=False),
|
||||||
|
'uploader': self._search_regex(r'<a[^>]+class="form_popular_tags ?artist"[^>]*>View by:([^<]+)<', webpage, 'uploader', fatal=False),
|
||||||
|
'url': self._search_regex(r'mp3: \'([^\']+)\'', webpage, 'url')
|
||||||
|
# TODO more properties (see youtube_dl/extractor/common.py)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user