From 34a3c9d0f3d790b7ebecb4e21610093d50de053a Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Sat, 3 Dec 2022 23:01:39 +0000 Subject: [PATCH] Use _type instead of key check hack --- youtube-channel-list.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube-channel-list.py b/youtube-channel-list.py index a7dbfae..ea6a6a9 100644 --- a/youtube-channel-list.py +++ b/youtube-channel-list.py @@ -10,7 +10,7 @@ with yt_dlp.YoutubeDL({'quiet': True}) as ydl: q.append(ie.extract(url)) while q: e = q.popleft() - if 'entries' in e: + if e['_type'] == 'playlist': q.extend(e['entries']) - elif 'id' in e: + elif e['_type'] == 'url': print(e['id'])