From 085690feeb05b9fe12e6c16c4e971b71f7092456 Mon Sep 17 00:00:00 2001 From: Sam Ireland Date: Fri, 17 Feb 2023 00:34:22 +0000 Subject: [PATCH] Use yt-dlp --- requirements.txt | 1 + utilities.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 44fbf87..b0edd96 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ praw requests youtube_dl +yt-dlp tqdm redvid diff --git a/utilities.py b/utilities.py index 7b38d70..b6fbfc7 100644 --- a/utilities.py +++ b/utilities.py @@ -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: