Use yt-dlp

This commit is contained in:
Sam Ireland 2023-02-17 00:34:22 +00:00
parent d61bc0129e
commit 085690feeb
2 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,6 @@
praw
requests
youtube_dl
yt-dlp
tqdm
redvid

View File

@ -2,7 +2,7 @@ import os
import praw
import requests
from redvid import Downloader
import youtube_dl
import yt_dlp
import re
from datetime import datetime
@ -149,12 +149,12 @@ def save_media(post, location):
if domain in PLATFORMS:
options = {
"nocheckcertificate": True, "quiet": True, "no_warnings": True,
"ignoreerrors": True,
"ignoreerrors": True, "no-progress": True,
"outtmpl": os.path.join(
location, "media", f"{readable_name}_{post.id}" + ".%(ext)s"
)
}
with youtube_dl.YoutubeDL(options) as ydl:
with yt_dlp.YoutubeDL(options) as ydl:
try:
ydl.download([url])
except: