Merge branch 'progress-as-hook2'
authorPhilipp Hagemeister <phihag@phihag.de>
Tue, 17 Feb 2015 22:41:48 +0000 (23:41 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Tue, 17 Feb 2015 22:41:48 +0000 (23:41 +0100)
youtube_dl/downloader/http.py
youtube_dl/extractor/common.py
youtube_dl/extractor/twitch.py
youtube_dl/extractor/videolecturesnet.py

index 6dec528f268c9da4eb8ac534b2da8f247ec7cf4b..2e3dac8251dbaf5d8b3e1a90bc459f362d14f72e 100644 (file)
@@ -1,11 +1,10 @@
 from __future__ import unicode_literals
 
+import errno
 import os
+import socket
 import time
 
-from socket import error as SocketError
-import errno
-
 from .common import FileDownloader
 from ..compat import (
     compat_urllib_request,
@@ -101,7 +100,7 @@ class HttpFD(FileDownloader):
                             resume_len = 0
                             open_mode = 'wb'
                             break
-            except SocketError as e:
+            except socket.error as e:
                 if e.errno != errno.ECONNRESET:
                     # Connection reset is no problem, just retry
                     raise
index 31599bf52a8e01046b109c05c4d09dc142b1dc8c..08b8ad37c45ae1aa1528274071a250cfd3f27e89 100644 (file)
@@ -27,7 +27,6 @@ from ..utils import (
     compiled_regex_type,
     ExtractorError,
     float_or_none,
-    HEADRequest,
     int_or_none,
     RegexNotFoundError,
     sanitize_filename,
@@ -839,7 +838,7 @@ class InfoExtractor(object):
             note='Downloading m3u8 information',
             errnote='Failed to download m3u8 information')
         last_info = None
-        last_media= None
+        last_media = None
         kv_rex = re.compile(
             r'(?P<key>[a-zA-Z_-]+)=(?P<val>"[^"]+"|[^",]+)(?:,|$)')
         for line in m3u8_doc.splitlines():
index 8e296698ebaedd250c4c5f035f190f87b2b3c049..4b0d8988d9cc0f866120d7f31a6facc25d47afec 100644 (file)
@@ -348,6 +348,7 @@ class TwitchStreamIE(TwitchBaseIE):
             '%s/api/channel/hls/%s.m3u8?%s'
             % (self._USHER_BASE, channel_id, compat_urllib_parse.urlencode(query).encode('utf-8')),
             channel_id, 'mp4')
+
         # prefer the 'source' stream, the others are limited to 30 fps
         def _sort_source(f):
             if f.get('m3u8_media') is not None and f['m3u8_media'].get('NAME') == 'Source':
index d46234856d55aeef3e2e94943b25c5b739969982..d6a7eb2033e58a92df09be6c042c91d6e932f8b7 100644 (file)
@@ -52,7 +52,7 @@ class VideoLecturesNetIE(InfoExtractor):
         formats = []
         for v in switch.findall('./video'):
             proto = v.attrib.get('proto')
-            if not proto in ['http', 'rtmp']:
+            if proto not in ['http', 'rtmp']:
                 continue
             f = {
                 'width': int_or_none(v.attrib.get('width')),