diff --git a/ythdd_inv_tl.py b/ythdd_inv_tl.py index b8c4bfe..c23976c 100644 --- a/ythdd_inv_tl.py +++ b/ythdd_inv_tl.py @@ -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: