more argparse
This commit is contained in:
parent
beef92408d
commit
9f1ee7cfa4
3 changed files with 42 additions and 27 deletions
|
|
@ -42,22 +42,30 @@ presets:
|
||||||
year: "{upload_year}"
|
year: "{upload_year}"
|
||||||
|
|
||||||
subscriptions:
|
subscriptions:
|
||||||
# ALISON:
|
ALISON:
|
||||||
# preset: "soundcloud_with_id3_tags"
|
preset: "soundcloud_with_id3_tags"
|
||||||
# soundcloud:
|
soundcloud:
|
||||||
# username: alis_on
|
username: alis_on
|
||||||
# output_path: "/Users/jesse.bannon/workspace/ytdl_subscribe/alison"
|
output_path: "/Users/jesse.bannon/workspace/ytdl_subscribe/alison"
|
||||||
# overrides:
|
overrides:
|
||||||
# artist: "A.L.I.S.O.N."
|
artist: "A.L.I.S.O.N."
|
||||||
# genre: "Synthwave / Electronic"
|
genre: "Synthwave / Electronic"
|
||||||
# delorra:
|
delorra:
|
||||||
# preset: "soundcloud_with_id3_tags"
|
preset: "soundcloud_with_id3_tags"
|
||||||
# soundcloud:
|
soundcloud:
|
||||||
# username: delorra
|
username: delorra
|
||||||
# output_path: "/Users/jesse.bannon/workspace/ytdl_subscribe/delorra"
|
output_path: "/Users/jesse.bannon/workspace/ytdl_subscribe/delorra"
|
||||||
# overrides:
|
overrides:
|
||||||
# artist: "DeLorra"
|
artist: "DeLorra"
|
||||||
# genre: "Synthwave / Electronic"
|
genre: "Synthwave / Electronic"
|
||||||
|
bl00dwave:
|
||||||
|
preset: "soundcloud_with_id3_tags"
|
||||||
|
soundcloud:
|
||||||
|
username: bl00dwave
|
||||||
|
output_path: "/Users/jesse.bannon/workspace/ytdl_subscribe/bl00dwave"
|
||||||
|
overrides:
|
||||||
|
artist: "bl00dwave"
|
||||||
|
genre: "Synthwave / Electronic"
|
||||||
|
|
||||||
tom_petty:
|
tom_petty:
|
||||||
youtube:
|
youtube:
|
||||||
|
|
@ -67,9 +75,9 @@ subscriptions:
|
||||||
overrides:
|
overrides:
|
||||||
artist: "Tom Petty and the Heartbreakers"
|
artist: "Tom Petty and the Heartbreakers"
|
||||||
|
|
||||||
# rammstein:
|
rammstein:
|
||||||
# url: "https://www.youtube.com/playlist?list=PLVTLbc6i-h_iuhdwUfuPDLFLXG2QQnz-x"
|
url: "https://www.youtube.com/playlist?list=PLVTLbc6i-h_iuhdwUfuPDLFLXG2QQnz-x"
|
||||||
# preset: "music_videos"
|
preset: "music_videos"
|
||||||
# output_path: "rammstein test"
|
output_path: "rammstein test"
|
||||||
# overrides:
|
overrides:
|
||||||
# artist: "Rammstein"
|
artist: "Rammstein"
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,26 @@ parser = argparse.ArgumentParser(
|
||||||
description="YoutubeDL-Subscribe: Download and organize your favorite media easily."
|
description="YoutubeDL-Subscribe: Download and organize your favorite media easily."
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--config",
|
"-c", "--config",
|
||||||
|
metavar='CONFIGPATH',
|
||||||
type=str,
|
type=str,
|
||||||
help="Path to the config yaml. Will look for subscriptions.yaml in the current directory if not provided",
|
help="path to the config yaml, uses subscriptions.yaml if not provided",
|
||||||
default="subscriptions.yaml",
|
default="subscriptions.yaml",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-s", "--subscriptions",
|
||||||
|
metavar='SUB',
|
||||||
|
nargs='+',
|
||||||
|
help='specific subscriptions to download, downloads all if not provided'
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# execute only if run as a script
|
|
||||||
subscriptions = parse_subscriptions(args.config)
|
subscriptions = parse_subscriptions(args.config)
|
||||||
|
if args.subscriptions:
|
||||||
|
subscriptions = [s for s in subscriptions if s.name in args.subscriptions]
|
||||||
|
|
||||||
for s in subscriptions:
|
for s in subscriptions:
|
||||||
s.extract_info()
|
s.extract_info()
|
||||||
print("hey")
|
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,6 @@ class SoundcloudSubscription(Subscription):
|
||||||
track_ytdl_opts = {
|
track_ytdl_opts = {
|
||||||
"download_archive": self.WORKING_DIRECTORY
|
"download_archive": self.WORKING_DIRECTORY
|
||||||
+ "/ytdl-download-archive.txt",
|
+ "/ytdl-download-archive.txt",
|
||||||
"forcejson": True,
|
|
||||||
}
|
}
|
||||||
# Get the album tracks first, but do not download. Unfortunately we cannot use download_archive for
|
# Get the album tracks first, but do not download. Unfortunately we cannot use download_archive for
|
||||||
# this be
|
# this be
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue