diff options
Diffstat (limited to 'youtube_dl/extractor/iqiyi.py')
| -rw-r--r-- | youtube_dl/extractor/iqiyi.py | 35 | 
1 files changed, 6 insertions, 29 deletions
| diff --git a/youtube_dl/extractor/iqiyi.py b/youtube_dl/extractor/iqiyi.py index 9106dd074..afb7f4e61 100644 --- a/youtube_dl/extractor/iqiyi.py +++ b/youtube_dl/extractor/iqiyi.py @@ -3,23 +3,18 @@ from __future__ import unicode_literals  import hashlib  import math -import os.path  import random -import re  import time  import uuid -import zlib  from .common import InfoExtractor  from ..compat import compat_urllib_parse -from ..utils import ( -    ExtractorError, -    url_basename, -) +from ..utils import ExtractorError  class IqiyiIE(InfoExtractor):      IE_NAME = 'iqiyi' +    IE_DESC = '爱奇艺'      _VALID_URL = r'http://(?:www\.)iqiyi.com/v_.+?\.html' @@ -38,62 +33,57 @@ class IqiyiIE(InfoExtractor):              'title': '名侦探柯南第752集',          },          'playlist': [{ -            'md5': '7e49376fecaffa115d951634917fe105',              'info_dict': {                  'id': 'e3f585b550a280af23c98b6cb2be19fb_part1',                  'ext': 'f4v',                  'title': '名侦探柯南第752集',              },          }, { -            'md5': '41b75ba13bb7ac0e411131f92bc4f6ca',              'info_dict': {                  'id': 'e3f585b550a280af23c98b6cb2be19fb_part2',                  'ext': 'f4v',                  'title': '名侦探柯南第752集',              },          }, { -            'md5': '0cee1dd0a3d46a83e71e2badeae2aab0',              'info_dict': {                  'id': 'e3f585b550a280af23c98b6cb2be19fb_part3',                  'ext': 'f4v',                  'title': '名侦探柯南第752集',              },          }, { -            'md5': '4f8ad72373b0c491b582e7c196b0b1f9',              'info_dict': {                  'id': 'e3f585b550a280af23c98b6cb2be19fb_part4',                  'ext': 'f4v',                  'title': '名侦探柯南第752集',              },          }, { -            'md5': 'd89ad028bcfad282918e8098e811711d',              'info_dict': {                  'id': 'e3f585b550a280af23c98b6cb2be19fb_part5',                  'ext': 'f4v',                  'title': '名侦探柯南第752集',              },          }, { -            'md5': '9cb1e5c95da25dff0660c32ae50903b7',              'info_dict': {                  'id': 'e3f585b550a280af23c98b6cb2be19fb_part6',                  'ext': 'f4v',                  'title': '名侦探柯南第752集',              },          }, { -            'md5': '155116e0ff1867bbc9b98df294faabc9',              'info_dict': {                  'id': 'e3f585b550a280af23c98b6cb2be19fb_part7',                  'ext': 'f4v',                  'title': '名侦探柯南第752集',              },          }, { -            'md5': '53f5db77622ae14fa493ed2a278a082b',              'info_dict': {                  'id': 'e3f585b550a280af23c98b6cb2be19fb_part8',                  'ext': 'f4v',                  'title': '名侦探柯南第752集',              },          }], +        'params': { +            'skip_download': True, +        },      }]      _FORMATS_MAP = [ @@ -211,20 +201,7 @@ class IqiyiIE(InfoExtractor):          return raw_data      def get_enc_key(self, swf_url, video_id): -        filename, _ = os.path.splitext(url_basename(swf_url)) -        enc_key_json = self._downloader.cache.load('iqiyi-enc-key', filename) -        if enc_key_json is not None: -            return enc_key_json[0] - -        req = self._request_webpage( -            swf_url, video_id, note='download swf content') -        cn = req.read() -        cn = zlib.decompress(cn[8:]) -        pt = re.compile(b'MixerRemote\x08(?P<enc_key>.+?)\$&vv') -        enc_key = self._search_regex(pt, cn, 'enc_key').decode('utf8') - -        self._downloader.cache.store('iqiyi-enc-key', filename, [enc_key]) - +        enc_key = '8e29ab5666d041c3a1ea76e06dabdffb'          return enc_key      def _real_extract(self, url): | 
