From a0e2511a52029419b7f97c8a172662ca12a0593d Mon Sep 17 00:00:00 2001 From: TRox1972 Date: Sun, 12 Jun 2016 03:18:56 +0200 Subject: [PATCH 1/7] [Vidbit] Add new extractor --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/vidbit.py | 31 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 youtube_dl/extractor/vidbit.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 36ddc1f73..0ef7e420d 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -902,6 +902,7 @@ from .vice import ( ViceIE, ViceShowIE, ) +from .vidbit import VidbitIE from .viddler import ViddlerIE from .videodetective import VideoDetectiveIE from .videofyme import VideofyMeIE diff --git a/youtube_dl/extractor/vidbit.py b/youtube_dl/extractor/vidbit.py new file mode 100644 index 000000000..49a57a45b --- /dev/null +++ b/youtube_dl/extractor/vidbit.py @@ -0,0 +1,31 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class VidbitIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?vidbit\.co/watch\?v=(?P[\w-]+)' + _TEST = { + 'url': 'http://www.vidbit.co/watch?v=MrM7LeaMJq', + 'md5': 'f1a579a93282a78de7e1c53220ef0f12', + 'info_dict': { + 'id': 'MrM7LeaMJq', + 'ext': 'mp4', + 'title': 'RoboCop (1987) - Dick You\'re Fired', + 'thumbnail': 'http://vidbit.co/thumbnails/MrM7LeaMJq.jpg', + } + } + + _BASE_URL = 'http://vidbit.co/%s' + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + return { + 'id': video_id, + 'title': self._html_search_regex(r'

(.+)

', webpage, 'title'), + 'url': self._BASE_URL % self._html_search_regex(r'file:\s*["\'](.+)["\']', webpage, 'video URL'), + 'thumbnail': self._BASE_URL % self._html_search_regex(r'image:\s*["\']([^"]*)["\']', webpage, 'thumbnail', fatal=False), + } From fed6fd233cdcdf4b40a5e044b8c11d99bb2ff1a2 Mon Sep 17 00:00:00 2001 From: TRox1972 Date: Sun, 12 Jun 2016 03:20:37 +0200 Subject: [PATCH 2/7] [Vidbit] Fix regex --- youtube_dl/extractor/vidbit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/vidbit.py b/youtube_dl/extractor/vidbit.py index 49a57a45b..40a63816e 100644 --- a/youtube_dl/extractor/vidbit.py +++ b/youtube_dl/extractor/vidbit.py @@ -27,5 +27,5 @@ class VidbitIE(InfoExtractor): 'id': video_id, 'title': self._html_search_regex(r'

(.+)

', webpage, 'title'), 'url': self._BASE_URL % self._html_search_regex(r'file:\s*["\'](.+)["\']', webpage, 'video URL'), - 'thumbnail': self._BASE_URL % self._html_search_regex(r'image:\s*["\']([^"]*)["\']', webpage, 'thumbnail', fatal=False), + 'thumbnail': self._BASE_URL % self._html_search_regex(r'image:\s*["\'](.*)["\']', webpage, 'thumbnail', fatal=False), } From b086dc826370ecee4e71f39969606f5ada0cf7ce Mon Sep 17 00:00:00 2001 From: TRox1972 Date: Sun, 12 Jun 2016 11:08:57 +0200 Subject: [PATCH 3/7] [Vidbit] Extract description --- youtube_dl/extractor/vidbit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/vidbit.py b/youtube_dl/extractor/vidbit.py index 40a63816e..3b87e9e53 100644 --- a/youtube_dl/extractor/vidbit.py +++ b/youtube_dl/extractor/vidbit.py @@ -27,5 +27,6 @@ class VidbitIE(InfoExtractor): 'id': video_id, 'title': self._html_search_regex(r'

(.+)

', webpage, 'title'), 'url': self._BASE_URL % self._html_search_regex(r'file:\s*["\'](.+)["\']', webpage, 'video URL'), - 'thumbnail': self._BASE_URL % self._html_search_regex(r'image:\s*["\'](.*)["\']', webpage, 'thumbnail', fatal=False), + 'thumbnail': self._BASE_URL % self._html_search_regex(r'image:\s*["\'](.*)["\']', webpage, 'thumbnail', None), + 'desription': self._html_search_regex(r'description:\s*["\'](.*)["\']', webpage, 'thumbnail', None), } From e09c9aabb0b8b801d00c388840ef32ac5606e099 Mon Sep 17 00:00:00 2001 From: TRox1972 Date: Tue, 14 Jun 2016 17:21:58 +0200 Subject: [PATCH 4/7] [Vidbit] Improve regex --- youtube_dl/extractor/vidbit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/vidbit.py b/youtube_dl/extractor/vidbit.py index 3b87e9e53..e7887e8c3 100644 --- a/youtube_dl/extractor/vidbit.py +++ b/youtube_dl/extractor/vidbit.py @@ -26,7 +26,7 @@ class VidbitIE(InfoExtractor): return { 'id': video_id, 'title': self._html_search_regex(r'

(.+)

', webpage, 'title'), - 'url': self._BASE_URL % self._html_search_regex(r'file:\s*["\'](.+)["\']', webpage, 'video URL'), - 'thumbnail': self._BASE_URL % self._html_search_regex(r'image:\s*["\'](.*)["\']', webpage, 'thumbnail', None), - 'desription': self._html_search_regex(r'description:\s*["\'](.*)["\']', webpage, 'thumbnail', None), + 'url': self._BASE_URL % self._html_search_regex(r'file:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'video URL', group=2), + 'thumbnail': self._BASE_URL % self._html_search_regex(r'image:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'thumbnail', None, group=2), + 'description': self._html_search_regex(r'description:(["\'])((?:(?!\1).)+)\1', webpage, 'description', None, group=2), } From e2568ca666b7132f716b63f6fd8f35c8ec190943 Mon Sep 17 00:00:00 2001 From: TRox1972 Date: Sat, 18 Jun 2016 18:22:32 +0200 Subject: [PATCH 5/7] [Vidbit] Extract base URL from --- youtube_dl/extractor/vidbit.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/vidbit.py b/youtube_dl/extractor/vidbit.py index e7887e8c3..5260a233e 100644 --- a/youtube_dl/extractor/vidbit.py +++ b/youtube_dl/extractor/vidbit.py @@ -1,8 +1,10 @@ # coding: utf-8 from __future__ import unicode_literals -from .common import InfoExtractor +import re +from .common import InfoExtractor +from ..utils import url_basename class VidbitIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vidbit\.co/watch\?v=(?P[\w-]+)' @@ -13,20 +15,20 @@ class VidbitIE(InfoExtractor): 'id': 'MrM7LeaMJq', 'ext': 'mp4', 'title': 'RoboCop (1987) - Dick You\'re Fired', - 'thumbnail': 'http://vidbit.co/thumbnails/MrM7LeaMJq.jpg', + 'thumbnail': 'http://www.vidbit.co/thumbnails/MrM7LeaMJq.jpg', } } - _BASE_URL = 'http://vidbit.co/%s' - def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) + _BASE_URL = 'http://' + url.split('/')[2] + '/' + return { 'id': video_id, 'title': self._html_search_regex(r'

(.+)

', webpage, 'title'), - 'url': self._BASE_URL % self._html_search_regex(r'file:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'video URL', group=2), - 'thumbnail': self._BASE_URL % self._html_search_regex(r'image:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'thumbnail', None, group=2), + 'url': _BASE_URL + self._html_search_regex(r'file:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'video URL', group=2), + 'thumbnail': _BASE_URL + self._html_search_regex(r'image:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'thumbnail', None, group=2), 'description': self._html_search_regex(r'description:(["\'])((?:(?!\1).)+)\1', webpage, 'description', None, group=2), } From dd49ab150e4de8e40a5a8aa1be1856dabf5092a9 Mon Sep 17 00:00:00 2001 From: TRox1972 Date: Sat, 18 Jun 2016 20:33:57 +0200 Subject: [PATCH 6/7] [Vidbit] Simplify base URL --- youtube_dl/extractor/vidbit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/vidbit.py b/youtube_dl/extractor/vidbit.py index 5260a233e..9c08c0d05 100644 --- a/youtube_dl/extractor/vidbit.py +++ b/youtube_dl/extractor/vidbit.py @@ -5,6 +5,8 @@ import re from .common import InfoExtractor from ..utils import url_basename +from ..compat import compat_urlparse + class VidbitIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vidbit\.co/watch\?v=(?P[\w-]+)' @@ -23,12 +25,10 @@ class VidbitIE(InfoExtractor): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id) - _BASE_URL = 'http://' + url.split('/')[2] + '/' - return { 'id': video_id, 'title': self._html_search_regex(r'

(.+)

', webpage, 'title'), - 'url': _BASE_URL + self._html_search_regex(r'file:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'video URL', group=2), - 'thumbnail': _BASE_URL + self._html_search_regex(r'image:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'thumbnail', None, group=2), + 'url': compat_urlparse.urljoin(url, self._html_search_regex(r'file:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'video URL', group=2)), + 'thumbnail': compat_urlparse.urljoin(url, self._html_search_regex(r'image:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'thumbnail', None, group=2)), 'description': self._html_search_regex(r'description:(["\'])((?:(?!\1).)+)\1', webpage, 'description', None, group=2), } From dfa6574a01f80ac8e7c86f15757d7894f4458110 Mon Sep 17 00:00:00 2001 From: TRox1972 Date: Sat, 18 Jun 2016 21:48:46 +0200 Subject: [PATCH 7/7] Add UNLICENSE file --- UNLICENSE | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 UNLICENSE diff --git a/UNLICENSE b/UNLICENSE new file mode 100644 index 000000000..68a49daad --- /dev/null +++ b/UNLICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to