Add ytdl PoF
This commit is contained in:
parent
b2aa7c7615
commit
185f051ae3
17
ytdl_pof.py
Normal file
17
ytdl_pof.py
Normal file
@ -0,0 +1,17 @@
|
||||
from yt_dlp import YoutubeDL
|
||||
|
||||
def longer_than_a_minute(info, *, incomplete):
|
||||
"""Download only videos longer than a minute (or with unknown duration)"""
|
||||
duration = info.get('duration')
|
||||
if duration and duration < 60:
|
||||
return 'The video is too short'
|
||||
|
||||
|
||||
def main():
|
||||
ydl_opts = {
|
||||
'match_filter': longer_than_a_minute,
|
||||
}
|
||||
yt_list = "https://www.youtube.com/playlist?list=XXXXXXXXXXXXXXXXXXX"
|
||||
with YoutubeDL(ydl_opts) as ydl:
|
||||
ydl.download(yt_list)
|
||||
return 0
|
||||
Loading…
Reference in New Issue
Block a user