mirror of
https://github.com/l1ving/youtube-dl
synced 2020-11-18 19:53:54 -08:00
[neatclip] Add new extractor
This commit is contained in:
parent
4ac73fc170
commit
0d90d77b5a
@ -693,6 +693,7 @@ from .ndr import (
|
||||
NJoyEmbedIE,
|
||||
)
|
||||
from .ndtv import NDTVIE
|
||||
from .neatclip import NeatclipIE
|
||||
from .netzkino import NetzkinoIE
|
||||
from .nerdcubed import NerdCubedFeedIE
|
||||
from .neteasemusic import (
|
||||
|
48
youtube_dl/extractor/neatclip.py
Normal file
48
youtube_dl/extractor/neatclip.py
Normal file
@ -0,0 +1,48 @@
|
||||
# coding: utf-8
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from .common import InfoExtractor
|
||||
|
||||
|
||||
class NeatclipIE(InfoExtractor):
|
||||
_VALID_URL = r'https?://(?:www\.)?neatclip\.com/clip/(?P<id>[a-z0-9]+)'
|
||||
_TESTS = [
|
||||
{
|
||||
'url': 'https://neatclip.com/clip/q8n74r9eg',
|
||||
'md5': 'b9f49690141d1aa35d48f6bd27102956',
|
||||
'info_dict': {
|
||||
'id': 'q8n74r9eg',
|
||||
'ext': 'mp4',
|
||||
'title': 'Allu 1v2 with KQLY shot',
|
||||
'thumbnail': r're:^https?://.*\.png$',
|
||||
}
|
||||
},
|
||||
{
|
||||
'url': 'https://neatclip.com/clip/48glvl7ew',
|
||||
'md5': '2b2629e1f2677787b67f9d34071ee57e',
|
||||
'info_dict': {
|
||||
'id': '48glvl7ew',
|
||||
'ext': 'mp4',
|
||||
'title': 'DansGaming notices something fishy',
|
||||
'thumbnail': r're:^https?://.*\.png$',
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
|
||||
title = self._html_search_regex(
|
||||
r'<meta property="og:title" content="(.+?)" />', webpage, 'title').replace(" - NeatClip", "")
|
||||
url = self._html_search_regex(
|
||||
r'<meta property="og:video:url" content="(.+?)" />', webpage, 'url')
|
||||
thumbnail = self._html_search_regex(
|
||||
r'<meta property="og:image" content="(.+?)" />', webpage, 'thumbnail', fatal=False)
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': title,
|
||||
'url': url,
|
||||
'thumbnail': thumbnail
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user