# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class ThisVidIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?thisvid\.com/(?Pvideos|embed)/(?P[A-Za-z0-9-]+/?)' _TESTS = [{ 'url': 'https://thisvid.com/videos/french-boy-pantsed/', 'md5': '3397979512c682f6b85b3b04989df224', 'info_dict': { 'id': '2400174', 'ext': 'mp4', 'title': 'French Boy Pantsed', 'thumbnail': 'https://media.thisvid.com/contents/videos_screenshots/2400000/2400174/preview.mp4.jpg', 'age_limit': 18, } }, { 'url': 'https://thisvid.com/embed/2400174/', 'md5': '3397979512c682f6b85b3b04989df224', 'info_dict': { 'id': '2400174', 'ext': 'mp4', 'title': 'French Boy Pantsed', 'thumbnail': 'https://media.thisvid.com/contents/videos_screenshots/2400000/2400174/preview.mp4.jpg', 'age_limit': 18, } }] def _real_extract(self, url): main_id = self._match_id(url) webpage = self._download_webpage(url, main_id) # URL decryptor was reversed from version 4.0.4, later verified working with 5.2.0 and may change in the future. kvs_version = self._html_search_regex(r'