Fix colored output, and added vim swapfiles to gitignore
This commit is contained in:
parent
791e0b9fad
commit
51b07861e4
4
.gitignore
vendored
4
.gitignore
vendored
@ -11,3 +11,7 @@
|
|||||||
# Explicitly allow example files
|
# Explicitly allow example files
|
||||||
!/linklist-example.yaml
|
!/linklist-example.yaml
|
||||||
!/once-example.yaml
|
!/once-example.yaml
|
||||||
|
|
||||||
|
# Disallow swapfiles
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
@ -6,11 +6,11 @@ with open("linklist-music.yaml", "r") as yamlfile:
|
|||||||
config = yaml.safe_load(yamlfile)
|
config = yaml.safe_load(yamlfile)
|
||||||
|
|
||||||
for entry in config:
|
for entry in config:
|
||||||
print(f"\033[92mGrabbing '{entry['url']}':")
|
print(f"\033[92mGrabbing '{entry['url']}':\033[0m")
|
||||||
|
|
||||||
folderName = entry["folder-name"] if "folder-name" in entry else "%(uploader)s"
|
folderName = entry["folder-name"] if "folder-name" in entry else "%(uploader)s"
|
||||||
|
|
||||||
os.system(f"""
|
os.system(f"""
|
||||||
|
|
||||||
yt-dlp
|
yt-dlp
|
||||||
-c
|
-c
|
||||||
--extract-audio
|
--extract-audio
|
||||||
@ -24,7 +24,6 @@ with open("linklist-music.yaml", "r") as yamlfile:
|
|||||||
'{entry['url']}'
|
'{entry['url']}'
|
||||||
""".replace('\n', " ")
|
""".replace('\n', " ")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
except yaml.YAMLError as exc:
|
except yaml.YAMLError as exc:
|
||||||
print("You fucked up the yaml format.")
|
print("You fucked up the yaml format.")
|
||||||
|
@ -7,9 +7,9 @@ with open("once.yaml", "r") as yamlfile:
|
|||||||
config = yaml.safe_load(yamlfile)
|
config = yaml.safe_load(yamlfile)
|
||||||
|
|
||||||
for entry in config:
|
for entry in config:
|
||||||
print(f"\033[92mGrabbing {entry['type']} '{entry['url']}':")
|
print(f"\033[92mGrabbing {entry['type']} '{entry['url']}':\033[1m")
|
||||||
|
|
||||||
if entry["type"] == "music":
|
if entry["type"] == "music":
|
||||||
|
|
||||||
os.system(f"""
|
os.system(f"""
|
||||||
yt-dlp
|
yt-dlp
|
||||||
-c
|
-c
|
||||||
@ -23,7 +23,7 @@ with open("once.yaml", "r") as yamlfile:
|
|||||||
'{entry['url']}'
|
'{entry['url']}'
|
||||||
""".replace('\n', " ")
|
""".replace('\n', " ")
|
||||||
)
|
)
|
||||||
|
|
||||||
elif entry["type"] == "video" or entry["type"] == "videos":
|
elif entry["type"] == "video" or entry["type"] == "videos":
|
||||||
os.system(f"""
|
os.system(f"""
|
||||||
yt-dlp
|
yt-dlp
|
||||||
@ -40,3 +40,4 @@ with open("once.yaml", "r") as yamlfile:
|
|||||||
|
|
||||||
except yaml.YAMLError as exc:
|
except yaml.YAMLError as exc:
|
||||||
print("You fucked up the yaml format.")
|
print("You fucked up the yaml format.")
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@ with open("linklist-videos.yaml", "r") as yamlfile:
|
|||||||
config = yaml.safe_load(yamlfile)
|
config = yaml.safe_load(yamlfile)
|
||||||
|
|
||||||
for entry in config:
|
for entry in config:
|
||||||
print(f"\033[92mGrabbing '{entry['url']}':")
|
print(f"\033[92mGrabbing '{entry['url']}':\033[0m")
|
||||||
|
|
||||||
|
folderName = entry["folder-name"] if "folder-name" in entry else "%(uploader)s"
|
||||||
|
|
||||||
folderName = entry["folder-name"] if "folder-name" in entry else "%(uploader)s"
|
|
||||||
|
|
||||||
os.system(f"""
|
os.system(f"""
|
||||||
yt-dlp
|
yt-dlp
|
||||||
-c
|
-c
|
||||||
@ -22,7 +22,6 @@ with open("linklist-videos.yaml", "r") as yamlfile:
|
|||||||
'{entry['url']}'
|
'{entry['url']}'
|
||||||
""".replace('\n', " ")
|
""".replace('\n', " ")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
except yaml.YAMLError as exc:
|
except yaml.YAMLError as exc:
|
||||||
print("You fucked up the yaml format.")
|
print("You fucked up the yaml format.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user