code: def get_req(self, start_size, end_size):
          '''打开socket'''
          logger.debug('DownloadBatch.get_req: %s, %s' % (start_size, end_size))
          opener = request.build_opener()
          content_range = 'bytes={0}-{1}'.format(start_size, end_size)
          opener.addheaders = [
              ('Range', content_range),
              ('User-Agent', const.USER_AGENT),
              ('Referer', const.PAN_REFERER),
          ]
          for i in range(RETRIES):
              try:
                  return opener.open(self.url, timeout=self.timeout)
              except OSError:
                  logger.error(traceback.format_exc())
                  self.queue.put((self.id_, BATCH_ERROR), block=False)
                  return None
              except:
                  self.queue.put((self.id_, BATCH_ERROR), block=False)
                  return None
          else:
              return Nonf get_req(self, start_size, end_size):
          '''打开socket'''
          logger.debug('DownloadBatch.get_req: %s, %s' % (start_size, end_size))
          opener = request.build_opener()
          content_range = 'bytes={0}-{1}'.format(start_size, end_size)
          opener.addheaders = [
              ('Range', content_range),
              ('User-Agent', const.USER_AGENT),
              ('Referer', const.PAN_REFERER),
          ]
          for i in range(RETRIES):
              try:
                  return opener.open(self.url, timeout=self.timeout)
              except OSError:
                  logger.error(traceback.format_exc())
                  self.queue.put((self.id_, BATCH_ERROR), block=False)
                  return None
              except:
                  self.queue.put((self.id_, BATCH_ERROR), block=False)
                  return None
          else:
              return None
docs: 打开socket