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

Trouble with loading from multi-line inputs.txt. #6

Open
criderthewriter opened this issue Aug 27, 2021 · 0 comments
Open

Trouble with loading from multi-line inputs.txt. #6

criderthewriter opened this issue Aug 27, 2021 · 0 comments

Comments

@criderthewriter
Copy link

When I pasted multiple links into inputs.txt, one on each line, downloader.py crashed every time I started it. I received the following traceback:

Traceback (most recent call last):
  File "D:\Users\Andrew Ryan Crider\Documents\Documents\Misc Documents\Programming\python\khinsider-mp3-downloader-master\downloader.py", line 98, in <module>
    fetch_from_url(line)
  File "D:\Users\Andrew Ryan Crider\Documents\Documents\Misc Documents\Programming\python\khinsider-mp3-downloader-master\downloader.py", line 30, in fetch_from_url
    os.makedirs(dir_name)
  File "C:\Users\Andrew Ryan Crider\AppData\Local\Programs\Python\Python38-32\lib\os.py", line 223, in makedirs
    mkdir(name, mode)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'downloads/axiom-verge-soundtrack\n'

However, I was able to get the downloader to work properly once I inserted the following lines of code between lines 97 and 98:

		if line.endswith('\n'):
			line = line.replace('\n','')

In my copy of downloader.py, likes 97 through 100 now look like this:

	for line in file:
		if line.endswith('\n'):
			line = line.replace('\n','')
		fetch_from_url(line)

My downloader was having trouble with newline characters. I'm not sure if this was a problem with the downloader or the way I was formatting inputs.txt, but I thought to point this out to you just in case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant