From b0a9114e595e4c71766cefbb1cd7c75c334b13c2 Mon Sep 17 00:00:00 2001 From: idle sign Date: Sun, 13 May 2018 11:25:52 +0700 Subject: [PATCH] [allmovie] Add .pro domain support. --- youtube_dl/extractor/allmovie.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/allmovie.py b/youtube_dl/extractor/allmovie.py index dfe3ea7a0..3e67fcb48 100644 --- a/youtube_dl/extractor/allmovie.py +++ b/youtube_dl/extractor/allmovie.py @@ -1,17 +1,23 @@ # coding: utf-8 from __future__ import unicode_literals +try: + from urllib.parse import urlparse + +except ImportError: # py2 + from urlparse import urlparse + from .common import InfoExtractor class AllmovieIE(InfoExtractor): - """Information extractor for allmovie.tv + """Information extractor for allmovie. Test with: python test/test_download.py TestDownload.test_Allmovie """ - _VALID_URL = r'http://allmovie\.tv/video/.+-(?P\d+)\.html' + _VALID_URL = r'http://allmovie\.(tv|pro)/video/.+-(?P\d+)\.html' _TEST = { 'url': 'http://allmovie.tv/video/vesti-v-subbotu-28-10-2017-17255.html', @@ -30,8 +36,10 @@ class AllmovieIE(InfoExtractor): page_info = self._download_webpage(url, video_id, note='Downloading info page ...') + host = urlparse(url).hostname + page_player = self._download_webpage( - 'http://allmovie.tv/video/show_player/%s' % video_id, video_id, + 'http://%s/video/show_player/%s' % (host, video_id), video_id, headers={'X-Requested-With': 'XMLHttpRequest'}, note='Downloading player page ...')