From bc81ab8ce78ce49fd9dcd07e2ffbec89718647ca Mon Sep 17 00:00:00 2001 From: girst Date: Sat, 29 Aug 2020 19:35:55 +0200 Subject: [PATCH] fix error on playlist that doesn't even work on youtube.com --- app/dangerous/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/dangerous/__init__.py b/app/dangerous/__init__.py index ee9b77b..552ccbc 100644 --- a/app/dangerous/__init__.py +++ b/app/dangerous/__init__.py @@ -120,6 +120,12 @@ def playlist(): offset = (page-1)*100 # each call returns 100 items result = fetch_ajax(make_playlist_params(playlist_id, offset)) + if not 'continuationContents' in result[1]['response']: # XXX: this needs cleanup! + # code:"CONDITION_NOT_MET", debugInfo:"list type not viewable" + # on playlist https://www.youtube.com/watch?v=6y_NJg-xoeE&list=RDgohHV9ryp-A&index=24 (not openable on yt.com) + error = result[1]['response']['responseContext']['errors']['error'][0] + flash(f"{error['code']}: {error['debugInfo'] or error['externalErrorMessage']}", 'error') + return fallback_route() rows, more = prepare_playlist(result) return render_template('playlist.html.j2', -- 2.39.3