Skip to content

Commit

Permalink
Pre-Generate RAP so PS3 can DL them (Fix #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
yne committed May 6, 2023
1 parent 0ed7a1a commit 469adcb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
all: config.txt pkgi_games.csv pkgi_dlcs.csv pkgi_themes.csv pkgi_avatars.csv pkgi_demos.csv pkgi_updates.csv pkgi_emulators.csv pkgi_apps.csv pkgi_tools.csv
config.txt:; echo "games dlcs themes avatars demos updates emulators apps tools" | tr ' ' '\n' |awk '{print "url_"$$1" https://yne.fr/psndl/pkgi_"$$1".csv"}' > $@
pkgi_%.csv: db.csv; awk -F "," 'BEGIN {type="$@";sub(/pkgi_/,"",type);sub(/.csv/,"",type);print "contentid,type,name,description,rap,url,size,checksum"} type == $$4 {print $$1"-"$$2"_00-0000112223333000,"$$4","$$6",-,"$$5",http://zeus.dl.playstation.net/cdn/"$$2"/"$$1"_00/"$$3".pkg,0,"}' $^ > $@
%.url: %.csv; awk -F "," '{print "http://zeus.dl.playstation.net/cdn/"$$2"/"$$1"_00/"$$3".pkg"}' $^ > $@
%.dup: %.csv; awk -F "," '{print $$1"/"$$2"/"$$3}' $^ | sort | uniq -d
PKGI_CATEGO := games dlcs themes avatars demos updates emulators apps tools
PKGI_PREFIX := pkgi_
PKGI_SUFFIX := .csv
PKGI_TARGET := $(addprefix $(PKGI_PREFIX),$(addsuffix $(PKGI_SUFFIX),$(PKGI_CATEGO)))
RAPS_TARGET := $(addsuffix .rap, $(shell awk -F, '{print $$5}' db.csv))

all: config.txt $(PKGI_TARGET) $(RAPS_TARGET)
clean:; rm -f config.txt $(PKGI_TARGET) $(RAPS_TARGET)

config.txt:; echo $(PKGI_CATEGO) | tr ' ' '\n' |awk '{print "url_"$$1" https://yne.fr/psndl/'$(PKGI_PREFIX)'"$$1"'$(PKGI_SUFFIX)'"}' > $@
$(PKGI_PREFIX)%$(PKGI_SUFFIX): db.csv; awk -F, 'BEGIN {type="$@";sub(/pkgi_/,"",type);sub(/.csv/,"",type);print "contentid,type,name,description,rap,url,size,checksum"} type == $$4 {print $$1"-"$$2"_00-0000112223333000,"$$4","$$6",-,"$$5",http://zeus.dl.playstation.net/cdn/"$$2"/"$$1"_00/"$$3".pkg,0,"}' $^ > $@
%.url: %.csv; awk -F, '{print "http://zeus.dl.playstation.net/cdn/"$$2"/"$$1"_00/"$$3".pkg"}' $^ > $@
%.dup: %.csv; awk -F, '{print $$1"/"$$2"/"$$3}' $^ | sort | uniq -d
%.rap: db.csv; printf %s $(basename $(notdir $@)) | xxd -r -p - > $@
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# PSNDL

Playstation Network Package [Search engine](http://yne.github.io/psndl)
and [PKGi-PS3](https://github.com/bucanero/pkgi-ps3) databases at https://yne.fr/psndl/config.txt
and [PKGi-PS3](https://github.com/bucanero/pkgi-ps3) databases at <https://yne.fr/psndl/config.txt>

Current dataset was aggragated from

Expand Down
9 changes: 0 additions & 9 deletions config.txt

This file was deleted.

3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
var hex = row[4];
if (!hex) return "";
if (hex == 0) return '<span>press Circle in ReactPSN</span>';
return '<a download="' + row[1] + '-' + row[0] + '_00-' + hex.substr(16) + '.rap" href="data:application/octet-stream,' + hex.replace(/../g, function(a){ return '%'+a;}) + '">RAP</a>';
return '<a download="' + row[1] + '-' + row[0] + '_00-' + hex.substr(16) + '.rap" href="' + hex.substr(16) + '.rap">RAP</a>';
//return '<a download="' + row[1] + '-' + row[0] + '_00-' + hex.substr(16) + '.rap" href="data:application/octet-stream,' + hex.replace(/../g, function(a){ return '%'+a;}) + '">RAP</a>';
}
function fetchDB() {
f.fetch.disabled = true;
Expand Down

0 comments on commit 469adcb

Please sign in to comment.