Use yt-dlp
This commit is contained in:
parent
d61bc0129e
commit
085690feeb
@ -1,5 +1,6 @@
|
|||||||
praw
|
praw
|
||||||
requests
|
requests
|
||||||
youtube_dl
|
youtube_dl
|
||||||
|
yt-dlp
|
||||||
tqdm
|
tqdm
|
||||||
redvid
|
redvid
|
||||||
|
@ -2,7 +2,7 @@ import os
|
|||||||
import praw
|
import praw
|
||||||
import requests
|
import requests
|
||||||
from redvid import Downloader
|
from redvid import Downloader
|
||||||
import youtube_dl
|
import yt_dlp
|
||||||
import re
|
import re
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
@ -149,12 +149,12 @@ def save_media(post, location):
|
|||||||
if domain in PLATFORMS:
|
if domain in PLATFORMS:
|
||||||
options = {
|
options = {
|
||||||
"nocheckcertificate": True, "quiet": True, "no_warnings": True,
|
"nocheckcertificate": True, "quiet": True, "no_warnings": True,
|
||||||
"ignoreerrors": True,
|
"ignoreerrors": True, "no-progress": True,
|
||||||
"outtmpl": os.path.join(
|
"outtmpl": os.path.join(
|
||||||
location, "media", f"{readable_name}_{post.id}" + ".%(ext)s"
|
location, "media", f"{readable_name}_{post.id}" + ".%(ext)s"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
with youtube_dl.YoutubeDL(options) as ydl:
|
with yt_dlp.YoutubeDL(options) as ydl:
|
||||||
try:
|
try:
|
||||||
ydl.download([url])
|
ydl.download([url])
|
||||||
except:
|
except:
|
||||||
|
Loading…
Reference in New Issue
Block a user