Merge pull request #1895 from rosynirvana/iqiyi_title

fix iqiyi tiltes when accessed with curid=
This commit is contained in:
rosynirvana 2017-07-13 11:24:37 +08:00 committed by GitHub
commit f16bf06d10

View File

@ -136,7 +136,12 @@ class Iqiyi(VideoExtractor):
r1(r'vid=([^&]+)', self.url) or \ r1(r'vid=([^&]+)', self.url) or \
r1(r'data-player-videoid="([^"]+)"', html) r1(r'data-player-videoid="([^"]+)"', html)
self.vid = (tvid, videoid) self.vid = (tvid, videoid)
self.title = match1(html, '<title>([^<]+)').split('-')[0] info_u = 'http://mixer.video.iqiyi.com/jp/mixin/videos/' + tvid
mixin = get_content(info_u)
mixin_json = json.loads(mixin[len('var tvInfoJs='):])
real_u = mixin_json['url']
real_html = get_content(real_u)
self.title = match1(real_html, '<title>([^<]+)').split('-')[0]
tvid, videoid = self.vid tvid, videoid = self.vid
info = getVMS(tvid, videoid) info = getVMS(tvid, videoid)
assert info['code'] == 'A00000', "can't play this video" assert info['code'] == 'A00000', "can't play this video"