diff --git a/ythdd_inv_tl.py b/ythdd_inv_tl.py index 8e76a70..94a042f 100644 --- a/ythdd_inv_tl.py +++ b/ythdd_inv_tl.py @@ -890,8 +890,8 @@ def playlists(data, req, only_json: bool = False): # todo: make clipious stop spamming requests for paginated response page = req.args.get('page') - if page is not None and page != '1': - return send(404, {"error": "Paginated queries are not supported."}) + # if page is not None and page != '1': + # return send(404, {"error": "Paginated queries are not supported."}) plid = data[3] @@ -907,7 +907,9 @@ def playlists(data, req, only_json: bool = False): # check if request has been cached within the last hour if ythdd_globals.config['general']['cache'] and plid in ythdd_globals.general_cache['playlists']: if ythdd_globals.general_cache['playlists'][plid]['cacheTime'] + 1 * 60 * 60 > time(): - response = ythdd_globals.general_cache['playlists'][plid] + response = ythdd_globals.general_cache['playlists'][plid].copy() + if page is not None and page != '1': + response['videos'] = [] if only_json: return response else: @@ -979,9 +981,12 @@ def playlists(data, req, only_json: bool = False): # todo: cache videos and metadata separately, so that paginated queries can be supported as well if ythdd_globals.config['general']['cache']: - ythdd_globals.general_cache['playlists'][plid] = response + ythdd_globals.general_cache['playlists'][plid] = response.copy() ythdd_globals.general_cache['playlists'][plid]['cacheTime'] = time() + if page is not None or page == '1': + response['videos'] = [] + if only_json: return response