From efedb0a7f4e20b21b13f8cabd92fc94d10c4615a Mon Sep 17 00:00:00 2001 From: flatt3rn Date: Sat, 31 Dec 2016 14:33:12 +0100 Subject: [PATCH 1/2] [Veyqo] Added new Extractor Added an Extractor for Veyqo because of the issue https://github.com/rg3/youtube-dl/issues/11536 It the first time i use github this way and the first extractor i add. But the download works fine. Only the test_download part isnt checked. I could not get this working. Read about it and tried different things. Possibly someone could help so i could check this in the future too. --- youtube_dl/extractor/veyqo.py | 66 +++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 youtube_dl/extractor/veyqo.py diff --git a/youtube_dl/extractor/veyqo.py b/youtube_dl/extractor/veyqo.py new file mode 100644 index 000000000..f3180a93d --- /dev/null +++ b/youtube_dl/extractor/veyqo.py @@ -0,0 +1,66 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor +from ..compat import compat_chr +from ..utils import ( + determine_ext, + ExtractorError, +) + +class VeyqoIE(InfoExtractor): + _VALID_URL = r'https?:\/\/(?:www\.)?veyqo\.net\/(?P[a-zA-Z0-9-_]+)' + _TEST = { + 'url': 'http://www.veyqo.net/rkprime-aidra-fox-get-closet-24-12-2016/', + 'md5': '308b079d7e7314e5d23a459bb95b67ee', + 'info_dict': { + 'id': 'rkprime-aidra-fox-get-closet-24-12-2016', + 'ext': 'unknown_video', + 'title': 'RKPrime - Aidra Fox (Get In The Closet) (24.12.2016)', + 'thumbnail': 're:^https?://.*\.jpg$', + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + webpage = self._download_webpage(url, video_id) + + ol_link = self._search_regex('https?://(?:openload\.(?:co|io)|oload\.tv)/(?:f|embed)/(?P[a-zA-Z0-9-_]+)',webpage, 'openload link') + webpage = self._download_webpage('https://openload.co/embed/%s/' % ol_link, video_id) + + if 'File not found' in webpage or 'deleted by the owner' in webpage: + raise ExtractorError('File not found', expected=True) + + ol_id = self._search_regex( + ']+id="[a-zA-Z0-9]+x"[^>]*>([0-9]+)', + webpage, 'openload ID') + first_two_chars = int(float(ol_id[0:][:2])) + urlcode = '' + num = 2 + + while num < len(ol_id): + urlcode += compat_chr(int(float(ol_id[num:][:3])) - first_two_chars * int(float(ol_id[num + 3:][:2]))) + num += 5 + + video_url = 'https://openload.co/stream/' + urlcode + + title = self._og_search_title(webpage, default=None) or self._search_regex( + r']+class=["\']title["\'][^>]*>([^<]+)', webpage, + 'title', default=None) or self._html_search_meta( + 'description', webpage, 'title', fatal=True) + + entries = self._parse_html5_media_entries(url, webpage, video_id) + subtitles = entries[0]['subtitles'] if entries else None + print video_id + print title + print determine_ext(title) + print self._og_search_thumbnail(webpage, default=None) + return { + 'id': video_id, + 'title': title, + 'thumbnail': self._og_search_thumbnail(webpage, default=None), + 'url': video_url, + # Seems all videos have extensions in their titles + 'ext': determine_ext(title), + 'subtitles': subtitles, + } From 08b513417df52986e7f058e88cdfe4409a2bfa18 Mon Sep 17 00:00:00 2001 From: flatt3rn Date: Sat, 31 Dec 2016 14:35:10 +0100 Subject: [PATCH 2/2] Added Extractor Veyqo --- youtube_dl/extractor/extractors.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index 811db6219..3f8d2f442 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -1051,6 +1051,7 @@ from .vevo import ( VevoIE, VevoPlaylistIE, ) +from .veyqo import VeyqoIE from .vgtv import ( BTArticleIE, BTVestlendingenIE,