Skip to content

Commit

Permalink
First pass at downloader
Browse files Browse the repository at this point in the history
- Add page parsing tools
- Add link shortener bypasses (occasionally flaky, but generally seems OK)
- Add JDownloader hooks
- Update GUI
- Update docs
  • Loading branch information
bbtufty committed Oct 18, 2024
1 parent bb1e8b4 commit 89aabc7
Show file tree
Hide file tree
Showing 23 changed files with 1,418 additions and 90 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
NXBrew-dl is intended to be an easy-to-user interface to download ROMs, DLC and update files for NSP. It does so via
a GUI interface, allowing users to download items in bulk and keeping things up-to-date.

As of now, this is in extremely early development, and only currently acts as an interactive browser for the ROM
list on NXBrew. Downloads do not yet work!
As of now, this is in extremely early development. It will parse and download many ROMs, but be aware that currently
if multiple regions exist, it will only download the US release. This will be upgrade in a future release.

To get started, see the [documentation](https://nxbrew-dl.readthedocs.io/en/latest/).

Expand Down
Binary file modified docs/img/gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions docs/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ NXBrew-dl
.. image:: https://img.shields.io/badge/license-GNUv3-blue.svg?label=License&style=flat-square

NXBrew-dl is intended to be an easy-to-user interface to download ROMs, DLC and update files for NSP. It does so via
a GUI interface, allowing users to download items in bulk and keeping things up-to-date.
a GUI interface, allowing users to download items in bulk and keeping things up-to-date. NXBrew-dl connects to
JDownloader to allow for easy download/extraction from multiple sites.

As of now, this is in extremely early development, and only currently acts as an interactive browser for the ROM
list on NXBrew. Downloads do not yet work!
As of now, this is in extremely early development. It will parse and download many ROMs, but be aware that currently
if multiple regions exist, it will only download the US release. This will be upgrade in a future release.

For details on installation, see :doc:`installation <installation>`.

Expand Down
12 changes: 10 additions & 2 deletions docs/reference_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ GUI
:members:
:undoc-members:

=================
NXBrew Downloader
=================

.. autoclass:: nxbrew_dl.nxbrew_dl.NXBrew
:members:
:undoc-members:

=========
Utilities
=========

.. automodule:: nxbrew_dl.nxbrew_dl
.. automodule:: nxbrew_dl.util
:members:
:undoc-members:
:undoc-members:
16 changes: 14 additions & 2 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,20 @@ you will see an interface like this:

.. image:: img/gui.png

On the left is the config. This includes where downloads will be stored, whether you would like to prefer NSP or XCI
files, and whether you would like to download associated updates and DLC, if available.
On the left is the config. First, we have a download directly. NXBrew-dl will download files as
``[dir]/[Games/Updates/DLC]/[Game name]``, to keep things organized and clean.

Because we use JDownloader to handle downloading and extracting files, there are some config options required here. You
should enter your device name, username and password (see Settings->My.JDownloader in JDownloader for these, or to set
them up if you haven't already). Ensure that JDownloader is running on your download machine before you start
downloading!

.. note::
Because we prefer 1Fichier links over anything else, we strongly suggest investing in a premium
account if you'll be downloading a lot of files. An hour is a long time to wait!

Finally, we have ROM options. These are whether you prefer NSP or XCI files, and whether you would like to download
associated updates and DLC, if available.

The right shows the NXBrew index. Each is flagged with various properties, such as whether it has an NSP or XCI file,
updates, and DLC. By clicking the "DL?" button, you add to the list. You can filter using the search bar at the top.
Expand Down
5 changes: 5 additions & 0 deletions nxbrew_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from .gui import MainWindow

__all__ = [
"MainWindow",
]
78 changes: 77 additions & 1 deletion nxbrew_dl/configs/general.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,78 @@
dl_sites:
- "1Fichier"
- "FreeDL"
- "GoFile"
- "MegaUp"

dl_names:
Base Game:
- "Base Game"
Update:
- "Update"
DLC:
- "DLC"

forbidden_titles:
- "Latest RAW Game Updates [17th April 2024][47 New Updates] [DISCONTINUED]"
- "Latest RAW Game Updates [17th April 2024][47 New Updates] [DISCONTINUED]"

regions:
USA: "USA|UAS"
Europe: "EUR"
Japan: "JP|JPN|JAPAN"
Asia: "ASIA"
Korea: "KOR"
Taiwan: "TWN"
Hong Kong: "HKG"
Chinese Taiwan: "CHT"

languages:
English: "En(?:-[A-Z][A-Z])?"
Afrikaans: "Af"
Albanian: "Sq"
Arabic: "Ar"
Basque: "Eu"
Bulgarian: "Bg"
Catalan: "Ca"
Chinese (Simplified): "Zh-Hans|Zh"
Chinese (Traditional): "Zh-Hant|Zh"
Cornish: "Kw"
Croatian: "Hr"
Czech: "Cs"
Danish: "Da"
Dutch: "Nl"
Estonian: "Et"
Finnish: "Fi"
French: "Fr(?!-CA)(?:-[A-Z][A-Z])?"
French (Canadian): "Fr-CA"
Gaelic: "Gd"
German: "De"
Greek: "El"
Hebrew: "He"
Hindi: "Hi"
Hungarian: "Hu"
Icelandic: "Is"
Indonesian: "Id"
Italian: "It"
Japanese: "Ja"
Korean: "Ko"
Latvian: "Lv"
Lithuanian: "Lt"
Macedonian: "Mk"
Norwegian: "No"
Polish: "Pl"
Portuguese: "Pt(?!-BR)(?:-[A-Z][A-Z])?"
Portuguese (Brazilian): "Pt-BR"
Punjabi: "Pa"
Romanian: "Ro"
Russian: "Ru"
Serbian: "Sr"
Slovak: "Sk"
Slovenian: "Sl"
Spanish: "Es(?!-(MX|XL))(?:-[A-Z][A-Z])?"
Spanish (Latin American): "Es-XL"
Spanish (Mexican): "Es-MX"
Swedish: "Sv"
Tamil: "Ta"
Thai: "Th"
Turkish: "Tr"
Ukranian: "Uk"
17 changes: 10 additions & 7 deletions nxbrew_dl/gui/custom_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ def set_dl(

dl = QTableWidgetItem()
dl.setTextAlignment(Qt.AlignmentFlag.AlignHCenter)

# TODO: If this is in the cache, then auto-check it
dl.setCheckState(Qt.CheckState.Unchecked)

table.setItem(row_position, 1, dl)
Expand All @@ -37,16 +35,17 @@ def __init__(self, row_dict, row_name_key="long_name"):
Args:
row_dict (dict): Dictionary of row details
row_name_key (str): Column name to define the name for the row
TODO:
Some names don't have NSP or XCI. In which case, we probably want
to set a ??? for them
"""
super(TableRowWidget, self).__init__()

self.name = row_dict[row_name_key]
self.url = row_dict["url"]

# If we've parsed neither an NSP or XCI, mark as undefined
if not row_dict["has_nsp"] and not row_dict["has_xci"]:
row_dict["has_nsp"] = "UNDEF"
row_dict["has_xci"] = "UNDEF"

self.row_dict = row_dict
self.row_name_key = row_name_key

Expand Down Expand Up @@ -142,12 +141,16 @@ def set_filetype(
has_filetype.setTextAlignment(Qt.AlignmentFlag.AlignCenter)

# Set text and colour
if self.row_dict[key]:
if self.row_dict[key] == "UNDEF":
has_filetype.setText("???")
colour = QBrush(COLOURS["orange"])
elif self.row_dict[key]:
has_filetype.setText("Yes")
colour = QBrush(COLOURS["green"])
else:
has_filetype.setText("No")
colour = QBrush(COLOURS["red"])

colour.setStyle(Qt.BrushStyle.SolidPattern)
has_filetype.setBackground(colour)

Expand Down
Loading

0 comments on commit 89aabc7

Please sign in to comment.