check if the format with best bitrate is a video
This commit is contained in:
@@ -163,8 +163,8 @@ def rebuildFormats(data):
|
||||
except:
|
||||
pass
|
||||
|
||||
# we assume here that a stream with the highest bitrate must be a video stream
|
||||
if data[x]['averageBitrate'] > data[best_bitrate]['averageBitrate']:
|
||||
# we assume here that a stream with the highest bitrate must be a video stream- that may not be the case
|
||||
if data[x]['averageBitrate'] > data[best_bitrate]['averageBitrate'] and isVideo:
|
||||
best_bitrate = x
|
||||
|
||||
# makes FreeTube work, unfortunately it's a video-only stream
|
||||
@@ -203,6 +203,8 @@ def videos(data):
|
||||
idata = ythdd_extractor.IOSextract(data[3])
|
||||
wdata = ythdd_extractor.WEBextractSinglePage(data[3])
|
||||
|
||||
#return send(200, {'idata': idata, 'wdata': wdata})
|
||||
|
||||
main_results = idata['stage3']['contents']['twoColumnWatchNextResults']
|
||||
primary_results = safeTraverse(main_results, ['results', 'results', 'contents'])
|
||||
if primary_results:
|
||||
|
||||
Reference in New Issue
Block a user