aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Buchbinder <jeff@ourexchange.net>2015-03-04 15:18:06 -0500
committerSergey M․ <dstftw@gmail.com>2015-03-17 20:33:24 +0600
commitaf69cab21d48da78ff7d2b54effb9dfd5fcfd1d8 (patch)
tree8498bf85a2992f677f2f2d0a1104eb81c5baecd4
parentd41a3fa1b47fc050e206bd16feed02b6a62e7d2d (diff)
downloadyoutube-dl-af69cab21d48da78ff7d2b54effb9dfd5fcfd1d8.tar.xz
[Primesharetv] Add public domain example video
-rw-r--r--youtube_dl/extractor/primesharetv.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/youtube_dl/extractor/primesharetv.py b/youtube_dl/extractor/primesharetv.py
index 967125abc..7c545761b 100644
--- a/youtube_dl/extractor/primesharetv.py
+++ b/youtube_dl/extractor/primesharetv.py
@@ -15,6 +15,19 @@ from ..compat import (
class PrimesharetvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?primeshare\.tv/download/(?P<id>.*)(?:.*)'
+ _TESTS = [
+ {
+ 'url': 'http://primeshare.tv/download/238790B611',
+ 'md5': 'bb41f9f6c0dd434c729f04ce5b677192',
+ 'info_dict': {
+ 'id': '238790B611',
+ 'ext': 'mp4',
+ "title": "Public Domain - 1960s Commercial - Crest Toothpaste-YKsuFona [...]",
+ "duration": 10,
+ },
+ }
+ ]
+
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
@@ -33,7 +46,7 @@ class PrimesharetvIE(InfoExtractor):
video_page = self._download_webpage(video_page_request, None, False, '')
video_url = self._html_search_regex(
- r'url: \'(http://l\.primeshare\.tv[^\']+)\',', video_page, 'video url')
+ r'url: \'(http://[a-z0-9]+\.primeshare\.tv:443/file/get/[^\']+)\',', video_page, 'video url')
title = self._html_search_regex(
r'<h1>Watch&nbsp;[^\(]+\(([^/)]+)\)&nbsp;', video_page, 'title')