소스 검색

Handle nested playlists

master
JustAnotherArchivist 1 년 전
부모
커밋
ec20f38c82
1개의 변경된 파일9개의 추가작업 그리고 2개의 파일을 삭제
  1. +9
    -2
      youtube-channel-list.py

+ 9
- 2
youtube-channel-list.py 파일 보기

@@ -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'])

불러오는 중...
취소
저장