[youku extractor]print m3u8 url in info

This commit is contained in:
MaxwellGoblin 2017-05-26 12:17:29 +08:00
parent 996634d473
commit c48c4beb6b
2 changed files with 6 additions and 1 deletions

View File

@ -22,6 +22,7 @@ class VideoExtractor():
self.url = None self.url = None
self.title = None self.title = None
self.vid = None self.vid = None
self.m3u8_url = None
self.streams = {} self.streams = {}
self.streams_sorted = [] self.streams_sorted = []
self.audiolang = None self.audiolang = None
@ -108,6 +109,9 @@ class VideoExtractor():
if stream['size'] != float('inf') and stream['size'] != 0: if stream['size'] != float('inf') and stream['size'] != 0:
print(" size: %s MiB (%s bytes)" % (round(stream['size'] / 1048576, 1), stream['size'])) print(" size: %s MiB (%s bytes)" % (round(stream['size'] / 1048576, 1), stream['size']))
if 'm3u8_url' in stream:
print(" m3u8_url: {}".format(stream['m3u8_url']))
if 'itag' in stream: if 'itag' in stream:
print(" # download-with: %s" % log.sprint("you-get --itag=%s [URL]" % stream_id, log.UNDERLINE)) print(" # download-with: %s" % log.sprint("you-get --itag=%s [URL]" % stream_id, log.UNDERLINE))
else: else:

View File

@ -223,7 +223,8 @@ class Youku(VideoExtractor):
'size': stream['size'], 'size': stream['size'],
'pieces': [{ 'pieces': [{
'segs': stream['segs'] 'segs': stream['segs']
}] }],
'm3u8_url': stream['m3u8_url']
} }
src = [] src = []
for seg in stream['segs']: for seg in stream['segs']: