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

add character SFX (blip, SoundN, FrameSFX) to the zip file #1

Merged
merged 6 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Web Downloader
Have you ever wanted to download your favorite character from WebAO? Now you can! Type in the name of the character you want and it will zip up all of theri animations.
Have you ever wanted to download your favorite character from WebAO? Now you can! Type in the name of the character you want and it will zip up all of their animations and sounds.

## Development
### Setting up your environment
Expand Down
5 changes: 3 additions & 2 deletions downloadandzip.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// stolen from https://huynvk.dev/blog/download-files-and-zip-them-in-your-browsers-using-javascript
import JsZip from 'jszip';
import FileSaver from 'file-saver';
import { BASE_CHARACTERS_URL } from './public/index';
import { BASE_URL } from './public/index';

const download = async (url) => {
return fetch(url).then(resp => {
const filename = url.slice(BASE_CHARACTERS_URL.length);
const filename = url.slice(BASE_URL.length);
return {
filename: filename,
blob: resp.blob()
Expand All @@ -20,6 +20,7 @@ const exportZip = (specificName, blobData) => {
blobData.forEach((blob) => {
zip.file(`${decodeURI(blob.filename)}`, blob.blob);
});

zip.generateAsync({type: 'blob'}).then(zipFile => {
const currentDate = new Date().getTime();
const fileName = `${charname}.zip`;
Expand Down
Loading
Loading