aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/dailymotion.py
diff options
context:
space:
mode:
Diffstat (limited to 'youtube_dl/extractor/dailymotion.py')
-rw-r--r--youtube_dl/extractor/dailymotion.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/youtube_dl/extractor/dailymotion.py b/youtube_dl/extractor/dailymotion.py
index abd6a36ee..360113f9c 100644
--- a/youtube_dl/extractor/dailymotion.py
+++ b/youtube_dl/extractor/dailymotion.py
@@ -1,14 +1,11 @@
import re
import json
import itertools
-import socket
from .common import InfoExtractor
from .subtitles import SubtitlesInfoExtractor
from ..utils import (
- compat_http_client,
- compat_urllib_error,
compat_urllib_request,
compat_str,
get_element_by_attribute,
@@ -98,10 +95,11 @@ class DailymotionIE(SubtitlesInfoExtractor):
}]
def _get_available_subtitles(self, video_id):
- request = compat_urllib_request.Request('https://api.dailymotion.com/video/%s/subtitles?fields=id,language,url' % video_id)
try:
- sub_list = compat_urllib_request.urlopen(request).read().decode('utf-8')
- except (compat_urllib_error.URLError, compat_http_client.HTTPException, socket.error) as err:
+ sub_list = self._download_webpage(
+ 'https://api.dailymotion.com/video/%s/subtitles?fields=id,language,url' % video_id,
+ video_id, note=False)
+ except ExtractorError as err:
self._downloader.report_warning(u'unable to download video subtitles: %s' % compat_str(err))
return {}
info = json.loads(sub_list)