2020-03-03 06:16:01 -06:00
|
|
|
#! /usr/bin/env python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim:fenc=utf-8:ft=python
|
|
|
|
#
|
|
|
|
# Bad Witch
|
|
|
|
# Copyright © 2020 Vintage Salt <rehashedsalt@cock.li>
|
|
|
|
#
|
|
|
|
# Distributed under terms of the MIT license.
|
|
|
|
#
|
|
|
|
|
|
|
|
import argparse
|
|
|
|
import sys
|
|
|
|
|
2020-03-03 06:34:49 -06:00
|
|
|
class Library:
|
|
|
|
# A big thing full of songs
|
|
|
|
def __init__(self):
|
|
|
|
return
|
|
|
|
|
|
|
|
class Song:
|
|
|
|
# An item with metadata and a source
|
|
|
|
def __init__(self, title, source):
|
|
|
|
self.title = title or 'Untitled song'
|
|
|
|
self.source = source or ''
|
|
|
|
|
2020-03-03 06:16:01 -06:00
|
|
|
class BadWitch:
|
2020-03-03 06:34:49 -06:00
|
|
|
# Our program
|
2020-03-03 06:16:01 -06:00
|
|
|
def __init__(self):
|
|
|
|
# Set up arguments
|
|
|
|
self.argparser = argparse.ArgumentParser(description='Manage a declarative music library through YouTube scraping')
|
2020-03-03 06:21:50 -06:00
|
|
|
self.argparser.add_argument('action', metavar='action', nargs='+',
|
|
|
|
choices=['download', 'add', 'remove'],
|
|
|
|
help='Action to perform on the library')
|
|
|
|
self.argparser.add_argument('-l', '--library', metavar='f', nargs=1,
|
|
|
|
help='Override default library file with this one')
|
2020-03-03 06:16:01 -06:00
|
|
|
self.argparser.add_argument('-v', '--verbose', action='store_true',
|
|
|
|
help='Show more status messages')
|
|
|
|
|
|
|
|
def execute(self):
|
|
|
|
self.args = self.argparser.parse_args()
|
|
|
|
if self.args.verbose:
|
|
|
|
print(self.args.config)
|
|
|
|
print(self.args.downloadall)
|
|
|
|
print(self.args.verbose)
|
|
|
|
|
2020-03-03 06:34:49 -06:00
|
|
|
def load(self, library):
|
|
|
|
# Load a library as an object
|
|
|
|
return
|
|
|
|
|
|
|
|
def add(self, song):
|
|
|
|
# Add a song to the library
|
|
|
|
return
|
|
|
|
|
|
|
|
def remove(self):
|
|
|
|
# Use keyword arguments here
|
|
|
|
# Remove a song based on criterea
|
|
|
|
return
|
|
|
|
|
2020-03-03 06:16:01 -06:00
|
|
|
badwitch = BadWitch()
|
|
|
|
badwitch.execute()
|