Browse Source

Handle nested playlists

master
JustAnotherArchivist 1 year ago
parent
commit
ec20f38c82
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      youtube-channel-list.py

+ 9
- 2
youtube-channel-list.py View File

@@ -1,3 +1,4 @@
import collections
import sys
import yt_dlp

@@ -5,5 +6,11 @@ import yt_dlp
with yt_dlp.YoutubeDL({'quiet': True}) as ydl:
ie = ydl.get_info_extractor('YoutubeTab')
for url in sys.argv[1:]:
for entry in ie.extract(url)['entries']:
print(entry['id'])
q = collections.deque()
q.append(ie.extract(url))
while q:
e = q.popleft()
if 'entries' in e:
q.extend(e['entries'])
elif 'id' in e:
print(e['id'])

Loading…
Cancel
Save