Giter Site home page Giter Site logo

khinsider-mp3-downloader's Introduction

khinsider-mp3-downloader

A script to crawl http://downloads.khinsider.com/ for game soundtracks and download them. Downloads will be placed inside a /downloads directory inside the repo. Individual directories for each album will be generated automatically off the url name.

Install

The only thing you need to install is python3: https://www.python.org/downloads/

Tested and working with python 3.8.

How To Use

inputs.txt

Update the inputs.txt in the repo with a list of links, one link per line, and then run the script $ python3 downloader.py. The repo includes a properly formatted inputs.txt for reference.

Input A URL Via CLI

If you'd prefer to manually enter URLs you can delete inputs.txt and then simply run $ python3 downloader.py from inside the repo and enter a link like 'http://downloads.khinsider.com/game-soundtracks/album/disgaea-3-raspberyl' (including the quotes) when prompted in the command line and hit enter.

khinsider-mp3-downloader's People

Contributors

trash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

khinsider-mp3-downloader's Issues

Can you transalte the installation for windows?

$ pip install virtualenv
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
it keeps saying source not recognized
PS C:\WINDOWS\system32> virtualenv venv
Traceback (most recent call last):
File "C:\Python27\Lib\runpy.py", line 174, in run_module_as_main
"main", fname, loader, pkg_name)
File "C:\Python27\Lib\runpy.py", line 72, in run_code
exec code in run_globals
File "C:\Python27\Scripts\virtualenv.exe__main
.py", line 9, in
File "c:\python27\lib\site-packages\virtualenv.py", line 711, in main
symlink=options.symlink)
File "c:\python27\lib\site-packages\virtualenv.py", line 924, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "c:\python27\lib\site-packages\virtualenv.py", line 1131, in install_python
copy_required_modules(home_dir, symlink)
File "c:\python27\lib\site-packages\virtualenv.py", line 1061, in copy_required_modules
dst_filename = change_prefix(filename, dst_prefix)
File "c:\python27\lib\site-packages\virtualenv.py", line 1035, in change_prefix
(filename, prefixes)
AssertionError: Filename C:\Python27\Lib\os.py does not start with any of these prefixes: ['C:\python27']
And this...

Trouble with loading from multi-line inputs.txt.

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.

Fix for / SyntaxError: invalid syntax / OSError: [WinError 123] / GuessedAtParserWarning

downloader.py Row 76
file_on_disk_path = dir_name + '/' + file_name
to
file_on_disk_path = dir_name + '\' + file_name

downloader.py Row 96
file = open(input_file_name, 'r')
to
file = open(input_file_name, 'r').read().splitlines()

downloader.py Row 34
soup = BeautifulSoup(urllib2.urlopen(url))
to
soup = BeautifulSoup(urllib2.urlopen(url), 'html.parser')

downloader.py Row 62
link_soup = BeautifulSoup(urllib2.urlopen(href))
to
link_soup = BeautifulSoup(urllib2.urlopen(href), 'html.parser')

Now its' working

Download: https://mega.nz/file/N5c2xT7a#8VXyeZFqRZju563qOb6SRgbb2qhUH96Z9R1LqBB3kMU

Any support for FLAC?

This is awesome! Thanks a lot for writing this. Is there any way to download FLAC with this script? I tried modifying it, but no luck. Any ideas?

Can't download soundtrack (works on other soundtracks)

Traceback (most recent call last):
File "C:\khinsider-master\khinsider.py", line 589, in
sys.exit(doIt())
File "C:\khinsider-master\khinsider.py", line 533, in doIt
success = download(soundtrack, outPath, formatOrder=formatOrder, verbose=True)
File "C:\khinsider-master\khinsider.py", line 408, in download
return Soundtrack(soundtrackId).download(path, makeDirs, formatOrder, verbose)
File "C:\khinsider-master\khinsider.py", line 323, in download
files.append(getAppropriateFile(song, formatOrder))
File "C:\khinsider-master\khinsider.py", line 168, in getAppropriateFile
return song.files[0]
IndexError: list index out of range

Doesn't work

tested on python 3.9.4 and after installing bs4 (something the instructions should mention)

$ python downloader.py
C:\Users\Alex\TempGitProjects\khinsider-mp3-downloader\downloader.py:34: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 34 of the file C:\Users\Alex\TempGitProjects\khinsider-mp3-downloader\downloader.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup constructor.

  soup = BeautifulSoup(urllib2.urlopen(url))
C:\Users\Alex\TempGitProjects\khinsider-mp3-downloader\downloader.py:62: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.

The code that caused this warning is on line 62 of the file C:\Users\Alex\TempGitProjects\khinsider-mp3-downloader\downloader.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup constructor.

  link_soup = BeautifulSoup(urllib2.urlopen(href))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.