Skip to content

Commit

Permalink
fix iqiyi playlist extrator
Browse files Browse the repository at this point in the history
  • Loading branch information
jseagull committed Sep 14, 2020
1 parent 80d88a1 commit 398068e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/you_get/extractors/iqiyi.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ def download_playlist_by_url(self, url, **kwargs):
self.url = 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:
self.__class__().download_by_url(video, **kwargs)
self.__class__().download_by_url('https:' + video, **kwargs)

def prepare(self, **kwargs):
assert self.url or self.vid
Expand Down Expand Up @@ -153,7 +153,7 @@ def prepare(self, **kwargs):
except Exception as e:
log.i("vd: {} is not handled".format(stream['vd']))
log.i("info is {}".format(stream))


def download(self, **kwargs):
"""Override the original one
Expand Down Expand Up @@ -201,7 +201,7 @@ def download(self, **kwargs):
if not urls:
log.wtf('[Failed] Cannot extract video source.')
# For legacy main()

#Here's the change!!
download_url_ffmpeg(urls[0], self.title, 'mp4', output_dir=kwargs['output_dir'], merge=kwargs['merge'], stream=False)

Expand All @@ -215,7 +215,7 @@ def download(self, **kwargs):
with open(os.path.join(kwargs['output_dir'], filename),
'w', encoding='utf-8') as x:
x.write(srt)
print('Done.')
print('Done.')

'''
if info["code"] != "A000000":
Expand Down

0 comments on commit 398068e

Please sign in to comment.