Homebrew RELEASE NSP Indexer

duckbill007

Well-Known Member
Member
Joined
May 5, 2011
Messages
683
Trophies
1
XP
2,461
Country
Russia
DBI supports only Directory listing in apache style. The same listing provides nginx and some other http servers. All of them are using relative hrefs.

Your script produces totally different output: list of files with absolute urls. If I understand correct they can be even from different folders. This type of listing is not supported.
 
  • Like
Reactions: proconsule54

proconsule54

Well-Known Member
OP
Member
Joined
Nov 5, 2019
Messages
754
Trophies
1
Age
43
XP
2,685
Country
Italy
i use relative href but since the basepath have index.php and so on the final path in DBI isn't accepted.
On a web browser (like chrome) this isn't a issue since the index.php url is removed by browser


Code:
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[   ]"></td><td><a href="data/games/MONSTER%20HUNTER%20RISE%5B0100B04011742000%5D%5BUS%5D%5Bv0%5D.nsp">MONSTER HUNTER RISE[0100B04011742000][US][v0].nsp</a></td><td>2021-28-03 14:34</td><td align="right">6.6G</td><td></td>&nbsp;</tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[   ]"></td><td><a href="data/games/MONSTER%20HUNTER%20RISE%5B0100B04011742800%5D%5BUS%5D%5Bv393216%5D.nsp">MONSTER HUNTER RISE[0100B04011742800][US][v393216].nsp</a></td><td>2021-28-06 23:25</td><td align="right">3.3G</td><td></td>&nbsp;</tr>
<tr><td valign="top"><img src="/icons/unknown.gif" alt="[   ]"></td><td><a href="data/games/MONSTER%20HUNTER%20STORIES%202%20WINGS%20OF%20RUIN%5B0100E21011446000%5D%5BUS%5D%5Bv0%5D.nsp">MONSTER HUNTER STORIES 2 WINGS OF RUIN[0100E21011446000][US][v0].nsp</a></td><td>2021-12-07 11:43</td><td align="right">13.2G</td><td></td>&nbsp;</tr>
<

On chrome it produce

http://10.34.0.2/switch/data/games/MONSTER HUNTER RISE[0100B04011742000][US][v0].nsp
valid path

on DBI i suspect it produce

http://10.34.0.2/switch/index.php?DBI/data/games/MONSTER HUNTER RISE[0100B04011742000][US][v0].nsp
invalid path
 

proconsule54

Well-Known Member
OP
Member
Joined
Nov 5, 2019
Messages
754
Trophies
1
Age
43
XP
2,685
Country
Italy
If I understand correct they can be even from different folders.
This is the main reason for generating this type of directory listing instead relying on apache default dir listing

Proposal (if you want to do and have some free time):

Add a type Scripting(or whatever you want) with this changes over ApaceHTTP type:
  • remove / endswith on path check for adding to main menu (so a path like http://test.com/test.php is accepted)
  • on download url link creation use a temp std::string variable with the url removed anything after the last / of url (so it will be http://test.com/)
In this way no other changes on your directory listing implementation will changes, but me and others can do home server more flexible.

Tanks for your time and patience
 
  • Like
Reactions: mathew77

duckbill007

Well-Known Member
Member
Joined
May 5, 2011
Messages
683
Trophies
1
XP
2,461
Country
Russia
Yes. Proposed change is acceptable. There definetly should be new source type, like 'URL_List' or 'HREF_List'. I do not want to change existing implementation because it works as expected.
One addition to proposed changes - do accept absolute http(s) links as is.

--------------------- MERGED ---------------------------

OR! It can be better! Just URL_List with absolute urls one at each line (no html at all, just text/plain):
Code:
http://10.34.0.2/switch/index.php?DBI/data/games/MONSTER HUNTER RISE[0100B04011742000][US][v0].nsp
http://10.34.0.2/switch/index.php?DBI/data/games/MONSTER HUNTER RISE[0100B04011742800][US][v65536].nsp
 

proconsule54

Well-Known Member
OP
Member
Joined
Nov 5, 2019
Messages
754
Trophies
1
Age
43
XP
2,685
Country
Italy
@duckbill007 Gald to see you like the proposal.
Sure a plain text list of links one per line asbolute path will be perfect, for me and any other want to make his own script.

I make changes to my script

just to know you prefer \r\n or just \n at line end?
 

jangrewe

Member
Newcomer
Joined
Jul 23, 2021
Messages
9
Trophies
0
Age
42
XP
44
Country
Germany
Hi @proconsule54, i just found your NSP Indexer while looking for a NSP manager (and discovered DBI along the way, just wow!) and decided to take your script for a spin... so far, so good, but i'm really itching to do a bit of refactoring, e.g. automatic download and refresh of the JSON files, a bit more restructuring, external config file... the usual stuff.
I know i could just fork it and do it the way i want, but i wanted to check with your first if you're planning any big changes right now that would potentially make a merge request very messy. ;-)
 
  • Like
Reactions: proconsule54

proconsule54

Well-Known Member
OP
Member
Joined
Nov 5, 2019
Messages
754
Trophies
1
Age
43
XP
2,685
Country
Italy
@jangrewe Yes i am planning big changes on it
  • recursive directory listing
  • the autoupdate of json function is planned also (depending on permission of the webserver)
  • external config file is a good idea and i'll do it
  • and finally if switch is in the same net of webserver (or port 2000 of switch is reachable in some way) NETINSTALL for title installer like awoo installer or others with tinfoil net install type
If you have some suggestion let me know i love to know it.
I am not so good in css :ohnoes: so help is really appreciated

What OS/Webserver are you using?
 
Last edited by proconsule54,

jangrewe

Member
Newcomer
Joined
Jul 23, 2021
Messages
9
Trophies
0
Age
42
XP
44
Country
Germany
Okay, let me whip up a quick & dirty version of my changes. :-)
I got a bit of experience with webinterfaces like this, so it should be rather fast...

I'm on Debian with Nginx.
 
  • Like
Reactions: proconsule54

duckbill007

Well-Known Member
Member
Joined
May 5, 2011
Messages
683
Trophies
1
XP
2,461
Country
Russia
just to know you prefer \r\n or just \n at line end?
As linux userr I prefer \n but it should not matter. My line reading functions accepts any.

--------------------- MERGED ---------------------------

Output of plaintext list of absolute links with ?DBI $_GET parameter
OK. In next few days I'll add this to DBI.
 

jangrewe

Member
Newcomer
Joined
Jul 23, 2021
Messages
9
Trophies
0
Age
42
XP
44
Country
Germany
Here's a somewhat refactored version, still heavily WIP: Github -> jangrewe/nspindexer (can't post links yet, too new user)
I'm working towards separating the logic part from the layout part, so that in the end you have a dumb API that gives you a JSON you can render with JS.
The Tinfoil & DBI functionality is and will of course stay untouched (besides a couple of tweaks).

I'm struggling a bit with your logic of matching the Title IDs, and i noticed some serious problems if the file naming is not on point (e.g. DLC being seen as Updates), but we'll eventually get there.

All of your points above a addressed, more or less, except for the NETINSTALL functionality - i'll have too look into that, when everything else is done ;-)
 
  • Like
Reactions: proconsule54

proconsule54

Well-Known Member
OP
Member
Joined
Nov 5, 2019
Messages
754
Trophies
1
Age
43
XP
2,685
Country
Italy
Here's a somewhat refactored version, still heavily WIP: Github -> jangrewe/nspindexer (can't post links yet, too new user)
I'm working towards separating the logic part from the layout part, so that in the end you have a dumb API that gives you a JSON you can render with JS.
The Tinfoil & DBI functionality is and will of course stay untouched (besides a couple of tweaks).

I'm struggling a bit with your logic of matching the Title IDs, and i noticed some serious problems if the file naming is not on point (e.g. DLC being seen as Updates), but we'll eventually get there.

All of your points above a addressed, more or less, except for the NETINSTALL functionality - i'll have too look into that, when everything else is done ;-)

I looked at it, very good. the code is more sane for matching nsp. config file is good.
But it lacks download link for nsp and update, json download will work if you have permission so consider to tell if this happen or not to user

and consider that one can have really large nsp collection. with this layout page can be very long.

Edit:
i like bootstrap but i don't want any external deps for keep it simple (consider using of bulma css as is 1 file css only)
if cache dir is lacking or have wrong permission it must be told to user
 
Last edited by proconsule54,

jangrewe

Member
Newcomer
Joined
Jul 23, 2021
Messages
9
Trophies
0
Age
42
XP
44
Country
Germany
oh, those current changes came after my initial reply, i just had to go to bed at some point and pushed what was there so far ;-)

i initially added automatic creation of the cache dir for the downloaded JSON files, but just noticed that it doesn't happen for the generated JSON - that's fixed now. I'll add a permission warning later...

the layout is by far not done, it was just a quick PoC to get the generated JSON into the frontend, as i mainly focused on the backend code so far. download links and DLC lists and version info is of course planned!

i also plan to package the JS deps in the long run, but for development it's a good way to get started ;-)
 
  • Like
Reactions: proconsule54

proconsule54

Well-Known Member
OP
Member
Joined
Nov 5, 2019
Messages
754
Trophies
1
Age
43
XP
2,685
Country
Italy
Good, i am starting manualy merging some of your code (like recursive list and regex).
layout is good, maybe too big for each nsp entry. but can be useful for adding a toolbox (like download, netinstall or so on)

the DBI code is old, grab the new one.

Netinstall code will be a separate php file so when done it can be easly used with your fork

--------------------- MERGED ---------------------------

We can setup a devel branch to work better.
 
  • Like
Reactions: jangrewe

jangrewe

Member
Newcomer
Joined
Jul 23, 2021
Messages
9
Trophies
0
Age
42
XP
44
Country
Germany
Thanks! :-)
One more post and i can even share a preview :D

--------------------- MERGED ---------------------------

So here's the preview of what it currently looks like:
preview.jpg
 

duckbill007

Well-Known Member
Member
Joined
May 5, 2011
Messages
683
Trophies
1
XP
2,461
Country
Russia
Just tried latest version.
It prooduces somethig strange:
Code:
://192.168.1.47/Nintendo/Switch/Action & Arcade/Good Job! [0100B0500FE4E000][v0].nsz
://192.168.1.47/Nintendo/Switch/Action & Arcade/NAMCO Museum/NAMCO MUSEUM ARCHIVES Vol 1 [010084E010E18000][v0].nsz
://192.168.1.47/Nintendo/Switch/Action & Arcade/NAMCO Museum/NAMCO MUSEUM ARCHIVES Vol 1 [010084E010E18800][v131072].nsz
://192.168.1.47/Nintendo/Switch/Action & Arcade/NAMCO Museum/NAMCO MUSEUM ARCHIVES Vol 2 [0100BCE010E1A000][v0].nsz
://192.168.1.47/Nintendo/Switch/Action & Arcade/NAMCO Museum/NAMCO MUSEUM ARCHIVES Vol 2 [0100BCE010E1A800][v65536].nsz
://192.168.1.47/Nintendo/Switch/Action & Arcade/PONG Quest/PONG Quest [010069900FD68000][v0].nsz

--------------------- MERGED ---------------------------

why no http? and why urls are not encoded?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://youtu.be/MddR6PTmGKg?si=mU2EO5hoE7XXSbSr