black, add argparse
This commit is contained in:
parent
a5846854e5
commit
e318a6aaff
3 changed files with 8 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
black
|
black
|
||||||
|
argparse==1.4.0
|
||||||
dicttoxml==1.7.4
|
dicttoxml==1.7.4
|
||||||
mergedeep==1.3.4
|
mergedeep==1.3.4
|
||||||
music-tag==0.4.3
|
music-tag==0.4.3
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
from ytdl_subscribe.parse import parse_subscriptions
|
from ytdl_subscribe.parse import parse_subscriptions
|
||||||
|
|
||||||
|
parser = argparse.ArgumentParser(description="Process some integers.")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# execute only if run as a script
|
# execute only if run as a script
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,7 @@ class YoutubeSubscription(Subscription):
|
||||||
return entry
|
return entry
|
||||||
|
|
||||||
def extract_info(self):
|
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}"
|
url = f"https://youtube.com/playlist?list={playlist_id}"
|
||||||
track_ytdl_opts = {
|
track_ytdl_opts = {
|
||||||
"download_archive": self.WORKING_DIRECTORY + "/ytdl-download-archive.txt",
|
"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
|
# Load the entries from info.json, ignore the playlist entry
|
||||||
entries = []
|
entries = []
|
||||||
for file_name in os.listdir(self.WORKING_DIRECTORY):
|
for file_name in os.listdir(self.WORKING_DIRECTORY):
|
||||||
if file_name.endswith('.info.json') and not file_name.startswith(playlist_id):
|
if file_name.endswith(".info.json") and not file_name.startswith(
|
||||||
with open(self.WORKING_DIRECTORY + '/' + file_name, 'r') as f:
|
playlist_id
|
||||||
|
):
|
||||||
|
with open(self.WORKING_DIRECTORY + "/" + file_name, "r") as f:
|
||||||
entries.append(json.load(f))
|
entries.append(json.load(f))
|
||||||
|
|
||||||
entries = [self.parse_entry(e) for e in entries]
|
entries = [self.parse_entry(e) for e in entries]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue