From 3716342ad4d4cdd622ae7499db59e165d1cfa603 Mon Sep 17 00:00:00 2001 From: zach-martin Date: Wed, 29 Nov 2017 18:33:01 -0600 Subject: [PATCH] Closes #14665 Fixes issue with OpenLoad where /embed/ link shows file as deleted but /f/ does not --- youtube_dl/extractor/openload.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/openload.py b/youtube_dl/extractor/openload.py index a99af12a4..3e0c13375 100644 --- a/youtube_dl/extractor/openload.py +++ b/youtube_dl/extractor/openload.py @@ -302,6 +302,7 @@ class OpenloadIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) url = 'https://openload.co/embed/%s/' % video_id + url2 = 'https://openload.co/f/%s/' % video_id headers = { 'User-Agent': self._USER_AGENT, } @@ -309,7 +310,10 @@ class OpenloadIE(InfoExtractor): webpage = self._download_webpage(url, video_id, headers=headers) if 'File not found' in webpage or 'deleted by the owner' in webpage: - raise ExtractorError('File not found', expected=True, video_id=video_id) + url = url2 + webpage = self._download_webpage(url, video_id, headers=headers) + if 'File not found' in webpage or 'deleted by the owner' in webpage: + raise ExtractorError('File not found', expected=True, video_id=video_id) phantom = PhantomJSwrapper(self, required_version='2.0') webpage, _ = phantom.get(url, html=webpage, video_id=video_id, headers=headers)