Copy Link
Add to Bookmark
Report

NULL mag Issue 06 18 ripping 16 colo.rs

eZine's profile picture
Published in 
null magazine
 · 26 Dec 2020

  




would you like to have a complete set of all ansi packages in your pc?
if you don't, you just finished reading this :) all the others
continue...

the simple way is to use the old sixteencolors github account to get
the packs. with a simple command like:

git clone https://github.com/sixteencolors/sixteencolors-archive

we are done... :? because of the size it will get you some time to
download all packages. so lets break the task in smaller ones. lets
download the packages by year, as listed in the repo. to do so, we
must also install svn package. a simple script to get packages by
year is this:

#!/bin/bash
if [[ -z "$1" ]]; then
echo "Usage: "
echo " $0 <year>"
else
svn checkout https://github.com/sixteencolors/sixteencolors-archive/trunk/$1
fi
make it executable and use like: ./scriptname 2001 to get all packages
for year 2001.

finished?... not yet... i noticed that this repo doesn't have all the
packages, like 16colo.rs site does. some are missing... so to get them
all... (like the pokemons, gonna catch them all :p ) we will also have
to rip 16colo.rs.

so... i give you the power! but use it with responsibility! i am not
responsible for any misbehaving of yours. 16colo.rs is a great site
and we have to be responsible with it. so do not download all at once
each pack. use the script just to find missing packs from the git repo
above. you'be been warned!
to the script... so the script downloads all packs from a specific
year, from the 16colo.rs website. because some of them are too big and
personally didn't want them, i placed a "size check" and if the size
is bigger than 10MB it doesn't download it. you can remove that if you
want.

you could also add a check for the file if all ready exists and if so,
don't get it again. it will make things quicker. this is your homework
:p

#!/bin/bash
max=10485760 #10MB
curl https://16colo.rs/year/$1/$2 | grep "href=\"/pack*/" | \
cut -d "
\"" -f2 | cut -d "/" -f3 > tmp.txt
while read -r line; do
ss=$(wget --spider https://16colo.rs/archive/$1/$line.zip 2>&1 | \
awk '/Length/ {print $2}')

if [ "$ss" -gt "$max" ]; then
echo "File: $line is too big. Not Downloading."
else
echo "$line : ok"
wget https://16colo.rs/archive/$1/$line.zip
fi

done < tmp.txt
rm tmp.txt
use it like this: ./scriptname <year> <page>
you know what the <year> is, but let me explain <page>. if you go to
the 16colo.rs website and browse packs from a specific year you may
see that it has more than one page to show. thats the page number. an
example. to download the packages from this page:

https://16colo.rs/year/1998/2

you will execute the script like: ./scriptname 1998 2

got it? if no press N, if yes press Y...

16colo.rs



← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT