black, add argparse

This commit is contained in:
Jesse Bannon 2021-09-10 21:30:55 -07:00
parent a5846854e5
commit e318a6aaff
3 changed files with 8 additions and 3 deletions

View file

@ -1,4 +1,5 @@
black
argparse==1.4.0
dicttoxml==1.7.4
mergedeep==1.3.4
music-tag==0.4.3

View file

@ -1,5 +1,7 @@
from ytdl_subscribe.parse import parse_subscriptions
parser = argparse.ArgumentParser(description="Process some integers.")
if __name__ == "__main__":
# execute only if run as a script

View file

@ -247,7 +247,7 @@ class YoutubeSubscription(Subscription):
return entry
def extract_info(self):
playlist_id = self.options['playlist_id']
playlist_id = self.options["playlist_id"]
url = f"https://youtube.com/playlist?list={playlist_id}"
track_ytdl_opts = {
"download_archive": self.WORKING_DIRECTORY + "/ytdl-download-archive.txt",
@ -263,8 +263,10 @@ class YoutubeSubscription(Subscription):
# Load the entries from info.json, ignore the playlist entry
entries = []
for file_name in os.listdir(self.WORKING_DIRECTORY):
if file_name.endswith('.info.json') and not file_name.startswith(playlist_id):
with open(self.WORKING_DIRECTORY + '/' + file_name, 'r') as f:
if file_name.endswith(".info.json") and not file_name.startswith(
playlist_id
):
with open(self.WORKING_DIRECTORY + "/" + file_name, "r") as f:
entries.append(json.load(f))
entries = [self.parse_entry(e) for e in entries]