Discuss Scratch

1a3c5e7g9i
Scratcher
100+ posts

Backpack Reader: Save the contents of your Scratch 2.0 backpack directly

It's been more than a year since Scratch 3.0 released, yet I haven't found any tools that can save your Scratch 2.0 backpack from
https://scratch.mit.edu/internalapi/backpack/{YOUR USERNAME}/get/
So I thought I would make one myself, one year too late.

Backpack Reader saves your Scratch 2.0 backpack directly to your computer.
It can be found here.

To use it, first you would copy all of the text from the link above. Next, you would save it into a file (e.g. “backpack.txt”).
Finally, you'll need to open up your computer's terminal and type the following:
python3 backpackreader.py [any options go here] path/to/backpack.txt
(if you have a Mac (even Linux?), dragging the file into the terminal will drop the full file path onto the terminal cursor, saving you the hassle of typing the file path itself.)

After you press enter, it can take anywhere from a few seconds to upwards 4 minutes for all of the backpack contents to be downloaded.

This program requires you to have Python3 installed in your terminal (at least Python 3.6, or Python3.8 if you want to use it in IDLE).
Command line options:
	--    Empty argument, allows the program to run without extra args.

-h Prints the help text and abruptly exits.

-n Automatically renames the folder name of an entry if it clashes with the
folder name of another created entry. This is on by default.
Turning this on turns -u and -o off.

-o Automatically overwrites entries when the current entry's name clashes
with an already added entry. This flag is not recommended.
Turning this flag on turns -u and -n off.

-s Suppresses all output from this command.
Turning this flag on turns -v off.

-u Alerts the user when the current entry's name clashes with an
already existing one. The user can then either save the entry
under a predesignated name, overwrite the old entry or
abruptly exit.
Turning this flag on turns -o and -n off.

-v Turns verbose output on.
Turning this flag on turns -s off.

--no-zip-sprites
All extracted sprites won't automatically be zipped into
.sprite2 files.

--wrap-scripts-in-sprites
All scripts will be "wrapped" in sprites. Currently, the sprites
made from this won't load, therefore those sprites won't be
zipped.

--version
Prints the version number and exits.
__init__
Scratcher
1000+ posts

Backpack Reader: Save the contents of your Scratch 2.0 backpack directly

looks cool!

here's a tip: consider using argparse (built in to Python) for parsing command line options. it makes everything a lot easier.
1a3c5e7g9i
Scratcher
100+ posts

Backpack Reader: Save the contents of your Scratch 2.0 backpack directly

__init__ wrote:

looks cool!

here's a tip: consider using argparse (built in to Python) for parsing command line options. it makes everything a lot easier.

I didn't know that existed! I'll use it in my future programs.
--Explosion--
Scratcher
1000+ posts

Backpack Reader: Save the contents of your Scratch 2.0 backpack directly

Wow! This is amazing! Would it be possible to make this into a bookmarklet?
1a3c5e7g9i
Scratcher
100+ posts

Backpack Reader: Save the contents of your Scratch 2.0 backpack directly

If you reprogrammed it in Javascript, yeah. For a head-start, you can use JSZip to compress the resulting folder and the sprites. Requests should also be easy to work with, too.
1a3c5e7g9i
Scratcher
100+ posts

Backpack Reader: Save the contents of your Scratch 2.0 backpack directly

bump
lambodhar
Scratcher
42 posts

Backpack Reader: Save the contents of your Scratch 2.0 backpack directly

1a3c5e7g9i wrote:

It's been more than a year since Scratch 3.0 released, yet I haven't found any tools that can save your Scratch 2.0 backpack from
https://scratch.mit.edu/internalapi/backpack/{YOUR USERNAME}/get/
So I thought I would make one myself, one year too late.

Backpack Reader saves your Scratch 2.0 backpack directly to your computer.
It can be found here.

To use it, first you would copy all of the text from the link above. Next, you would save it into a file (e.g. “backpack.txt”).
Finally, you'll need to open up your computer's terminal and type the following:
python3 backpackreader.py [any options go here] path/to/backpack.txt
(if you have a Mac (even Linux?), dragging the file into the terminal will drop the full file path onto the terminal cursor, saving you the hassle of typing the file path itself.)

After you press enter, it can take anywhere from a few seconds to upwards 4 minutes for all of the backpack contents to be downloaded.

This program requires you to have Python3 installed in your terminal (at least Python 3.6, or Python3.8 if you want to use it in IDLE).
Command line options:
	--    Empty argument, allows the program to run without extra args.

-h Prints the help text and abruptly exits.

-n Automatically renames the folder name of an entry if it clashes with the
folder name of another created entry. This is on by default.
Turning this on turns -u and -o off.

-o Automatically overwrites entries when the current entry's name clashes
with an already added entry. This flag is not recommended.
Turning this flag on turns -u and -n off.

-s Suppresses all output from this command.
Turning this flag on turns -v off.

-u Alerts the user when the current entry's name clashes with an
already existing one. The user can then either save the entry
under a predesignated name, overwrite the old entry or
abruptly exit.
Turning this flag on turns -o and -n off.

-v Turns verbose output on.
Turning this flag on turns -s off.

--no-zip-sprites
All extracted sprites won't automatically be zipped into
.sprite2 files.

--wrap-scripts-in-sprites
All scripts will be "wrapped" in sprites. Currently, the sprites
made from this won't load, therefore those sprites won't be
zipped.

--version
Prints the version number and exits.
Does it actually work fine?

Powered by DjangoBB