Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restyle Directory problem resolved #5

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions ytb_flac.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

import youtube_dl

# Downloading new versions of the packages
Expand Down Expand Up @@ -75,12 +76,13 @@
path = directories[choice - 1].replace("\n", "")

# new directory
directory = input("\nEnter directory location name (empty if in this directory) -> ")
directory = input(
"\nEnter directory location name (empty if in this directory) -> ")

if directory == "exit":
quit()

elif directory[0] != "/":
elif len(directory) != 0 and directory[0] != "/":
directory = "/" + directory
directory.replace("\\", "/")

Expand All @@ -91,7 +93,9 @@
song_formats = ["flac", "mp3"]
while not 0 < choice < len(song_formats) + 1:
print("Choose music song format :")
print("\n".join(str(i + 1) + " -> " + song_formats[i] for i in range(len(song_formats))))
print("\n".join(
str(i + 1) + " -> " + song_formats[i]
for i in range(len(song_formats))))
choice = int(input("Your choice -> "))
if not 0 < choice < len(song_formats) + 1:
print("\nERROR - Enter correct number !\n")
Expand Down Expand Up @@ -121,9 +125,7 @@
file_directories.close()

except:
print(
"\nERROR - Check if the directory or the link is good.\n"
)
print("\nERROR - Check if the directory or the link is good.\n")

choice = input("\nDo you wanna continue downloading ? (y/n) -> ")

Expand Down