initial commit
This commit is contained in:
commit
0007acad90
13 changed files with 1893 additions and 0 deletions
31
scripts/squid-dl
Executable file
31
scripts/squid-dl
Executable file
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python3
|
||||
from squid_dl import main
|
||||
from sys import argv as ARGV
|
||||
|
||||
if __name__ == "__main__":
|
||||
name = ARGV.pop(0)
|
||||
welcome = (
|
||||
""
|
||||
+ " ⣠⣾⢿⣿⣷⣦ \n"
|
||||
+ " ⣀⣼⢟⡱⣆⡹⠹⣿⣇ ⢠⣶⣿⠿⣦⡀ \n"
|
||||
+ " ⠈⠛⠛⠊⠉⠁ ⠹⣿⣧⡀ ⢠⣿⠏⠁⠝⢪⣻⡦ \n"
|
||||
+ " ⠙⢻⣿⡄ ⣴⣿⠏ \n"
|
||||
+ " ⣿⣷ ⢸⣿⠁ \n"
|
||||
+ " ⢀⣽⣿⣿⣿⣿⣿⣶⣦⣼⠟ \n"
|
||||
+ " ⣀⡀ ⢀⣴⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣷⡀ \n"
|
||||
+ "⢀⣴⣿⡿⢿⣷⡄ ⣼⣿⣿⣿⣿ ⠈⠙⠻⣿⣿⣿⣿⣷ \n"
|
||||
+ "⣾⣿⠱⠉⠛⣿⣿⣄ ⣀⣿⣿⣿⣿⣿ ⣀⣽⣿⣿⣿ ⣠⣶⣿⣷⣦⡀\n"
|
||||
+ "⠈⠁ ⠙⠿⠿⠛⠛⢻⣿⣿⣿⣿ ⣀⣴⣾⣿⣿⣿⣿⣿⣤⣾⣿⡿⠖⡯⢿⣷\n"
|
||||
+ " ⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠉⠛⠛⠉ ⠹⠟\n"
|
||||
+ " ⢀⣴⡾⠟⠿⣿⣿⣿⣿⠿⢿⡍ \n"
|
||||
+ " ⣀⣾⡟ ⠈⣿⣶⣤⣤⣄⡀ \n"
|
||||
+ " ⣰⣾⣿⣿⣿⣿⠏ ⠈⠛⠛⢿⣿⣿⣦ \n"
|
||||
+ " ⠛⠉⠉⠉⠉ _ _ ⠈⠻⣿⣿⣇_ _\n"
|
||||
+ " ___ __ _ _ _(_)__| |___ __| | |\n"
|
||||
+ "(_-</ _` | || | / _` |___/ _` | |\n"
|
||||
+ "/__/\__, |\_,_|_\__,_| \__,_|_|\n"
|
||||
+ " |_|\n\n"
|
||||
)
|
||||
print(welcome)
|
||||
|
||||
exit(main(args=ARGV, name=name))
|
||||
54
scripts/squidson
Executable file
54
scripts/squidson
Executable file
|
|
@ -0,0 +1,54 @@
|
|||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import json as j
|
||||
from yt_dlp import YoutubeDL
|
||||
from yt_dlp.utils import encodeFilename, sanitize_path
|
||||
|
||||
"""
|
||||
Dump yt_dlp's entire info_dict for a whole playlist in JSON format.
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⠤⠲⠦⠉⠉⠉⠏⠉⠒⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡠⠲⠃⢀⣤⠀⠀⠀⠲⠂⠀⠠⠆⠀⠙⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⢀⡔⠁⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⢀⠊⠁⠀⢁⡴⠚⠉⣉⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⣀⠠⠤⠔⠒⡄⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⡆⢰⠆⠀⠋⣠⠔⠉⠁⣀⡠⠄⠒⠂⠀⠀⠀⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠔⠊⠁⠀⠀⠀⠀⠀⣠⡴⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⢠⡆⠀⠀⠀⡜⠁⣠⠔⠋⢁⡔⠒⠒⠤⡀⠀⠀⠀⠀⡐⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⠀⢀⣀⣤⣶⡾⠋⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⡆⡶⠀⠀⢀⡜⠁⢀⣀⢸⠀⠀⠀⠀⠈⢆⠀⠀⡜⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠤⠊⠁⠀⢀⡀⣴⡿⠿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠰⡀⠀⠀⠘⠀⡞⠁⠀⠉⢇⠀⣿⣄⠀⠈⡆⠀⠕⠒⠉⣉⡒⡄⠀⠀⠀⠀⢀⠤⠊⠁⢀⡠⠔⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⡀⠀⠀⢇⠀⣤⡄⠈⢢⡈⠻⡖⢀⡞⣀⠔⠊⠁⠀⠀⠉⠐⠒⠠⢎⢁⡠⠔⠂⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠉⠉⢂⠘⢿⣦⡇⠉⠓⢶⡫⠞⠁⣀⣤⣤⣤⣤⣤⣤⣤⠴⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢡⠦⠭⡇⠀⡠⠊⠀⣠⣮⣬⣿⣿⣿⣿⣿⣯⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⠁⢀⠔⡧⠊⠀⢀⡜⠁⠙⣿⣿⣿⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣀⣡⠎⠀⠀⢠⠊⠀⠀⠀⣸⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⠃⠀⠀⣰⣧⣀⣀⡠⣴⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢧⣤⣤⣾⡿⠿⠋⠁⠀⢹⣿⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠁⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⠿⠛⠛⠛⠛⠻⢿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡸⠀⠀⠀⠀⠀⠀⠀⡸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⠁⡰⢤⣀⣀⡄⢠⠞⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
"""
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
"playlist_url",
|
||||
type=str,
|
||||
help="URL of playlist to download as JSON",
|
||||
)
|
||||
opts = parser.parse_args()
|
||||
|
||||
y = YoutubeDL({"ignoreerrors": True})
|
||||
info_dict = y.sanitize_info(
|
||||
y.extract_info(opts.playlist_url, download=False)
|
||||
)
|
||||
|
||||
dump_path = encodeFilename(sanitize_path(info_dict["title"] + ".json"))
|
||||
print(
|
||||
'[INFO]: Writing JSON-ified playlist info_dict to "{}"'.format(
|
||||
dump_path
|
||||
)
|
||||
)
|
||||
dumpfile = open(dump_path, mode="w")
|
||||
dumpfile.write(j.dumps(info_dict, sort_keys=True, indent=2))
|
||||
dumpfile.close()
|
||||
Loading…
Add table
Add a link
Reference in a new issue