2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 from ..compat import (
12 compat_urllib_request,
15 class PrimesharetvIE(InfoExtractor):
16 _VALID_URL = r'https?://(?:www\.)?primeshare\.tv/download/(?P<id>.*)(?:.*)'
20 'url': 'http://primeshare.tv/download/238790B611',
21 'md5': 'bb41f9f6c0dd434c729f04ce5b677192',
25 "title": "Public Domain - 1960s Commercial - Crest Toothpaste-YKsuFona [...]",
31 def _real_extract(self, url):
32 video_id = self._match_id(url)
33 webpage = self._download_webpage(url, video_id)
35 self._sleep(9, video_id)
37 hashtoken = self._search_regex(r' name="hash" value="(.*?)" ', webpage, 'hash token')
38 data = urlencode_postdata({
43 'Content-Type': 'application/x-www-form-urlencoded',
45 video_page_request = compat_urllib_request.Request(url, data, headers=headers)
46 video_page = self._download_webpage(video_page_request, None, False, '')
48 video_url = self._html_search_regex(
49 r'url: \'(http://[a-z0-9]+\.primeshare\.tv:443/file/get/[^\']+)\',', video_page, 'video url')
51 title = self._html_search_regex(
52 r'<h1>Watch [^\(]+\(([^/)]+)\) ', video_page, 'title')