dos2unix line endings

This commit is contained in:
Leonetienne 2022-03-23 20:53:43 +01:00
parent 32093b62b2
commit becec28e1c
3 changed files with 108 additions and 108 deletions

View File

@ -1,32 +1,32 @@
#!/bin/python
import yaml
import os
with open("linklist-music.yaml", "r") as yamlfile:
try:
config = yaml.safe_load(yamlfile)
for entry in config:
print(f"\033[92mGrabbing '{entry['url']}':\033[0m")
folderName = entry["folder-name"] if "folder-name" in entry else "%(uploader)s"
os.system(f"""
yt-dlp
-c
--extract-audio
--audio-format mp3
--merge-output-format mkv
-o 'music/{folderName}/%(title)s.%(ext)s'
--extractor-args youtube:player_client=android
--throttled-rate 100M
--restrict-filenames
--download-archive alreadydownloaded-music.txt
--match-filter "duration < 36000"
'{entry['url']}'
""".replace('\n', " ")
)
except yaml.YAMLError as exc:
print("You fucked up the yaml format.")
#!/bin/python
import yaml
import os
with open("linklist-music.yaml", "r") as yamlfile:
try:
config = yaml.safe_load(yamlfile)
for entry in config:
print(f"\033[92mGrabbing '{entry['url']}':\033[0m")
folderName = entry["folder-name"] if "folder-name" in entry else "%(uploader)s"
os.system(f"""
yt-dlp
-c
--extract-audio
--audio-format mp3
--merge-output-format mkv
-o 'music/{folderName}/%(title)s.%(ext)s'
--extractor-args youtube:player_client=android
--throttled-rate 100M
--restrict-filenames
--download-archive alreadydownloaded-music.txt
--match-filter "duration < 36000"
'{entry['url']}'
""".replace('\n', " ")
)
except yaml.YAMLError as exc:
print("You fucked up the yaml format.")

View File

@ -1,46 +1,46 @@
#!/bin/python
# 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']}':\033[1m")
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
--match-filter "duration < 36000"
'{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
--match-filter "duration < 36000"
'{entry['url']}'
""".replace('\n', " ")
)
except yaml.YAMLError as exc:
print("You fucked up the yaml format.")
#!/bin/python
# 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']}':\033[1m")
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
--match-filter "duration < 36000"
'{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
--match-filter "duration < 36000"
'{entry['url']}'
""".replace('\n', " ")
)
except yaml.YAMLError as exc:
print("You fucked up the yaml format.")

View File

@ -1,30 +1,30 @@
#!/bin/python
import yaml
import os
with open("linklist-videos.yaml", "r") as yamlfile:
try:
config = yaml.safe_load(yamlfile)
for entry in config:
print(f"\033[92mGrabbing '{entry['url']}':\033[0m")
folderName = entry["folder-name"] if "folder-name" in entry else "%(uploader)s"
os.system(f"""
yt-dlp
-c
--merge-output-format mkv
-o 'videos/{folderName}/%(title)s.%(ext)s'
--extractor-args youtube:player_client=android
--throttled-rate 100M
--restrict-filenames
--download-archive alreadydownloaded-videos.txt
--match-filter "duration < 36000"
'{entry['url']}'
""".replace('\n', " ")
)
except yaml.YAMLError as exc:
print("You fucked up the yaml format.")
#!/bin/python
import yaml
import os
with open("linklist-videos.yaml", "r") as yamlfile:
try:
config = yaml.safe_load(yamlfile)
for entry in config:
print(f"\033[92mGrabbing '{entry['url']}':\033[0m")
folderName = entry["folder-name"] if "folder-name" in entry else "%(uploader)s"
os.system(f"""
yt-dlp
-c
--merge-output-format mkv
-o 'videos/{folderName}/%(title)s.%(ext)s'
--extractor-args youtube:player_client=android
--throttled-rate 100M
--restrict-filenames
--download-archive alreadydownloaded-videos.txt
--match-filter "duration < 36000"
'{entry['url']}'
""".replace('\n', " ")
)
except yaml.YAMLError as exc:
print("You fucked up the yaml format.")