The little things give you away... A collection of various small helper stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

17 lines
353 B

  1. import collections
  2. import sys
  3. import yt_dlp
  4. with yt_dlp.YoutubeDL({'quiet': True}) as ydl:
  5. ie = ydl.get_info_extractor('YoutubeTab')
  6. for url in sys.argv[1:]:
  7. q = collections.deque()
  8. q.append(ie.extract(url))
  9. while q:
  10. e = q.popleft()
  11. if e['_type'] == 'playlist':
  12. q.extend(e['entries'])
  13. elif e['_type'] == 'url':
  14. print(e['id'])