Added possibility to download stuff once

This commit is contained in:
Leonetienne committed 2022-02-04 15:15:59 +01:00
1 parent c710e4b892
commit 9b6e9fc7a6
5 files changed
+46 -3

No files matched your search

+2 -1
View File
@@ -1,4 +1,5 @@
/music/
/videos/
/linklist-*.txt
/alreadydownloaded-*.txt
/alreadydownloaded*.txt
/once.yaml
File renamed without changes.
+42
View File
@@ -0,0 +1,42 @@
# This script is for downloading stuff ONCE. This is for, let's say, playlists that will never change again that you want to download.
import yaml
import os
with open("once.yaml", "r") as yamlfile:
try:
config = yaml.safe_load(yamlfile)
for entry in config:
print(f"\033[92mGrabbing {entry['type']} '{entry['url']}':")
if entry["type"] == "music":
os.system(f"""
yt-dlp
-c
--extract-audio
--audio-format mp3
-o 'music/{entry['folder-name']}/%(title)s.%(ext)s'
--extractor-args youtube:player_client=android
--throttled-rate 100M
--restrict-filenames
--download-archive alreadydownloadedonce-music.txt
'{entry['url']}'
""".replace('\n', " ")
)
elif entry["type"] == "video" or entry["type"] == "videos":
os.system(f"""
yt-dlp
-c
--merge-output-format mkv
-o 'videos/{entry['folder-name']}/%(title)s.%(ext)s'
--extractor-args youtube:player_client=android
--throttled-rate 100M
--restrict-filenames
--download-archive alreadydownloadedonce-videos.txt
'{entry['url']}'
""".replace('\n', " ")
)
except yaml.YAMLError as exc:
print("You fucked up the yaml format.")
+1 -1
View File
@@ -6,4 +6,4 @@ yt-dlp \
--extractor-args youtube:player_client=android \
--throttled-rate 100M \
--restrict-filenames \
--download-archive alreadydownloaded-video.txt
--download-archive alreadydownloaded-videos.txt
+1 -1
View File
@@ -1,2 +1,2 @@
./download-videos.sh
./download-mp3.sh
./download-music.sh