Giter VIP home page Giter VIP logo

archive.org-gratefuldead-download-script's Introduction

archive.org-gratefuldead-download-script

Python script to download Grateful Dead shows from archive.org

The script downloads to a folder in the format of "date of show - venue". If a download is interrupted, it redownloads the last downloaded file and continues where it left off.

Usage:

python archivemusicdownload.py archive show id

Example:

python archivemusicdownload.py gd77-05-08.maizner.hicks.5002.sbeok.shnf

archive.org-gratefuldead-download-script's People

Contributors

jerrytingley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

archive.org-gratefuldead-download-script's Issues

Automatically append file extension

Loop in get_metadata changed to:

if file_data['format'] == 'VBR MP3':
new_file = {
'title' : file_data['title'],
'download_filename' : file_data['name'],
'file_extension' : '.mp3',
}
try:
new_file['local_filename'] = "%s. %s%s" % (file_data['track'], file_data['title'], new_file['file_extension'])
except KeyError:
new_file['local_filename'] = file_data['title'] + new_file['file_extension']
new_metadata['files'].append(new_file)

Windows filename sanitization

Add the following code to ensure filenames are valid on windows:

isWindows = os.name == "nt"
def windowsFileNameSanitizer(filename):
#removes invalid windows filename characters
invalidChars = '[<>:"/|?*]'
return re.sub(invalidChars, '', filename)

Then in download, the main loop is changed to:
for i, file_data in enumerate(metadata['files']):
local_filename = file_data['local_filename']
if (isWindows):
local_filename = windowsFileNameSanitizer(local_filename)
local_filename = "%s/%s" % (metadata['local_download_dir'], local_filename)
print "[..] Downloading %s (%i/%i)..." % (local_filename, i+1, file_count)
urlretrieve(metadata['download_base']+file_data['download_filename'], local_filename)

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.