From 0d90d77b5a98406244bb7fa95633fe6668e44183 Mon Sep 17 00:00:00 2001 From: Robert Sacks Date: Wed, 19 Sep 2018 23:22:33 -0400 Subject: [PATCH] [neatclip] Add new extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/neatclip.py | 48 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 youtube_dl/extractor/neatclip.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 7dc569724..02ede6389 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -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 ( diff --git a/youtube_dl/extractor/neatclip.py b/youtube_dl/extractor/neatclip.py new file mode 100644 index 000000000..2b099d52b --- /dev/null +++ b/youtube_dl/extractor/neatclip.py @@ -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[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'', webpage, 'title').replace(" - NeatClip", "") + url = self._html_search_regex( + r'', webpage, 'url') + thumbnail = self._html_search_regex( + r'', webpage, 'thumbnail', fatal=False) + + return { + 'id': video_id, + 'title': title, + 'url': url, + 'thumbnail': thumbnail + }