mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 00:33:58 +03:00
fix iqiyi playlist extrator
This commit is contained in:
parent
80d88a1331
commit
398068e13e
@ -119,10 +119,10 @@ class Iqiyi(VideoExtractor):
|
|||||||
self.url = url
|
self.url = url
|
||||||
|
|
||||||
video_page = get_content(url)
|
video_page = get_content(url)
|
||||||
videos = set(re.findall(r'<a href="(http://www\.iqiyi\.com/v_[^"]+)"', video_page))
|
videos = set(re.findall(r'<a href="(?=https?:)?(//www\.iqiyi\.com/v_[^"]+)"', video_page))
|
||||||
|
|
||||||
for video in videos:
|
for video in videos:
|
||||||
self.__class__().download_by_url(video, **kwargs)
|
self.__class__().download_by_url('https:' + video, **kwargs)
|
||||||
|
|
||||||
def prepare(self, **kwargs):
|
def prepare(self, **kwargs):
|
||||||
assert self.url or self.vid
|
assert self.url or self.vid
|
||||||
@ -153,7 +153,7 @@ class Iqiyi(VideoExtractor):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.i("vd: {} is not handled".format(stream['vd']))
|
log.i("vd: {} is not handled".format(stream['vd']))
|
||||||
log.i("info is {}".format(stream))
|
log.i("info is {}".format(stream))
|
||||||
|
|
||||||
|
|
||||||
def download(self, **kwargs):
|
def download(self, **kwargs):
|
||||||
"""Override the original one
|
"""Override the original one
|
||||||
@ -201,7 +201,7 @@ class Iqiyi(VideoExtractor):
|
|||||||
if not urls:
|
if not urls:
|
||||||
log.wtf('[Failed] Cannot extract video source.')
|
log.wtf('[Failed] Cannot extract video source.')
|
||||||
# For legacy main()
|
# For legacy main()
|
||||||
|
|
||||||
#Here's the change!!
|
#Here's the change!!
|
||||||
download_url_ffmpeg(urls[0], self.title, 'mp4', output_dir=kwargs['output_dir'], merge=kwargs['merge'], stream=False)
|
download_url_ffmpeg(urls[0], self.title, 'mp4', output_dir=kwargs['output_dir'], merge=kwargs['merge'], stream=False)
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ class Iqiyi(VideoExtractor):
|
|||||||
with open(os.path.join(kwargs['output_dir'], filename),
|
with open(os.path.join(kwargs['output_dir'], filename),
|
||||||
'w', encoding='utf-8') as x:
|
'w', encoding='utf-8') as x:
|
||||||
x.write(srt)
|
x.write(srt)
|
||||||
print('Done.')
|
print('Done.')
|
||||||
|
|
||||||
'''
|
'''
|
||||||
if info["code"] != "A000000":
|
if info["code"] != "A000000":
|
||||||
|
Loading…
Reference in New Issue
Block a user