Mgtv: add another format of url

Fix indentation causing undefined variable
This commit is contained in:
Bochun Bai 2021-01-13 20:55:19 -08:00
parent 15cc69a120
commit e914a4bbbf
No known key found for this signature in database
GPG Key ID: 8433534ED5D633FD

View File

@ -47,6 +47,8 @@ class MGTV(VideoExtractor):
vid = match1(url, 'https?://www.mgtv.com/(?:b|l)/\d+/(\d+).html') vid = match1(url, 'https?://www.mgtv.com/(?:b|l)/\d+/(\d+).html')
if not vid: if not vid:
vid = match1(url, 'https?://www.mgtv.com/hz/bdpz/\d+/(\d+).html') vid = match1(url, 'https?://www.mgtv.com/hz/bdpz/\d+/(\d+).html')
if not vid:
vid = match1(url, 'https?://www.mgtv.com/s/(\d+).html')
return vid return vid
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
@ -125,21 +127,21 @@ class MGTV(VideoExtractor):
for i in segment_list_this: for i in segment_list_this:
stream_fileid_list.append(os.path.basename(i).split('.')[0]) stream_fileid_list.append(os.path.basename(i).split('.')[0])
# make pieces # make pieces
pieces = [] pieces = []
for i in zip(stream_fileid_list, segment_list_this): for i in zip(stream_fileid_list, segment_list_this):
pieces.append({'fileid': i[0], 'segs': i[1], }) pieces.append({'fileid': i[0], 'segs': i[1], })
self.streams[quality_id] = { self.streams[quality_id] = {
'container': s['container'], 'container': s['container'],
'video_profile': s['video_profile'], 'video_profile': s['video_profile'],
'size': m3u8_size, 'size': m3u8_size,
'pieces': pieces, 'pieces': pieces,
'm3u8_url': m3u8_url 'm3u8_url': m3u8_url
} }
if not kwargs['info_only']: if not kwargs['info_only']:
self.streams[quality_id]['src'] = segment_list_this self.streams[quality_id]['src'] = segment_list_this
def extract(self, **kwargs): def extract(self, **kwargs):
if 'stream_id' in kwargs and kwargs['stream_id']: if 'stream_id' in kwargs and kwargs['stream_id']: