# coding: utf-8 from __future__ import unicode_literals from collections import OrderedDict from datetime import datetime, timedelta import re import subprocess as sp import time from .common import InfoExtractor from ..utils import compat_str, int_or_none class PewTubeIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?pewtube\.com/user/[^/]+/(?P[^/]+)' _TEST = { 'url': 'https://pew.tube/user/MrBond/4jLJf06', 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)', 'info_dict': { 'id': '4jLJf06', 'ext': 'mp4', 'title': 'Mr. Bond - Good Old Nationalist', 'thumbnail': r're:^https?://.*\.jpg$', # TODO more properties, either as: # * A value # * MD5 checksum; start the string with md5: # * A regular expression; start the string with re: # * Any Python type (for example int or float) } } def _real_extract(self, url): video_id = self._match_id(url) webpage = self._download_webpage(url, video_id, tries=5, timeout=15) title = self._html_search_regex(r'

]+>([^<]+)

', webpage, 'title') thumbnail = self._html_search_regex(r'