master 34adbbf5218c cached
30 files
1.5 MB
483.6k tokens
100 symbols
1 requests
Download .txt
Showing preview only (1,592K chars total). Download the full file or copy to clipboard to get everything.
Repository: shinrax2/PS3GameUpdateDownloader
Branch: master
Commit: 34adbbf5218c
Files: 30
Total size: 1.5 MB

Directory structure:
gitextract_ua6xxo6r/

├── .gitattributes
├── .github/
│   └── dependabot.yml
├── .gitignore
├── CHANGELOG
├── LICENSE
├── PS3GUD.py
├── README.md
├── build.py
├── buildrequirements.txt
├── gui.py
├── images/
│   └── icon.xcf
├── loc/
│   ├── de.json
│   ├── en.json
│   ├── es_ES.json
│   ├── it.json
│   ├── ru.json
│   ├── th.json
│   ├── tr.json
│   └── zh_CN.json
├── main_ps3gud.py
├── missingstrings.py
├── ps3gud_jdownloader_renamepkgs.packagizer
├── release.debug.json
├── release.json
├── requirements.txt
├── sony.pem
├── titledb.debug.json
├── titledb.json
├── updater.py
└── utils.py

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitattributes
================================================
* text=auto

*.sh text eol=lf

================================================
FILE: .github/dependabot.yml
================================================
version: 2
updates:
 - package-ecosystem: "pip"
   directory: "/"
   schedule:
    interval: "monthly"
   allow:
    - dependency-type: "direct"

================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

#project specific stuff
downloadedPKGs/
logs/
config.json
build_config.json
TODO.txt
titledb.json.bak
missingstrings.txt
test.py
docker_output/


================================================
FILE: CHANGELOG
================================================
! important change
+ new feature or minor change
- bugfix

future release (aka current master branch):

v013:
+  added simplified chinese translation thanks to https://github.com/nini22P & https://github.com/FR0Z3
+  make updater actually wait for main application to exit instead of using a timeout
+  add dockerfile for linux-amd64, linux-win32, linux-win64
+  Improved download speeds (thanks to https://github.com/rursache)
+  Improved robustness of TitleID parsing (thanks to https://github.com/rursache)
+  Added option to bypass ssl checks to help with connection issues (thanks to https://github.com/rursache)
+  Added option to import TitleIDs from RPCS3's games.yml
-  Added code to handle TitleIDs like BLES00710 which return server errors


v012:
+  added european spanish translation thanks to https://github.com/IlDucci
+  improved sha1 verification of downloaded PKGs
-  remove github formatting characters from changelog
+  various build improvements including:
      +validate & minify json files for slightly smaller releases
      -disabled UPX for non windows platforms since that sometimes leads to corrupted binaries
      +name release archives for python version they were built on e.g. "PS3GameUpdateDownloader-v011-CPython3.11.1final-win64.zip"
      +(Linux Only)name release archives for the c libary & version they were built on e.g. "PS3GameUpdateDownloader-v011-CPython3.11.1final-glibc2.31-linux64.zip"
+  save git commit id at buildtime and show it in the main window
!  proper handling of sonys weak certificate
+  faster search for new titledb versions
!  add GPL3 license to this project
-  fix update searching for games with no ps3_system_ver set like BCUS98132

v011:
-  fix crash when proxy is enabled but no proper proxy settings are set
-  fix typo in download speed display
+  moved proxy user to keyring
-  fixed proxy support not being installed from requirements.txt
-  added two japanese psn titleid to titledb
+  added updater for titledb
+  added download verification to auto updater
-  prevent crashes with corrupted config files
+  changed storage treshold from percentage to absolute

v010:
-  fix a crash when checking updates
+  add info about the ps3 store shutdown

v009:
+  update turkish translation
+  use UPX for builds to produce smaller binaries and hopefully slightly less antivirus false positives
+  added an icon to the executable and the windows
-  fix cut off header in build.log
-  removed hotfix for issues between keyring and PyInstaller
-  fix crash when downloading updates
-  fix finding updates on modern linux

v008:
!  refactored gui code
!  more secure handling of sonys self signed certificate
+  open configuration window when no configuration file is found
+  generate "build.log" when building releases
+  include pysimplegui version in logs for easier debugging
+  include python version in logs for easier debugging
+  proxy support (only SOCKS5)
+  improve configuration window layout
+  add CHANGELOG to builds
+  add thai translation thanks to https://github.com/CENSOR1337
+  add russian translation thanks to https://github.com/andoleal
+  add turkish translation thanks to https://steamcommunity.com/profiles/76561198045705212/
+  add italian translation thanks to https://github.com/Strappazzon
-  fix changelog being cutoff in update notification window
-  fix updater on linux
-  fix handling unicode languages
-  minor typos in english translation
-  fix cutoff strings
-  fix crash when available disc space is below threshold
-  hotfix for issues between keyring and PyInstaller
-  inform user when no viable keyring backend could be found

v007:
-  fixed main window becoming malfunctional when pressing download in the queue window with an empty queue
-  retranslate main window when changing language
+  load english string as fallback when the current localization doesnt contain the wanted string
+  added sorting and removal of entrys to the queue management
+  improved select window
+  every run now has its own logfile
-  prevent the same update being added to queue multiple times
-  fix crashes in queue management
+  check if download directory is writeable
+  added percentage and download speed to main window when downloading
+  log crashes for easier debugging
-  fix crash when downloading on python 3.8
+  use enter key to search for updates in main window

v006:
+! automatic download and installation of updates
+  progress bar for downloads
+  added simple download queue
-  improved responsiveness of the window while downloading
-  fix downloading of game updates for certain games with " or ' in their names

v005:
+  add notification for new releases
+  add translation support (english & german sofar)

v004:
-  improved file size formatting
+  added check for free space before download
-  improved naming of outputted directories
-  fixed a crash when selecting no update in the download window
+  added configuration via gui

v003:
+  added logging
+! added GUI via pysimplegui

v002:
-  fixed sha1 verification of downloads
+  sort downloads into folders by gameid
+  added check if file was already downloaded

v001:
   initial release

================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.


================================================
FILE: PS3GUD.py
================================================
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# PS3GameUpdateDownloader downloads PS3 game updates from official Sony servers
# Copyright (C) 2023 shinrax2
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

# built-in
import urllib.parse
import ssl
import xml.etree.ElementTree as ET
import os
import hashlib
import sys
import shutil
import json
import time
import platform
from urllib3.exceptions import InsecureRequestWarning

# local files
import utils

# pip packages
import requests
import requests.adapters
import keyring

requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)


class PS3GUD:
    def __init__(self, window=None):
        if window != None:
            self.logger = utils.Logger(window)
        else:
            self.logger = utils.Logger()
        self.configFile = "./config.json"
        self.titledbFile = "./titledb.json"
        self.config = {}
        self.Updates = {}
        self.DlList = Queue(self)
        self.titleid = ""
        self.proxies = {}

        self.useDefaultConfig = True
        self.configDefaults = {}
        self.configDefaults["dldir"] = "./downloadedPKGs"
        self.configDefaults["verify"] = True
        self.configDefaults["checkIfAlreadyDownloaded"] = True
        self.configDefaults["storageThresholdNew"] = 5
        self.configDefaults["currentLoc"] = "en"
        self.configDefaults["checkForNewRelease"] = True
        self.configDefaults["bypass_ssl"] = True
        self.configDefaults["add_all_updates_to_queue_automatically"] = False
        self.configDefaults["use_proxy"] = False
        self.configDefaults["proxy_ip"] = ""
        self.configDefaults["proxy_port"] = ""
        self.configDefaults["proxy_user"] = None
        self.configDefaults["proxy_pass"] = None
        self.configDefaults["dont_show_again_keyring_support"] = False
        self.configDefaults["rename_pkgs"] = True
        self.configDefaults["update_titledb"] = True

    def setupRequests(self):
        self.https_session = requests.Session()
        self.https_session.mount(
            "https://a0.ww.np.dl.playstation.net",
            SonySSLContextAdapter(bypassSSL=self.getConfig("bypass_ssl")),
        )
        self.pemfile = "./sony.pem"

    def setWindow(self, window):
        self.logger.window = window

    def setLoc(self, loc):
        self.loc = loc

    def logHeader(self, version, psgversion, commit):
        self.logger.log(f"PS3GameUpdateDownloader {version}")
        self.logger.log(f"Git Commit: {commit}")
        self.logger.log(f"Config File: {self.configFile}")
        self.logger.log(f"Language: {self.loc.getLoc()}")
        self.logger.log(f"Current working directory: {os.getcwd()}")
        self.logger.log(f"Compiled: {str(utils.isAppFrozen())}")
        self.logger.log(f"FreeSimpleGUI version: {psgversion}")
        self.logger.log(
            f"Python version: {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}{sys.version_info.releaselevel} ({platform.python_implementation()})\n"
        )

    def loadConfig(self):
        if os.path.exists(self.configFile) and os.path.isfile(self.configFile):
            self.logger.log(self.loc.getKey("msg_configFileLoaded"))
            with open(self.configFile, "r", encoding="utf8") as f:
                data = f.read()
            try:
                self.config = json.loads(data)
            except json.decoder.JSONDecodeError:
                self.logger.log(self.loc.getKey("msg_ConfigFileCorrupt"), "e")
                os.remove("./config.json")
                self.config = self.configDefaults
                return
            self.useDefaultConfig = False
            if self.getConfig("use_proxy") == True:
                self.config["proxy_pass"], self.config["proxy_user"] = (
                    self.getProxyCredentials()
                )
            else:
                self.config["proxy_pass"], self.config["proxy_user"] = (None, None)
            self.setupProxy()
        else:
            self.logger.log(self.loc.getKey("msg_noConfigFile"))
            self.config = self.configDefaults

        self.setupRequests()

    def setConfig(self, config):
        self.config = config
        self.saveConfig()

    def saveConfig(self):
        with open(self.configFile, "w", encoding="utf8") as f:
            f.write(
                json.dumps(self.config, sort_keys=True, indent=4, ensure_ascii=False)
            )
        self.logger.log(self.loc.getKey("msg_configFileSaved"))
        self.useDefaultConfig = False
        self.setupRequests()

    def setProxyCredentials(self, pwd, user):
        keyring.set_password("ps3gud", "proxy_pass", pwd)
        self.config["proxy_pass"] = pwd
        keyring.set_password("ps3gud", "proxy_user", user)
        self.config["proxy_user"] = user

    def getProxyCredentials(self):
        return (
            keyring.get_password("ps3gud", "proxy_pass"),
            keyring.get_password("ps3gud", "proxy_user"),
        )

    def setupProxy(self):
        if (
            self.getConfig("use_proxy")
            and self.getConfig("proxy_ip") != ""
            and self.getConfig("proxy_port") != ""
        ):
            self.proxies["http"] = "socks5://"
            self.proxies["https"] = "socks5://"
            if self.getConfig("proxy_user") != None:
                self.proxies["http"] += self.getConfig("proxy_user") + ":"
                self.proxies["https"] += self.getConfig("proxy_user") + ":"
                if self.getConfig("proxy_pass") != None:
                    self.proxies["http"] += self.getConfig("proxy_pass") + "@"
                    self.proxies["https"] += self.getConfig("proxy_pass") + "@"
            self.proxies["http"] += (
                self.getConfig("proxy_ip") + ":" + self.getConfig("proxy_port")
            )
            self.proxies["https"] += (
                self.getConfig("proxy_ip") + ":" + self.getConfig("proxy_port")
            )
        else:
            self.proxies = {}

    def getConfig(self, key):
        try:
            return self.config[key]
        except KeyError:
            return self.configDefaults[key]

    def checkTitleDbVersion(self):
        if self.getConfig("update_titledb") == True:
            file = "https://raw.githubusercontent.com/shinrax2/PS3GameUpdateDownloader/master/titledb.json"
            meta = "https://raw.githubusercontent.com/shinrax2/PS3GameUpdateDownloader/master/release.json"
            try:
                data = json.loads(requests.get(meta, proxies=self.proxies).content)
            except requests.exceptions.ConnectionError:
                if self.getConfig("use_proxy"):
                    self.logger.log(self.loc.getKey("msg_checkProxySettings"))
                return

            if self.titledbver < data["tdb_version"]:
                self.logger.log(self.loc.getKey("msg_newTitleDbVersion"))
                if os.path.exists(self.titledbFile + ".bak"):
                    os.remove(self.titledbFile + ".bak")
                os.rename(self.titledbFile, self.titledbFile + ".bak")
                try:
                    newtdb = json.loads(
                        requests.get(file, proxies=self.proxies).content
                    )
                except requests.exceptions.ConnectionError:
                    if self.getConfig("use_proxy"):
                        self.logger.log(self.loc.getKey("msg_checkProxySettings"))
                    return
                with open(self.titledbFile, "w", encoding="utf8") as f:
                    f.write(json.dumps(newtdb, ensure_ascii=False))
                    f.flush()
                self.loadTitleDb()

    def loadTitleDb(self):
        with open(self.titledbFile, "r", encoding="utf8") as f:
            data = json.loads(f.read())
        self.titledb = data["db"]
        self.titledbver = data["version"]
        self.logger.log(self.loc.getKey("msg_loadedTitledb", [self.titledbFile]))

    def getTitleNameFromId(self, titleid=None):
        if titleid == None:
            titleid = self.titleid
        for item in self.titledb:
            if titleid == item["id"]:
                return item["name"]

    def getUpdates(self):
        return self.Updates[self.titleid]

    def checkForUpdates(self, titleid):
        # check given id
        check = False
        titleid = titleid.upper().replace("-", "")
        for item in self.titledb:
            if titleid == item["id"]:
                check = True
                self.titleid = titleid
                self.logger.log(
                    self.loc.getKey("msg_titleIDIs", [item["name"], item["id"]])
                )
                break
        if check == False:
            self.logger.log(self.loc.getKey("msg_titleIDNotValid"), "e")
            self.titleid = ""
            return

        # check for updates
        updates = []
        url = urllib.parse.urljoin(
            urllib.parse.urljoin(
                "https://a0.ww.np.dl.playstation.net/tpl/np/", self.titleid + "/"
            ),
            self.titleid + "-ver.xml",
        )
        try:
            if self.getConfig("bypass_ssl"):
                verify_value = False
            else:
                verify_value = self.pemfile

            resp = self.https_session.get(
                url, verify=verify_value, proxies=self.proxies
            )
        except requests.exceptions.ConnectionError as error:
            self.logger.log(f"{self.loc.getKey('msg_metaNotAvailable')} ({url})", "e")
            self.logger.log(f"{error}", "e")
            if self.getConfig("use_proxy"):
                self.logger.log(self.loc.getKey("msg_checkProxySettings"))
            self.titleid = ""
            return

        info = resp.content
        # check file length for titles like BCAS20074
        if len(info) == 0:
            self.logger.log(self.loc.getKey("msg_metaFileEmpty"), "e")
            self.titleid = ""
            return
        try:
            root = ET.fromstring(info)
        except ET.ParseError:
            self.logger.log(
                self.loc.getKey("msg_metaFileBrokenSyntax", [self.titleid]), "e"
            )
            self.titleid = ""
            return
        try:
            tid = root.attrib["titleid"]
        except KeyError:
            tid = ""
        if tid == self.titleid:
            for tag in root:
                for package in tag:
                    pack = {}
                    attr = package.attrib
                    pack["gameid"] = self.titleid
                    pack["version"] = attr["version"]
                    pack["size"] = attr["size"]
                    pack["sha1"] = attr["sha1sum"]
                    pack["url"] = attr["url"]
                    try:
                        pack["sysver"] = attr["ps3_system_ver"]
                    except KeyError:
                        # some games like BCUS98132 dont have ps3_system_ver set for their packages, using 1.1000 as replacement
                        pack["sysver"] = "1.1000"
                    updates.append(pack)
        self.Updates[titleid] = updates

    def downloadFiles(self, window):
        self.logger.log(self.loc.getKey("msg_startingDownloads"))
        i = 1
        ql = len(self.DlList.queue)
        for dl in self.DlList.queue:
            skip = False
            url = dl["url"]
            sha1 = dl["sha1"]
            size = dl["size"]
            id = dl["gameid"]
            fdir = os.path.join(
                self.getConfig("dldir") + "/",
                utils.filterIllegalCharsFilename(self.getTitleNameFromId(id))
                + "_["
                + id
                + "]/",
            )
            if self.getConfig("rename_pkgs") == True:
                fname = os.path.join(
                    fdir,
                    utils.filterIllegalCharsFilename(
                        self.getTitleNameFromId(id)
                        + "_["
                        + id
                        + "]_"
                        + dl["version"]
                        + ".pkg"
                    ),
                )
            else:
                fname = os.path.join(
                    fdir, utils.filterIllegalCharsFilename(os.path.basename(url))
                )

            if (
                os.path.exists(self.getConfig("dldir")) == False
                and os.path.isfile(self.getConfig("dldir")) == False
            ):
                try:
                    os.mkdir(self.getConfig("dldir"))
                except (PermissionError, FileNotFoundError):
                    self.logger.log(
                        self.loc.getKey(
                            "msg_dldirNotWriteable", [self.getConfig("dldir")]
                        )
                    )
                    skip = True
            if os.path.exists(fdir) == False and os.path.isfile(fdir) == False:
                try:
                    os.mkdir(fdir)
                except (PermissionError, FileNotFoundError):
                    self.logger.log(
                        self.loc.getKey(
                            "msg_dldirNotWriteable", [self.getConfig("dldir")]
                        )
                    )
                    skip = True
            total, used, free = shutil.disk_usage(fdir)

            if self.getConfig("checkIfAlreadyDownloaded") == True:
                # check if file already exists
                if os.path.exists(fname) and os.path.isfile(fname):
                    if int(os.path.getsize(fname)) == int(size):
                        if self.getConfig("verify") == False:
                            self.logger.log(
                                self.loc.getKey(
                                    "msg_alreadyDownloadedNoVerify",
                                    [os.path.basename(url)],
                                )
                            )
                            skip = True
                        else:
                            if sha1 == self._sha1File(fname):
                                self.logger.log(
                                    self.loc.getKey(
                                        "msg_alreadyDownloadedVerify",
                                        [os.path.basename(url)],
                                    )
                                )
                                skip = True
            if skip == False:
                if (
                    free
                    >= int(self.getConfig("storageThresholdNew")) * 1024 * 1024 * 1024
                ):
                    if free > int(size):
                        self.logger.log(
                            self.loc.getKey("msg_startSingleDownload", [i, ql])
                        )
                        self._download_file(url, fname, size, window, i)
                        self.DlList.removeEntry(dl["gameid"] + "-" + dl["version"])
                    else:
                        self.logger.log(self.loc.getKey("msg_notEnoughDiskSpace"), "e")
                        skip = True
                else:
                    self.logger.log(
                        self.loc.getKey(
                            "msg_spaceBelowThreshold",
                            [str(self.getConfig("storageThresholdNew")) + "GiB"],
                        ),
                        "e",
                    )
                    skip = True
            if self.getConfig("verify") == True and skip == False:
                if sha1 == self._sha1File(fname):
                    self.logger.log(self.loc.getKey("msg_verifySuccess", [fname]))
                else:
                    self.logger.log(self.loc.getKey("msg_verifyFailure", [fname]))
                    os.remove(fname)
            if self.getConfig("verify") == False and skip == False:
                self.logger.log(self.loc.getKey("msg_noVerify", [fname]))
            if skip == True:
                self.DlList.removeEntry(dl["gameid"] + "-" + dl["version"])
            i += 1

        self.logger.log(self.loc.getKey("msg_finishedDownload", [ql]))

    def _download_file(self, url, local_filename, size, window, num):
        text = window["window_main_progress_label"]
        bar = window["window_main_progress_bar"]
        size = int(size)
        chunk_size = 98304
        count = 0
        already_loaded = 0
        with requests.get(url, stream=True, proxies=self.proxies) as r:
            r.raise_for_status()
            start = time.perf_counter()
            with open(local_filename, "wb") as f:
                for chunk in r.iter_content(chunk_size=chunk_size):
                    if chunk:
                        f.write(chunk)
                        count += 1
                        already_loaded = count * chunk_size
                        if already_loaded / size > 1:
                            already_loaded = size
                        percentage = already_loaded / size * 100
                        text.Update(
                            self.loc.getKey(
                                "window_main_progress_label",
                                [
                                    num,
                                    utils.formatSize(already_loaded),
                                    utils.formatSize(size),
                                    format(float(percentage), ".1f"),
                                    utils.formatSize(
                                        already_loaded // (time.perf_counter() - start)
                                    )
                                    + "/s",
                                ],
                            )
                        )
                        bar.UpdateBar(percentage)
                        window.Refresh()

    def _sha1File(self, fname):
        # get hash from EOF
        with open(fname, "rb") as f:
            fhash = f.read()[-32:].hex()[:40]
        # copy file
        f2 = fname + "~"
        shutil.copy(fname, f2)
        # remove last 32 bytes because the PKG hash is at EOF and not part of the PKG data
        with open(f2, "ab") as f:
            f.seek(-32, os.SEEK_END)
            f.truncate()
        # calculate hash from file - last 32 bytes
        fsha = hashlib.sha1()
        with open(f2, "rb") as f:
            for line in iter(lambda: f.read(fsha.block_size), b""):
                fsha.update(line)
        os.remove(f2)
        # check calculated hash against EOF hash
        if fhash == fsha.hexdigest():
            # return correct hash
            return fsha.hexdigest()
        else:
            # return fake hash
            return "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF"

    def __del__(self):
        del self.logger


class Queue:
    def __init__(self, ps3):
        self.queue = []
        self.ps3 = ps3

    def addEntry(self, entry):
        if self.isAlreadInQueue(entry["gameid"] + "-" + entry["version"]) != True:
            self.queue.append(
                {
                    "num": (len(self.queue) + 1),
                    "code": entry["gameid"] + "-" + entry["version"],
                    "gameid": entry["gameid"],
                    "version": entry["version"],
                    "size": entry["size"],
                    "url": entry["url"],
                    "sha1": entry["sha1"],
                }
            )

    def removeEntry(self, code):
        newQueue = []
        for item in self.queue:
            if item["code"] != code:
                newQueue.append(item)
        self.queue = newQueue
        self._sortQueue()

    def _sortQueue(self):
        newQueue = []
        sort = {}
        for item in self.queue:
            sort[item["num"]] = item
        sort = dict(sorted(sort.items()))
        for key, value in sort.items():
            pack = value
            pack["num"] = key
            newQueue.append(pack)
        self.queue = newQueue

    def moveUp(self, code):
        before = False
        for item in self.queue:
            if item["code"] == code:
                currentNum = item["num"]
                before = True
            if before == False:
                newNum = item["num"]
                newCode = item["code"]
        if currentNum != 1:
            sort = {}
            for item in self.queue:
                sort[item["code"]] = item
            sort[code]["num"] = newNum
            sort[newCode]["num"] = currentNum
            newQueue = []
            for key, value in sort.items():
                newQueue.append(value)
            self.queue = newQueue
            self._sortQueue()

    def moveDown(self, code):
        after = False
        for item in self.queue:
            if after == True:
                newNum = item["num"]
                newCode = item["code"]
                after = False
            if item["code"] == code:
                currentNum = item["num"]
                after = True
        if currentNum != len(self.queue):
            sort = {}
            for item in self.queue:
                sort[item["code"]] = item
            sort[code]["num"] = newNum
            sort[newCode]["num"] = currentNum
            newQueue = []
            for key, value in sort.items():
                newQueue.append(value)
            self.queue = newQueue
            self._sortQueue()

    def getTotalDownloadSize(self):
        size = 0
        for item in self.queue:
            size += int(item["size"])
        return int(size)

    def isAlreadInQueue(self, code):
        ret = False
        for item in self.queue:
            if code == item["code"]:
                ret = True
        return ret

    def exportQueue(self, exportFile):
        s = ""
        games = {}
        for entry in self.queue:
            try:
                games[entry["gameid"]]
            except KeyError:
                games[entry["gameid"]] = []
            games[entry["gameid"]].append((entry["url"], entry["version"]))
        for id, data in games.items():
            s += f"{self.ps3.getTitleNameFromId(id)} [{id}]:\n\n"
            for url, version in data:
                filename = urllib.parse.quote(
                    utils.filterIllegalCharsFilename(
                        self.ps3.getTitleNameFromId(id)
                        + "_["
                        + id
                        + "]_"
                        + version
                        + ".pkg"
                    )
                )
                folder = urllib.parse.quote(
                    utils.filterIllegalCharsFilename(
                        self.ps3.getTitleNameFromId(id) + "_[" + id + "]"
                    )
                )
                s += f"\t{url+'#folder='+folder+'#name='+filename}\n"
            s += "\n"
        with open(exportFile, "w", encoding="utf8") as f:
            f.write(s)


class SonySSLContextAdapter(requests.adapters.HTTPAdapter):
    def __init__(self, bypassSSL=False, **kwargs):
        self.bypassSSL = bypassSSL
        super(SonySSLContextAdapter, self).__init__(**kwargs)

    def init_poolmanager(self, *args, **kwargs):
        context = ssl.create_default_context()
        if self.bypassSSL:
            context.check_hostname = False
            context.verify_mode = ssl.CERT_NONE
        else:
            context.set_ciphers("DEFAULT:@SECLEVEL=1")
        kwargs["ssl_context"] = context
        return super(SonySSLContextAdapter, self).init_poolmanager(*args, **kwargs)


================================================
FILE: README.md
================================================
# PS3GameUpdateDownloader
This program downloads updates for PS3 games from the official PS3 servers.

Features:
- Windows & Linux support
- A clean and simple GUI
- Queue support
- SHA-1 verification of downloads
- Localized GUI
- Automatic updates

Grab the latest release [here](https://github.com/shinrax2/PS3GameUpdateDownloader/releases/latest) and check the ["Getting Started"](https://github.com/shinrax2/PS3GameUpdateDownloader/wiki/Getting-Started) page on the wiki!

# Attention
Sony has announced that they will be closing the PS3 store on 02.07.21 and later reversed that decision. It seems that some game updates got deleted in the time between the announcement and its reversal. I recommend you backup your downloaded game updates.

# JDownloader PKG Renaming
If you want to use the queue export feature and download the updates with [JDownloader](https://jdownloader.org/download/index) import `ps3gud_jdownloader_renamepkgs.packagizer` into your packagizer settings and make sure to set the following rule order:

![Main window](https://github.com/shinrax2/PS3GameUpdateDownloader/raw/master/screenshots/jdownloader_order.png)

# Contributions
Contributions in form of translations and bug fixes are welcome.

# Disclaimer:
This program isnt supported by or affiliated with Sony.

# Screenshots:
![Main window](https://github.com/shinrax2/PS3GameUpdateDownloader/raw/master/screenshots/main.PNG)
![Config window](https://github.com/shinrax2/PS3GameUpdateDownloader/raw/master/screenshots/config.PNG)
![Queue window](https://github.com/shinrax2/PS3GameUpdateDownloader/raw/master/screenshots/queue.PNG)
![Update select window](https://github.com/shinrax2/PS3GameUpdateDownloader/raw/master/screenshots/select.PNG)


================================================
FILE: build.py
================================================
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
#PS3GameUpdateDownloader downloads PS3 game updates from official Sony servers
#Copyright (C) 2023 shinrax2
#
#This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
#
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

#built-in
import argparse
import sys
import shutil
import os
import platform
import json
import logging
import subprocess
import datetime
import shlex
import stat

#local files
import utils

def buildheader(release, filepath , pyiver="None", winever=None):
    lines = [   "Building PS3GameUpdateDownloader",
                "Build script arguments: "+str(sys.argv[1:]),
                "Version: "+release["version"],
                "Git Commit: "+str(release["commitid"]),
                "Date/Time: "+str(NOW)
            ]
    if pyiver != "None":
        lines.append(f"Python version: Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}{sys.version_info.releaselevel} ({platform.python_implementation()})")
        lines.append(f"Platform: {platform.system()} {platform.architecture()[0]}")
        if platform.system() == "Windows" and winever is not None:
            lines.append(f"Built on Wine Version: {winever}")
        elif platform.system() == "Linux":
            lines.append(f"LibC: {platform.libc_ver()[0]} {platform.libc_ver()[1]}")
        lines.append(f"PyInstaller version: {pyiver}")
        lines.append("PyInstaller Output:")
    with Prepender(filepath) as filehandle:
        filehandle.write_lines(lines)

def createDigest(file):
    with open(file+".sha256", "w") as f:
        digest = utils.sha256File(file)
        f.write(digest)
        return digest

def validateJSON(filename):
    try:
        with open(filename, "r", encoding="utf8") as f:
            data = json.loads(f.read())
    except ValueError as err:
        print("\n\nJSON syntax error in \""+os.path.basename(filename)+"\"")
        print(err)
        input("Press enter to exit.")
        sys.exit(0)
    return data

def minifyJSON(jsonfiles):
    for file in jsonfiles:
        if file.endswith(".json") == True:
            data = validateJSON(file)
            with open(file, "w", encoding="utf8") as f:
                if os.path.basename(os.path.dirname(file)) == locdirname:
                    #if json file is a loc file remove comments
                    new_data = {}
                    for k, v in data.items():
                        new_data[k] = {"string": v["string"]}
                        data = new_data
                f.write(json.dumps(data, sort_keys=True, ensure_ascii=False))

def getJSONFiles():
    #list json files
    #loc files
    jsonfiles =  []
    for root, dirs, files in os.walk(locdirbuildpath):
        for file in files:
            if os.path.isfile(os.path.join(root, file)) and os.path.join(root, file).lower().endswith(".json"):
                jsonfiles.append(os.path.join(root, file))
    #other files
    jsonfiles.append(os.path.join(builddir, "release.json"))
    jsonfiles.append(os.path.join(builddir, "titledb.json"))
    return jsonfiles

def copyData(builddir, locdirname, imagedirname, debug=False, source=False):
    if debug == True: #debug specific files
        shutil.copy2("titledb.debug.json", os.path.join(builddir, "titledb.json"))
        shutil.copy2("release.debug.json", os.path.join(builddir, "release.json"))
    else: #release specific files
        shutil.copy2("LICENSE", os.path.join(builddir, "LICENSE"))
        shutil.copy2("CHANGELOG", os.path.join(builddir, "CHANGELOG"))
        shutil.copy2("release.json", os.path.join(builddir, "release.json"))
        shutil.copy2("titledb.json", os.path.join(builddir, "titledb.json"))
        copySource(builddir)
    if source == True: # source specific files
        shutil.copy2("requirements.txt", os.path.join(builddir, "requirements.txt"))
    # general files
    shutil.copy2("sony.pem", os.path.join(builddir, "sony.pem"))
    shutil.copytree(locdirname, os.path.join(builddir, locdirname))
    shutil.copytree(imagedirname, os.path.join(builddir, imagedirname), ignore=shutil.ignore_patterns("*.xcf"))

def copySource(builddir):
    sourcedir = os.path.join(builddir, "src")
    files = ["build.py", "buildrequirements.txt", "CHANGELOG", "gui.py", "LICENSE", "main_ps3gud.py", "missingstrings.py", "PS3GUD.py", "README.md", "release.debug.json", "release.debug.json", "release.json", "requirements.txt", "sony.pem", "titledb.json", "titledb.debug.json", "updater.py", "utils.py", ".gitignore", ".gitattributes"]
    dirs = {
        "images": {
            "ignore": []
        },
        "loc": {
            "ignore": []
        },
        ".git": {
            "ignore": []
        },
        ".github": {
            "ignore": []
        },
    }
    #copy files
    os.mkdir(sourcedir)
    for file in files:
        shutil.copy2(file, os.path.join(sourcedir, file))
    for dir, options in dirs.items():
        shutil.copytree(dir, os.path.join(sourcedir, dir), ignore=shutil.ignore_patterns(*options["ignore"]))

def saveCommitId(release, builddir):
    if release["commitid"] is not None:
        with open(os.path.join(builddir, "release.json"), "r", encoding="utf8") as f:
            data = json.loads(f.read())
            data["commitid"] = release["commitid"]
        with open(os.path.join(builddir, "release.json"), "w", encoding="utf8") as f:
            f.write(json.dumps(data, sort_keys=True, ensure_ascii=False, indent=4))

def remove_readonly(func, path, _):
    os.chmod(path, stat.S_IWRITE)
    func(path)

# START from https://stackoverflow.com/questions/2677617/write-at-beginning-of-file/20805898#20805898 START
class Prepender(object):
    def __init__(self,
                 file_path,
                ):
        # Read in the existing file, so we can write it back later
        with open(file_path, mode='r') as f:
            self.__write_queue = f.readlines()

        self.__open_file = open(file_path, mode='w')

    def write_line(self, line): # line order is reversed
        self.__write_queue.insert(0,
                                  "%s\n" % line,
                                 )

    def write_lines(self, lines): # line order is maintained
        lines.reverse()
        for line in lines:
            self.write_line(line)

    def close(self):
        self.__exit__(None, None, None)

    def __enter__(self):
        return self

    def __exit__(self, type, value, traceback):
        if self.__write_queue:
            self.__open_file.writelines(self.__write_queue)
        self.__open_file.close()
# END from https://stackoverflow.com/questions/2677617/write-at-beginning-of-file/20805898#20805898 END

#argparse
parser = argparse.ArgumentParser(description="build script for PS3GameUpdateDownloader")
parser.add_argument("-s", "--source", action="store_true", help="building a source version, mutually exclusive with '--compiled'")
parser.add_argument("-c", "--compiled", action="store_true", help="building a compiled version, mutually exclusive with '--source'")
parser.add_argument("-r", "--release", action="store_true", help="building a release version, mutually exclusive with '--debug'")
parser.add_argument("-d", "--debug",action="store_true", help="building a debug version, mutually exclusive with '--release'")
parser.add_argument("-z", "--zip", action="store_true", help="pack the build to a .zip file")
parser.add_argument("--docker", action="store_true", help='copy build zip to "./docker_output", requires --zip')
parser.add_argument("--githash", action="store", help="gives git commit hash to build script(mostly useful for docker builds)")
parser.add_argument("--winever", action="store", help="gives wine version to build script(mostly useful for docker builds)")

args = parser.parse_args()
#constants
builddir = "./dist/PS3GameUpdateDownloader"
buildlog = os.path.join(builddir, "build.log")
locdirname = "loc"
locdirbuildpath = os.path.join(builddir, locdirname)
imagedirname = "images"
iconpath = os.path.abspath(os.path.join(imagedirname, "icon.ico"))
NOW = datetime.datetime.now()
ARCHIVEFORMAT = "zip"
dockerdir = os.path.abspath("./docker_output")
mainpyifile = "main_ps3gud.py"
updaterpyifile = "updater.py"
winever = None
#get data from release.json
with open("release.json", "r", encoding="utf8") as f:
    release = json.loads(f.read())
release["commitid"] = None

#check parameters
action = ""
zip_check = False
docker = False
if args.compiled == True and args.source == True:
    print("You cant pass \"-c\" and \"-s\" to the buildscript.")
    sys.exit()
if args.debug == True and args.release == True:
    print("You cant pass \"-d\" and \"-r\" to the buildscript.")
    sys.exit()
if args.source == True and args.release == True:
    action = "sourcerelease"
if args.source == True and args.debug == True:
    action = "sourcedebug"
if args.compiled == True and args.release == True:
    action = "compilerelease"
if args.compiled == True and args.debug == True:
    action = "compiledebug"

if args.zip == True:
    zip_check = True
    zipname = "dist/PS3GameUpdateDownloader-"+release["version"]
    if args.docker == True:
        docker = True
        if os.path.exists(dockerdir) == False:
            os.makedirs(dockerdir)

if args.winever is not None:
    winever = args.winever
#auto config for build

suffix = ""
libc = ""
py = ""
if platform.system() == "Windows":
    suffix = ".exe"
    ostype = "win"
if platform.system() == "Linux":
    ostype = "linux"
    libc = f"{platform.libc_ver()[0]}{platform.libc_ver()[1]}-"
if platform.architecture()[0] == "32bit":
    bits = "32"
if platform.architecture()[0] == "64bit":
    bits = "64"
if args.compiled == True and args.zip == True:
    py = f"{platform.python_implementation()}{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}{sys.version_info.releaselevel}-"
arch = py + libc + ostype + bits

#get git commit id if git is found on path
if args.githash is not None:
    release["commitid"] = args.githash
elif (shutil.which("git") is not None) == True:
    call = shutil.which("git") + " rev-parse --short HEAD"
    call = call if platform.system() == "Windows" else shlex.split(call)
    release["commitid"] = subprocess.Popen(call, stdout=subprocess.PIPE).communicate()[0].decode("ascii").replace("\n", "")

print("build script for PS3GameUpdateDownloader")
if action == "":
    print("use '-h' for help")
else:
    print(f"build options:\nmode: {action}\narch: {arch}\ngit commit: {release['commitid']}\nzip: {zip_check}\ndocker: {docker}")

if action == "sourcerelease":
    #release running from source
    if os.path.exists(builddir):
        #delete old build
        shutil.rmtree(builddir, onexc=remove_readonly)
        os.makedirs(builddir)
    else:
        os.makedirs(builddir)
    with open(buildlog, "w") as f:
        #write header to buildlog
        buildheader(release, buildlog)
        #copy scripts
        print(f"copying scripts to '{builddir}'")
        shutil.copy2("main_ps3gud.py", os.path.join(builddir, "main_ps3gud.py"))
        shutil.copy2("utils.py", os.path.join(builddir, "utils.py"))
        shutil.copy2("updater.py", os.path.join(builddir, "updater.py"))
        shutil.copy2("PS3GUD.py", os.path.join(builddir, "PS3GUD.py"))
        shutil.copy2("gui.py", os.path.join(builddir, "gui.py"))
        #copy data
        print(f"copying data to '{builddir}'")
        copyData(builddir, locdirname, imagedirname, source=True)
        #save commitid
        saveCommitId(release, builddir)
        #validate & minify json files
        print("minifying & validating JSON files")
        minifyJSON(getJSONFiles())
        #build zip
        if zip_check == True:
            zipname += "-source"
            print(f"creating archive '{zipname}.{ARCHIVEFORMAT}'")
            shutil.make_archive(zipname, ARCHIVEFORMAT, "dist", os.path.relpath(builddir, "dist"))
            print(f"calculating checksum for archive '{zipname}.{ARCHIVEFORMAT}'")
            digest = createDigest(zipname+"."+ARCHIVEFORMAT)
            print(f"checksum written to '{zipname}.{ARCHIVEFORMAT}.sha256'\nchecksum: '{digest}'")
            if docker == True:
                print(f'copied build zip to "{dockerdir}"')
                shutil.copy2(zipname+"."+ARCHIVEFORMAT, os.path.join(dockerdir, os.path.basename(zipname)+"."+ARCHIVEFORMAT))
                shutil.copy2(zipname+"."+ARCHIVEFORMAT+".sha256", os.path.join(dockerdir, os.path.basename(zipname)+"."+ARCHIVEFORMAT+".sha256"))
   
if action == "sourcedebug":
    #debug running from source
    builddir += "Debug"
    buildlog = os.path.join(builddir, "build.log")
    if os.path.exists(builddir):
        #delete old build
        shutil.rmtree(builddir, onexc=remove_readonly)
        os.makedirs(builddir)
    else:
        os.makedirs(builddir)
    with open(buildlog, "w") as f:
        #write header to buildlog
        buildheader(release, buildlog)
        #copy scripts
        print(f"copying scripts to '{builddir}'")
        shutil.copy2("main_ps3gud.py", os.path.join(builddir, "main_ps3gud.py"))
        shutil.copy2("utils.py", os.path.join(builddir, "utils.py"))
        shutil.copy2("updater.py", os.path.join(builddir, "updater.py"))
        shutil.copy2("PS3GUD.py", os.path.join(builddir, "PS3GUD.py"))
        shutil.copy2("gui.py", os.path.join(builddir, "gui.py"))
        #copy data
        print(f"copying data to '{builddir}'")
        copyData(builddir, locdirname, imagedirname, source=True, debug=True)
        #save commitid
        saveCommitId(release, builddir)
        #validate json files
        print("validating JSON files")
        for file in getJSONFiles():
            validateJSON(file)
        #build zip
        if zip_check == True:
            zipname += "-source-debug"
            print(f"creating archive '{zipname}.{ARCHIVEFORMAT}'")
            shutil.make_archive(zipname, ARCHIVEFORMAT, "dist", os.path.relpath(builddir, "dist"))
            print(f"calculating checksum for archive '{zipname}.{ARCHIVEFORMAT}'")
            digest = createDigest(zipname+"."+ARCHIVEFORMAT)
            print(f"checksum written to '{zipname}.{ARCHIVEFORMAT}.sha256'\nchecksum: '{digest}'")
            if docker == True:
                print(f'copied build zip to "{dockerdir}"')
                shutil.copy2(zipname+"."+ARCHIVEFORMAT, os.path.join(dockerdir, os.path.basename(zipname)+"."+ARCHIVEFORMAT))
                shutil.copy2(zipname+"."+ARCHIVEFORMAT+".sha256", os.path.join(dockerdir, os.path.basename(zipname)+"."+ARCHIVEFORMAT+".sha256"))
        
if action == "compilerelease":
    #compiled release
    #delete old build
    if os.path.exists(builddir):
        shutil.rmtree(builddir, onexc=remove_readonly)
        os.makedirs(builddir)
    else:
        os.makedirs(builddir)
    #build main executable
    print("building main executable")
    import PyInstaller.__main__
    import PyInstaller.__init__
    fh = logging.FileHandler(buildlog)
    fh.setLevel(logging.DEBUG)
    fh.setFormatter(logging.Formatter('%(relativeCreated)d %(levelname)s: %(message)s'))
    log = logging.getLogger("PyInstaller")
    log.addHandler(fh)
    arg_main = [
        "--name=ps3gud",
        "--clean",
        "--onefile",
        "--windowed",
        "--icon="+iconpath,
        "--noupx"
    ]
    arg_main.append(mainpyifile)
    PyInstaller.__main__.run(arg_main)
    #build updater executable
    print("building updater executable")
    arg_updater = [
        "--name=PS3GUDup",
        "--clean",
        "--onefile",
        "--windowed",
        "--noupx"
    ]
    arg_updater.append(updaterpyifile)
    PyInstaller.__main__.run(arg_updater)
    #move executables to buildir
    print(f"copying executables to '{builddir}'")
    shutil.move("dist/ps3gud"+suffix, os.path.join(builddir, "ps3gud"+suffix))
    shutil.move("dist/PS3GUDup"+suffix, os.path.join(builddir, "PS3GUDup"+suffix))
    #copy data
    print(f"copying data to '{builddir}'")
    copyData(builddir, locdirname, imagedirname)
    #write header to buildlog
    buildheader(release, buildlog, pyiver=PyInstaller.__init__.__version__, winever=winever)
    #save commitid
    saveCommitId(release, builddir)
    #validate & minify json files
    print("minifying & validating JSON files")
    minifyJSON(getJSONFiles())
    #build zip
    if zip_check == True:
        zipname += "-"+arch
        print(f"creating archive '{zipname}.{ARCHIVEFORMAT}'")
        shutil.make_archive(zipname, ARCHIVEFORMAT, "dist", os.path.relpath(builddir, "dist"))
        print(f"calculating checksum for archive '{zipname}.{ARCHIVEFORMAT}'")
        digest = createDigest(zipname+"."+ARCHIVEFORMAT)
        print(f"checksum written to '{zipname}.{ARCHIVEFORMAT}.sha256'\nchecksum: '{digest}'")
        if docker == True:
                print(f'copied build zip to "{dockerdir}"')
                shutil.copy2(zipname+"."+ARCHIVEFORMAT, os.path.join(dockerdir, os.path.basename(zipname)+"."+ARCHIVEFORMAT))
                shutil.copy2(zipname+"."+ARCHIVEFORMAT+".sha256", os.path.join(dockerdir, os.path.basename(zipname)+"."+ARCHIVEFORMAT+".sha256"))

if action == "compiledebug":
    #compiled debug
    builddir += "Debug"
    buildlog = os.path.join(builddir, "build.log")
    #delete old build
    if os.path.exists(builddir):
        shutil.rmtree(builddir, onexc=remove_readonly)
        os.makedirs(builddir)
    else:
        os.makedirs(builddir)
    with open(buildlog, "w") as f:
        import PyInstaller.__main__
        import PyInstaller.__init__
        fh = logging.FileHandler(os.path.join(builddir, "build.log"))
        fh.setLevel(logging.DEBUG)
        fh.setFormatter(logging.Formatter('%(relativeCreated)d %(levelname)s: %(message)s'))
        log = logging.getLogger("PyInstaller")
        log.addHandler(fh)
        
        #build main executable
        print("building main executable")
        arg_main = [
            "--name=ps3gud",
            "--clean",
            "--onefile",
            "--icon="+iconpath,
            "--noupx",
            "--console"
        ]
        arg_main.append(mainpyifile)
        PyInstaller.__main__.run(arg_main)
        #build updater executable
        print("building updater executable")
        arg_updater = [
            "--name=PS3GUDup",
            "--clean",
            "--onefile",
            "--noupx",
            "--console"
        ]
        PyInstaller.__main__.run(arg_updater)
        #move executables to buildir
        print(f"copying executables to '{builddir}'")
        shutil.move("dist/ps3gud"+suffix, os.path.join(builddir, "ps3gud"+suffix))
        shutil.move("dist/PS3GUDup"+suffix, os.path.join(builddir, "PS3GUDup"+suffix))
        #copy data
        print(f"copying data to '{builddir}'")
        copyData(builddir, locdirname, imagedirname, debug=True)
        #write header to buildlog
        buildheader(release, buildlog, pyiver=PyInstaller.__init__.__version__, winever=winever)
        #save commitid
        saveCommitId(release, builddir)
        #validate json files
        print("validating JSON files")
        for file in getJSONFiles():
            validateJSON(file)
        #build zip
        if zip_check == True:
            zipname += "-"+arch+"-debug"
            print(f"creating archive '{zipname}.{ARCHIVEFORMAT}'")
            shutil.make_archive(zipname, ARCHIVEFORMAT, "dist", os.path.relpath(builddir, "dist"))
            print(f"calculating checksum for archive '{zipname}.{ARCHIVEFORMAT}'")
            digest = createDigest(zipname+"."+ARCHIVEFORMAT)
            print(f"checksum written to '{zipname}.{ARCHIVEFORMAT}.sha256'\nchecksum: '{digest}'")
            if docker == True:
                print(f'copied build zip to "{dockerdir}"')
                shutil.copy2(zipname+"."+ARCHIVEFORMAT, os.path.join(dockerdir, os.path.basename(zipname)+"."+ARCHIVEFORMAT))
                shutil.copy2(zipname+"."+ARCHIVEFORMAT+".sha256", os.path.join(dockerdir, os.path.basename(zipname)+"."+ARCHIVEFORMAT+".sha256"))


================================================
FILE: buildrequirements.txt
================================================
pyinstaller==6.19.0
pyinstaller-hooks-contrib==2026.1

================================================
FILE: gui.py
================================================
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# PS3GameUpdateDownloader downloads PS3 game updates from official Sony servers
# Copyright (C) 2023 shinrax2
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

# builtin
import webbrowser
import tempfile
import platform
import os
import sys

# local files
import PS3GUD
import utils

# pip packages
import FreeSimpleGUI as sg
import keyring
import yaml


class Gui:
    def __init__(self):
        # setup uncaught exception logging
        sys.excepthook = utils.logUncaughtException

        # remove leftover files from updating
        utils.cleanupAfterUpdate()

        # setup main classes
        self.loc = utils.Loc()
        self.ps3 = PS3GUD.PS3GUD()
        self.ps3.setLoc(self.loc)
        self.ps3.loadConfig()
        self.rel = utils.UpdaterGithubRelease("release.json")
        self.loc.setLoc(self.ps3.getConfig("currentLoc"))
        self.ps3.loadTitleDb()

        # setup data
        self.TranslationItems = {}
        self.updateChecked = False
        self.proxydisabled = False
        self.noKeyrings = False
        self.keyring_support_shown = False
        if platform.system() == "Windows":
            self.iconpath = os.path.abspath(os.path.join("images", "icon.ico"))
        else:
            self.iconpath = os.path.abspath(os.path.join("images", "icon_16x16.png"))

        # check for avaiable keyring backends and disable proxy support if none is found
        rings = keyring.backend.get_all_keyring()
        if (
            len(rings) == 1
            and isinstance(rings[0], keyring.backends.fail.Keyring) == True
        ):
            self.proxydisabled = True
            self.ps3.config["use_proxy"] = False
            self.noKeyrings = True

        # setup window style
        sg.change_look_and_feel("DarkAmber")

    def updatePackToTable(self, update):
        data = []
        for pack in update:
            row = [pack["version"], utils.formatSize(pack["size"]), pack["sysver"]]
            data.append(row)
        return data

    def queueToTable(self, queue, ps3):
        i = 1
        data = []
        if len(queue) > 0:
            for pack in queue:
                row = [
                    i,
                    ps3.getTitleNameFromId(pack["gameid"]),
                    pack["gameid"],
                    pack["version"],
                    utils.formatSize(pack["size"]),
                ]
                i += 1
                data.append(row)
        else:
            data.append(["", "", "", "", ""])
        return data

    def retranslateWindow(self, window, loc, items):
        for key, value in items.items():
            window[key].Update(loc.getKey(value))

    def getCodeFromQueueData(self, queueData, resp):
        return queueData[resp][2] + "-" + queueData[resp][3]

    def mainWin(self):
        layout = [  # layout for main window
            [
                sg.Text(
                    self.loc.getKey("window_main_titleid_label"),
                    key="window_main_titleid_label",
                    size=(50, 1),
                )
            ],
            [
                sg.Input(key="titleid"),
                sg.Button(
                    self.loc.getKey("window_main_enter_btn"),
                    key="Enter",
                    bind_return_key=True,
                ),
                sg.Button(self.loc.getKey("window_main_queue_btn"), key="Queue"),
                sg.Button(
                    self.loc.getKey("window_main_rpcs3import_btn"),
                    key="rpcs3import_btn",
                ),
                sg.Button(self.loc.getKey("window_main_config_btn"), key="Config"),
            ],
            [sg.Text("", size=(30, 3), key="window_main_progress_label")],
            [
                sg.ProgressBar(
                    0, orientation="h", size=(52.85, 20), key="window_main_progress_bar"
                )
            ],
            [sg.Output(size=(80, 20), key="Out")],
            [sg.Button(self.loc.getKey("window_main_exit_btn"), key="Exit")],
        ]
        translateMainItems = {}
        translateMainItems["window_main_titleid_label"] = "window_main_titleid_label"
        translateMainItems["Enter"] = "window_main_enter_btn"
        translateMainItems["Config"] = "window_main_config_btn"
        translateMainItems["Queue"] = "window_main_queue_btn"
        translateMainItems["Exit"] = "window_main_exit_btn"
        translateMainItems["rpcs3import_btn"] = "window_main_rpcs3import_btn"
        self.TranslationItems["mainWindow"] = translateMainItems
        self.mainWindow = sg.Window(
            f"{self.loc.getKey('window_main_title')} {self.rel.getVersion()} (Git: {self.rel.getCommitID()})",
            layout,
            finalize=True,
            icon=self.iconpath,
        )
        self.tryDl = False
        self.titledb_updated = False
        self.ps3.setWindow(self.mainWindow)
        self.ps3.logHeader(self.rel.getVersion(), sg.version, self.rel.getCommitID())
        self.ps3.logger.log(self.loc.getKey("msg_sonyPS3StoreShutdownNotice"))

        # main loop
        while True:
            if self.noKeyrings == True:
                if self.keyring_support_shown == False:
                    if self.ps3.getConfig("dont_show_again_keyring_support") == False:
                        self.keyring_supportWin()
            if self.ps3.useDefaultConfig == True:
                self.configWin(nocancel=True)
            if self.titledb_updated == False:
                self.ps3.checkTitleDbVersion()
                self.titledb_updated = True
            if self.ps3.getConfig("checkForNewRelease"):
                if self.updateChecked == False:
                    self.newReleaseWin()
            event, value = self.mainWindow.read()
            if event == "Exit":
                break
            if event in (None, "Exit"):
                break
            if event == "Config" and self.tryDl == False:
                self.configWin()
            if event == "Queue" and self.tryDl == False:
                self.queueWin()
            if event == "Enter" and self.tryDl == False:
                self.ps3.checkForUpdates(value["titleid"])
                self.selectWin()
            if event == "rpcs3import_btn" and self.tryDl == False:
                self.mainWindow.hide()
                self.RPCS3ImportWin()
                self.mainWindow.UnHide()
            if self.tryDl == True and len(self.ps3.DlList.queue) > 0:
                self.ps3.downloadFiles(self.mainWindow)
                self.mainWindow["window_main_progress_label"].Update("")
                self.mainWindow["window_main_progress_bar"].UpdateBar(0)
                self.tryDl = False
            if self.tryDl == True and len(self.ps3.DlList.queue) == 0:
                self.tryDl = False

    def newReleaseWin(self):
        data = self.rel.checkForNewRelease()
        if data == False:
            self.ps3.logger.log(self.loc.getKey("msg_relCheckError"))
            self.updateChecked = True
        elif data == 1:
            self.ps3.logger.log(self.loc.getKey("msg_alreadyUpToDate"))
            self.updateChecked = True
        elif data == 2:
            self.ps3.logger.log(
                self.loc.getKey(
                    "msg_NoReleaseArchiveForPlatformOrArch",
                    [
                        platform.system(),
                        platform.architecture()[0],
                        utils.isAppFrozen(),
                    ],
                )
            )
            self.updateChecked = True
        else:
            self.ps3.logger.log(
                self.loc.getKey("msg_foundNewRelease", [data["version"]])
            )
            self.updateChecked = True
            layoutRelNotify = [
                [
                    sg.Text(
                        self.loc.getKey(
                            "window_relNotify_version_label",
                            [self.rel.getVersion(), data["version"]],
                        )
                    )
                ],
                [sg.Text(self.loc.getKey("window_relNotify_changelog_label"))],
                [
                    sg.Column(
                        [
                            [
                                sg.Text(
                                    self.rel.getChangelog(),
                                    size=(
                                        300,
                                        len(self.rel.getChangelog().split("\n")) * 2,
                                    ),
                                )
                            ]
                        ],
                        size=(700, 300),
                        scrollable=True,
                    )
                ],
                [
                    sg.Button(self.loc.getKey("window_relNotify_dl_btn"), key="dl"),
                    sg.Button(self.loc.getKey("window_relNotify_web_btn"), key="web"),
                    sg.Button(
                        self.loc.getKey("window_relNotify_close_btn"), key="close"
                    ),
                ],
            ]
            self.newReleaseWindow = sg.Window(
                self.loc.getKey("window_relNotify_title"),
                layoutRelNotify,
                icon=self.iconpath,
            )
            while True:
                evRel, valRel = self.newReleaseWindow.read()
                if evRel == "close":
                    self.newReleaseWindow.close()
                    break
                if evRel in (None, "Exit"):
                    self.newReleaseWindow.close()
                    break
                if evRel == "web":
                    webbrowser.open_new(data["releaseUrlWeb"])
                    self.newReleaseWindow.close()
                    break
                if evRel == "dl":
                    self.rel.startUpdater()
                    self.newReleaseWindow.close()
                    break

    def configWin(self, nocancel=False):
        self.mainWindow.hide()
        ll = self.loc.getLocs()
        locChoices = []
        for l in ll:
            locChoices.append(l["language_name"])

        layoutConfig = [
            [
                sg.Text(self.loc.getKey("window_config_dldir_label"), size=(40, 1)),
                sg.In(self.ps3.getConfig("dldir"), key="dldir"),
                sg.FolderBrowse(target="dldir"),
            ],
            [
                sg.Text(self.loc.getKey("window_config_verify_label"), size=(40, 1)),
                sg.Checkbox("", default=self.ps3.getConfig("verify"), key="verify"),
            ],
            [
                sg.Text(
                    self.loc.getKey("window_config_checkIfAlreadyDownloaded_label"),
                    size=(40, 1),
                ),
                sg.Checkbox(
                    "",
                    default=self.ps3.getConfig("checkIfAlreadyDownloaded"),
                    key="checkIfAlreadyDownloaded",
                ),
            ],
            [
                sg.Text(
                    self.loc.getKey("window_config_checkForNewRelease_label"),
                    size=(40, 1),
                ),
                sg.Checkbox(
                    "",
                    default=self.ps3.getConfig("checkForNewRelease"),
                    key="checkForNewRelease",
                ),
            ],
            [
                sg.Text(
                    self.loc.getKey("window_config_storageThreshold_label"),
                    size=(40, 1),
                ),
                sg.In(
                    self.ps3.getConfig("storageThresholdNew"), key="storageThreshold"
                ),
            ],
            [
                sg.Text(
                    self.loc.getKey("window_config_currentLoc_label"), size=(40, 1)
                ),
                sg.OptionMenu(
                    locChoices,
                    size=(8, 15),
                    key="currentLoc",
                    default_value=self.loc.getKey("language_name"),
                ),
            ],
            [
                sg.Text(
                    self.loc.getKey("window_config_renamepkgs_label"),
                    size=(40, 1),
                    tooltip=self.loc.getKey("window_config_renamepkgs_tooltip"),
                ),
                sg.Checkbox(
                    "",
                    default=self.ps3.getConfig("rename_pkgs"),
                    key="rename_pkgs",
                    tooltip=self.loc.getKey("window_config_renamepkgs_tooltip"),
                ),
            ],
            [
                sg.Text(
                    self.loc.getKey(
                        "window_config_add_all_updates_to_queue_automatically_label"
                    ),
                    size=(40, 1),
                    tooltip=self.loc.getKey(
                        "window_config_add_all_updates_to_queue_automatically_tooltip"
                    ),
                ),
                sg.Checkbox(
                    "",
                    default=self.ps3.getConfig(
                        "add_all_updates_to_queue_automatically"
                    ),
                    key="add_all_updates_to_queue_automatically",
                    tooltip=self.loc.getKey(
                        "window_config_add_all_updates_to_queue_automatically_tooltip"
                    ),
                ),
            ],
            [
                sg.Text(
                    self.loc.getKey("window_config_bypass_ssl_label"),
                    size=(40, 1),
                    tooltip=self.loc.getKey("window_config_bypass_ssl_tooltip"),
                ),
                sg.Checkbox(
                    "",
                    default=self.ps3.getConfig("bypass_ssl"),
                    key="bypass_ssl",
                    tooltip=self.loc.getKey("window_config_bypass_ssl_tooltip"),
                ),
            ],
            [
                sg.Text(
                    self.loc.getKey("window_config_updatetitledb_label"), size=(40, 1)
                ),
                sg.Checkbox(
                    "",
                    default=self.ps3.getConfig("update_titledb"),
                    key="update_titledb",
                ),
            ],
            [
                sg.Text(self.loc.getKey("window_config_useproxy_label"), size=(40, 1)),
                sg.Checkbox(
                    "",
                    default=self.ps3.getConfig("use_proxy"),
                    key="use_proxy",
                    enable_events=True,
                ),
            ],
            [
                sg.Text(self.loc.getKey("window_config_proxyip_label"), size=(40, 1)),
                sg.In(self.ps3.getConfig("proxy_ip"), key="proxy_ip"),
            ],
            [
                sg.Text(self.loc.getKey("window_config_proxyport_label"), size=(40, 1)),
                sg.In(self.ps3.getConfig("proxy_port"), key="proxy_port"),
            ],
            [
                sg.Text(self.loc.getKey("window_config_proxyuser_laber"), size=(40, 1)),
                sg.In(self.ps3.getConfig("proxy_user"), key="proxy_user"),
            ],
            [
                sg.Text(self.loc.getKey("window_config_proxypass_label"), size=(40, 1)),
                sg.In(
                    self.ps3.getConfig("proxy_pass"),
                    key="proxy_pass",
                    password_char="*",
                ),
            ],
            [
                sg.Button(self.loc.getKey("window_config_cancel_btn"), key="Cancel"),
                sg.Button(
                    self.loc.getKey("window_config_save_btn"),
                    key="Save",
                    bind_return_key=True,
                ),
            ],
        ]
        self.configWindow = sg.Window(
            self.loc.getKey("window_config_title"),
            layoutConfig,
            finalize=True,
            icon=self.iconpath,
        )
        if nocancel == True:
            self.configWindow["Cancel"].Update(disabled=True)
        if self.proxydisabled == True:
            self.configWindow["use_proxy"].Update(disabled=True)
        if self.ps3.getConfig("use_proxy") == False:
            self.configWindow["proxy_ip"].Update(disabled=True)
            self.configWindow["proxy_port"].Update(disabled=True)
            self.configWindow["proxy_user"].Update(disabled=True)
            self.configWindow["proxy_pass"].Update(disabled=True)
        while True:
            evConfig, valConfig = self.configWindow.Read()
            if evConfig == "Cancel":
                self.configWindow.Close()
                self.mainWindow.UnHide()
                break
            if evConfig in (None, "Exit"):
                self.configWindow.Close()
                self.mainWindow.UnHide()
                break
            if evConfig == "use_proxy":
                if valConfig["use_proxy"] == True:
                    self.configWindow["proxy_ip"].Update(disabled=False)
                    self.configWindow["proxy_port"].Update(disabled=False)
                    self.configWindow["proxy_user"].Update(disabled=False)
                    self.configWindow["proxy_pass"].Update(disabled=False)
                else:
                    self.configWindow["proxy_ip"].Update(disabled=True)
                    self.configWindow["proxy_port"].Update(disabled=True)
                    self.configWindow["proxy_user"].Update(disabled=True)
                    self.configWindow["proxy_pass"].Update(disabled=True)
            if evConfig == "Save" and valConfig["currentLoc"] != "":
                cL = valConfig["currentLoc"]
                for l in ll:
                    if cL == l["language_name"]:
                        cL = l["language_short"]
                config = {
                    "dldir": valConfig["dldir"],
                    "verify": valConfig["verify"],
                    "checkIfAlreadyDownloaded": valConfig["checkIfAlreadyDownloaded"],
                    "storageThresholdNew": valConfig["storageThreshold"],
                    "currentLoc": cL,
                    "proxy_ip": valConfig["proxy_ip"],
                    "proxy_port": valConfig["proxy_port"],
                    "use_proxy": valConfig["use_proxy"],
                    "rename_pkgs": valConfig["rename_pkgs"],
                    "update_titledb": valConfig["update_titledb"],
                    "bypass_ssl": valConfig["bypass_ssl"],
                    "add_all_updates_to_queue_automatically": valConfig[
                        "add_all_updates_to_queue_automatically"
                    ],
                }
                self.ps3.setConfig(config)
                if self.ps3.getConfig("use_proxy") == True:
                    self.ps3.setProxyCredentials(
                        valConfig["proxy_pass"], valConfig["proxy_user"]
                    )
                self.loc.setLoc(cL)
                self.ps3.setupProxy()
                self.retranslateWindow(
                    self.mainWindow, self.loc, self.TranslationItems["mainWindow"]
                )
                self.configWindow.Close()
                self.mainWindow.UnHide()
                break

    def selectWin(self, only_queue=False):
        try:
            updlen = len(self.ps3.Updates[self.ps3.titleid])
        except KeyError:
            updlen = 0
            self.tryDl = False
        if updlen > 0:
            updates = self.ps3.getUpdates()

            if self.ps3.getConfig("add_all_updates_to_queue_automatically"):
                for update in updates:
                    self.ps3.DlList.addEntry(update)

                self.ps3.logger.log(f"Added {updlen} updates to queue")
            else:
                self.mainWindow.hide()
                data = self.updatePackToTable(updates)
                lay2 = [
                    [
                        sg.Text(
                            self.loc.getKey(
                                "window_select_text_label",
                                [self.ps3.getTitleNameFromId(), self.ps3.titleid],
                            )
                        )
                    ],
                    [
                        sg.Table(
                            values=data,
                            headings=[
                                self.loc.getKey("window_select_table_ver"),
                                self.loc.getKey("window_select_table_size"),
                                self.loc.getKey("window_select_table_sysver"),
                            ],
                            key="Table",
                            enable_events=True,
                        )
                    ],
                    [
                        sg.Text(
                            self.loc.getKey("window_select_help_label"), size=(45, 2)
                        )
                    ],
                    [
                        sg.Button(
                            self.loc.getKey("window_select_download_btn"),
                            key="OK",
                            disabled=True,
                        ),
                        sg.Button(
                            self.loc.getKey("window_select_queue_btn"),
                            key="Queue",
                            disabled=True,
                        ),
                        sg.Button(
                            self.loc.getKey("window_select_cancel_btn"), key="Cancel"
                        ),
                    ],
                ]
                self.selectWindow = sg.Window(
                    self.loc.getKey("window_select_title"), lay2, icon=self.iconpath
                )
                while True:
                    ev2, val2 = self.selectWindow.Read()
                    if len(val2["Table"]) > 0:
                        if only_queue == False:
                            self.selectWindow["OK"].Update(disabled=False)
                        self.selectWindow["Queue"].Update(disabled=False)
                    if len(val2["Table"]) == 0:
                        self.selectWindow["OK"].Update(disabled=True)
                        self.selectWindow["Queue"].Update(disabled=True)
                    if ev2 in (None, "Exit"):
                        self.selectWindow.Close()
                        self.mainWindow.UnHide()
                        self.tryDl = False
                        break
                    if ev2 == "Cancel":
                        self.selectWindow.Close()
                        self.mainWindow.UnHide()
                        self.tryDl = False
                        break
                    if ev2 == "OK" and len(val2["Table"]) > 0:
                        if len(val2["Table"]) == 1:
                            self.ps3.DlList.addEntry(
                                self.ps3.getUpdates()[val2["Table"][0]]
                            )
                            self.selectWindow.Close()
                            self.mainWindow.UnHide()
                            self.tryDl = True
                            break
                        if len(val2["Table"]) > 1:
                            for row in val2["Table"]:
                                self.ps3.DlList.addEntry(self.ps3.getUpdates()[row])
                            self.selectWindow.Close()
                            self.mainWindow.UnHide()
                            self.tryDl = True
                            break
                    if ev2 == "Queue" and len(val2["Table"]) > 0:
                        if len(val2["Table"]) == 1:
                            self.ps3.DlList.addEntry(
                                self.ps3.getUpdates()[val2["Table"][0]]
                            )
                            self.selectWindow.Close()
                            self.mainWindow.UnHide()
                            self.tryDl = False
                            break
                        if len(val2["Table"]) > 1:
                            for row in val2["Table"]:
                                self.ps3.DlList.addEntry(self.ps3.getUpdates()[row])
                            self.selectWindow.Close()
                            self.mainWindow.UnHide()
                            self.tryDl = False
                            break

    def queueWin(self):
        self.mainWindow.hide()
        queueData = self.queueToTable(self.ps3.DlList.queue, self.ps3)
        layQueue = [
            [
                sg.Table(
                    values=queueData,
                    headings=[
                        self.loc.getKey("window_queue_table_num"),
                        self.loc.getKey("window_queue_table_game"),
                        self.loc.getKey("window_queue_table_titleid"),
                        self.loc.getKey("window_queue_table_ver"),
                        self.loc.getKey("window_queue_table_size"),
                    ],
                    key="Table",
                    enable_events=True,
                )
            ],
            [
                sg.Text(
                    self.loc.getKey(
                        "window_queue_totalsize_label",
                        [utils.formatSize(self.ps3.DlList.getTotalDownloadSize())],
                    ),
                    key="TotalSize",
                    size=(20, 1),
                )
            ],
            [
                sg.Text(self.loc.getKey("window_queue_export_label")),
                sg.Input("", key="exportFile"),
                sg.FileSaveAs(target="exportFile"),
                sg.Button(self.loc.getKey("window_queue_export_btn"), key="export"),
            ],
            [
                sg.Button(
                    self.loc.getKey("window_queue_moveup_btn"),
                    key="Move Up",
                    disabled=True,
                ),
                sg.Button(
                    self.loc.getKey("window_queue_movedown_btn"),
                    key="Move Down",
                    disabled=True,
                ),
                sg.Button(
                    self.loc.getKey("window_queue_remove_btn"),
                    key="Remove",
                    disabled=True,
                ),
            ],
            [
                sg.Button(self.loc.getKey("window_queue_download_btn"), key="Download"),
                sg.Button(self.loc.getKey("window_queue_close_btn"), key="Close"),
            ],
        ]
        self.queueWindow = sg.Window(
            self.loc.getKey("window_queue_title"), layQueue, icon=self.iconpath
        )
        while True:
            evQueue, valQueue = self.queueWindow.read()
            if len(valQueue["Table"]) == 0:
                self.queueWindow["Move Up"].Update(disabled=True)
                self.queueWindow["Move Down"].Update(disabled=True)
                self.queueWindow["Remove"].Update(disabled=True)
            if len(valQueue["Table"]) == 1:
                self.queueWindow["Move Up"].Update(disabled=False)
                self.queueWindow["Move Down"].Update(disabled=False)
                self.queueWindow["Remove"].Update(disabled=False)
            if len(valQueue["Table"]) > 1:
                self.queueWindow["Move Up"].Update(disabled=True)
                self.queueWindow["Move Down"].Update(disabled=True)
                self.queueWindow["Remove"].Update(disabled=False)
            if evQueue == "Move Up":
                if len(valQueue["Table"]) == 1:
                    if len(self.ps3.DlList.queue) > 1:
                        self.ps3.DlList.moveUp(
                            self.getCodeFromQueueData(queueData, valQueue["Table"][0])
                        )
                        queueData = self.queueToTable(self.ps3.DlList.queue, self.ps3)
                        self.queueWindow["Table"].Update(values=queueData)
            if evQueue == "Move Down":
                if len(valQueue["Table"]) == 1:
                    if len(self.ps3.DlList.queue) > 1:
                        self.ps3.DlList.moveDown(
                            self.getCodeFromQueueData(queueData, valQueue["Table"][0])
                        )
                        queueData = self.queueToTable(ps3.DlList.queue, ps3)
                        self.queueWindow["Table"].Update(values=queueData)
            if evQueue == "Remove":
                for row in valQueue["Table"]:
                    code = self.getCodeFromQueueData(queueData, row)
                    self.ps3.DlList.removeEntry(code)
                queueData = self.queueToTable(self.ps3.DlList.queue, self.ps3)
                self.queueWindow["Table"].Update(values=queueData)
                self.queueWindow["TotalSize"].Update(
                    self.loc.getKey(
                        "window_queue_totalsize_label",
                        [utils.formatSize(self.ps3.DlList.getTotalDownloadSize())],
                    )
                )
            if evQueue == "Download":
                self.tryDl = True
                self.queueWindow.Close()
                self.mainWindow.UnHide()
                break
            if evQueue == "export" and valQueue["exportFile"] != "":
                self.ps3.DlList.exportQueue(valQueue["exportFile"])
                self.msgBox(
                    self.loc.getKey(
                        "window_msgBox_queueExported_label", [valQueue["exportFile"]]
                    ),
                    self.loc.getKey("window_msgBox_queueExported_title"),
                    self.queueWindow,
                )
            if evQueue in (None, "Exit"):
                self.queueWindow.Close()
                self.mainWindow.UnHide()
                break
            if evQueue == "Close":
                self.queueWindow.Close()
                self.mainWindow.UnHide()
                break

    def keyring_supportWin(self):
        self.keyring_support_shown = True
        keyring_url = "https://github.com/jaraco/keyring"
        layout = [
            [
                sg.Text(
                    self.loc.getKey("window_keyring_support_info_label", [keyring_url])
                )
            ],
            [
                sg.Checkbox(
                    self.loc.getKey("window_keyring_support_dont_show_again_label"),
                    default=False,
                    key="dont_show_again",
                ),
                sg.Button(self.loc.getKey("window_keyring_support_ok_btn"), key="ok"),
                sg.Button(
                    self.loc.getKey("window_keyring_support_browser_btn"), key="browser"
                ),
            ],
        ]
        self.mainWindow.hide()
        self.keyring_supportWindow = sg.Window(
            self.loc.getKey("window_keyring_support_title"),
            layout,
            size=(600, 100),
            icon=self.iconpath,
        )
        while True:
            ev, val = self.keyring_supportWindow.read()
            if ev == "ok":
                if val["dont_show_again"] == True:
                    self.ps3.config["dont_show_again_keyring_support"] = True
                    self.ps3.saveConfig()
                self.keyring_supportWindow.Close()
                self.mainWindow.UnHide()
                break
            if ev == "browser":
                webbrowser.open_new(keyring_url)
            if ev in (None, "Exit"):
                self.keyring_supportWindow.Close()
                self.mainWindow.UnHide()
                break

    def msgBox(self, text, title, parent):
        layout = [
            [sg.Text(text)],
            [sg.Button(self.loc.getKey("window_msgBox_ok_btn"), key="ok")],
        ]
        parent.hide()
        win = sg.Window(title, layout, icon=self.iconpath)
        while True:
            ev, val = win.read()
            if ev == "ok":
                win.Close()
                break
            if ev in (None, "Exit"):
                win.Close()
                break
        parent.UnHide()

    def RPCS3ImportWin(self):
        layout = [
            [sg.Text(self.loc.getKey("window_rpcs3import_label"))],
            [
                sg.In("", key="rpcs3dir"),
                sg.FileBrowse(
                    target="rpcs3dir", file_types=(("games.yml", "games.yml"),)
                ),
            ],
            [sg.Button(self.loc.getKey("window_rpcs3import_ok_btn"), key="OK")],
        ]
        win = sg.Window(
            self.loc.getKey("window_rpcs3import_title"), layout, icon=self.iconpath
        )
        while True:
            ev, val = win.read()
            if ev == "OK":
                if os.path.isfile(val["rpcs3dir"]) == True:
                    with open(val["rpcs3dir"], "r") as f:
                        data = yaml.safe_load(f)
                    for gameid in data:
                        self.ps3.checkForUpdates(gameid)
                        self.selectWin(only_queue=True)
                win.Close()
                break
            if ev in (None, "Exit"):
                win.Close()
                break


================================================
FILE: loc/de.json
================================================
{
    "language_name": {
        "string": "Deutsch",
        "comment": "Name of the language"
    },
    "language_short": {
        "string": "de",
        "comment": "Name of the language file"
    },
    "window_main_title": {
        "string": "PS3 Game Update Downloader",
        "comment": "Main window title (don't translate)"
    },
    "window_main_titleid_label": {
        "string": "TitleID Eingeben",
        "comment": ""
    },
    "window_main_enter_btn": {
        "string": "Suchen",
        "comment": ""
    },
    "window_main_progress_label": {
        "string": "Lade Datei {0} herunter:\n{1}/{2}({3}%)\nGeschwindigkeit: {4}",
        "comment": "0: Number of download, 1: Amount of downloaded data, 2: Total file size, 3: Amount of downloaded data in %, 4: Download speed"
    },
    "window_main_config_btn": {
        "string": "Konfiguration",
        "comment": ""
    },
    "window_main_exit_btn": {
        "string": "Verlassen",
        "comment": ""
    },
    "window_main_queue_btn": {
        "string": "Warteschlange",
        "comment": ""
    },
    "window_config_title": {
        "string": "Konfiguration",
        "comment": ""
    },
    "window_config_dldir_label": {
        "string": "Downloadverzeichnis:",
        "comment": ""
    },
    "window_config_verify_label": {
        "string": "Dateien überprüfen:",
        "comment": ""
    },
    "window_config_checkIfAlreadyDownloaded_label": {
        "string": "Prüfen, ob Dateien bereits heruntergeladen wurden:",
        "comment": ""
    },
    "window_config_checkForNewRelease_label": {
        "string": "Neue Version beim Starten suchen:",
        "comment": ""
    },
    "window_config_storageThreshold_label": {
        "string": "Speichergrenze (in GiB):",
        "comment": ""
    },
    "window_config_currentLoc_label": {
        "string": "Sprache:",
        "comment": ""
    },
    "window_config_renamepkgs_label": {
        "string": "PKGs umbenennen:",
        "comment": ""
    },
    "window_config_renamepkgs_tooltip": {
        "string": "Benenne PKGs in $GAMENAME_[$GAMEID]_$GAMEVERSION um",
        "comment": ""
    },
    "window_config_updatetitledb_label": {
        "string": "Beim Start TitleDB aktualisieren:",
        "comment": ""
    },
    "window_config_useproxy_label": {
        "string": "Proxy benutzen? (NUR SOCKS5!)",
        "comment": ""
    },
    "window_config_proxyip_label": {
        "string": "Proxy-IP:",
        "comment": ""
    },
    "window_config_proxyport_label": {
        "string": "Proxy-Port:",
        "comment": ""
    },
    "window_config_proxyuser_laber": {
        "string": "Proxy-Benutzer:",
        "comment": ""
    },
    "window_config_proxypass_label": {
        "string": "Proxy-Passwort",
        "comment": ""
    },
    "window_config_cancel_btn": {
        "string": "Abbrechen",
        "comment": ""
    },
    "window_config_save_btn": {
        "string": "Speichern",
        "comment": ""
    },
    "window_select_title": {
        "string": "Updates auswählen",
        "comment": ""
    },
    "window_select_text_label": {
        "string": "Spiel: {0}\tTitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "window_select_table_ver": {
        "string": "Version",
        "comment": ""
    },
    "window_select_table_size": {
        "string": "Dateigröße",
        "comment": ""
    },
    "window_select_table_sysver": {
        "string": "PS3 FW Version",
        "comment": ""
    },
    "window_select_download_btn": {
        "string": "Herunterladen",
        "comment": ""
    },
    "window_select_cancel_btn": {
        "string": "Abbrechen",
        "comment": ""
    },
    "window_select_queue_btn": {
        "string": "Zur Downloadwarteschlange hinzufügen",
        "comment": ""
    },
    "window_select_help_label": {
        "string": "Halten Sie Strg gedrückt und klicken auf die Updates, die Sie auswählen möchten.",
        "comment": ""
    },
    "window_relNotify_title": {
        "string": "Neue Version gefunden!",
        "comment": ""
    },
    "window_relNotify_version_label": {
        "string": "Aktuelle Version: {0}\nNeue Version: {1}",
        "comment": "0: Current programm version, 1: New programm version"
    },
    "window_relNotify_changelog_label": {
        "string": "Neuerungen:",
        "comment": ""
    },
    "window_relNotify_web_btn": {
        "string": "Öffne Website im Browser",
        "comment": ""
    },
    "window_relNotify_dl_btn": {
        "string": "Update herunterladen und installieren",
        "comment": ""
    },
    "window_relNotify_close_btn": {
        "string": "Schließen",
        "comment": ""
    },
    "window_queue_title": {
        "string": "Downloadwarteschlange",
        "comment": ""
    },
    "window_queue_table_num": {
        "string": "Num",
        "comment": ""
    },
    "window_queue_table_game": {
        "string": "Spiel",
        "comment": ""
    },
    "window_queue_table_titleid": {
        "string": "TitleID",
        "comment": ""
    },
    "window_queue_table_ver": {
        "string": "Version",
        "comment": ""
    },
    "window_queue_table_size": {
        "string": "Dateigröße",
        "comment": ""
    },
    "window_queue_download_btn": {
        "string": "Herunterladen",
        "comment": ""
    },
    "window_queue_close_btn": {
        "string": "Schließen",
        "comment": ""
    },
    "window_queue_moveup_btn": {
        "string": "Nach Oben",
        "comment": ""
    },
    "window_queue_movedown_btn": {
        "string": "Nach Unten",
        "comment": ""
    },
    "window_queue_remove_btn": {
        "string": "Löschen",
        "comment": ""
    },
    "window_queue_totalsize_label": {
        "string": "Gesamtgröße: {0}",
        "comment": "0: Total download size of queue"
    },
	"window_queue_export_label": {
        "string": "Exportiere Warteschlange nach:",
        "comment": ""
    },
    "window_queue_export_btn": {
        "string": "Exportieren",
        "comment": ""
    },
    "window_keyring_support_info_label": {
        "string": "Kein brauchbares keyring backend gefunden.\nBesuche bitte die Website von keyring für eine Installationsanleitung.\n{0}",
        "comment": "0: Url of keyring homepage"
    },
    "window_keyring_support_dont_show_again_label": {
        "string": "Nicht nochmal anzeigen",
        "comment": ""
    },
    "window_keyring_support_ok_btn": {
        "string": "Ok",
        "comment": ""
    },
    "window_keyring_support_browser_btn": {
        "string": "Im Browser öffnen",
        "comment": ""
    },
    "window_keyring_support_title": {
        "string": "Achtung! Proxy Unterstützung deaktiviert!",
        "comment": ""
    },
	"window_msgBox_ok_btn": {
		"string": "Ok",
		"comment": ""
	},
	"window_msgBox_queueExported_title": {
		"string": "Warteschlange exportiert",
		"comment": ""
	},
	"window_msgBox_queueExported_label": {
		"string": "Warteschlange nach \"{0}\" exportiert.",
		"comment": "0: File name"
	},
    "msg_configFileLoaded": {
        "string": "Konfigurationsdatei geladen!",
        "comment": ""
    },
    "msg_noConfigFile": {
        "string": "Keine Konfigurationsdatei gefunden! Benutze Vorgaben!",
        "comment": ""
    },
    "msg_configFileSaved": {
        "string": "Konfigurationsdatei gespeichert!",
        "comment": ""
    },
    "msg_loadedTitledb": {
        "string": "TitleDB \"{0}\" geladen",
        "comment": "0: Path to TitleDB"
    },
    "msg_titleIDIs": {
        "string": "Spiel: {0}\t TitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "msg_titleIDNotValid": {
        "string": "TitleID ist falsch!",
        "comment": ""
    },
    "msg_metaNotAvailable": {
        "string": "Die Metadatei für diese TitleID ist nicht verfügbar!",
        "comment": ""
    },
    "msg_metaFileEmpty": {
        "string": "Die Metadatei für diese TitleID enthält keine Informationen!",
        "comment": ""
    },
    "msg_startingDownloads": {
        "string": "Starte Download der Updates",
        "comment": ""
    },
    "msg_alreadyDownloadedNoVerify": {
        "string": "Datei \"{0}\" wurde bereits heruntergeladen! Überspringen! Nicht überprüft!",
        "comment": "0: File name"
    },
    "msg_alreadyDownloadedVerify": {
        "string": "Datei \"{0}\" wurde bereits heruntergeladen! Überspringen! SHA-1 überprüft!",
        "comment": "0: File name"
    },
    "msg_startSingleDownload": {
        "string": "Starte Download {0} von {1}",
        "comment": "0: Number of download, 1: Total number of downloads in queue"
    },
    "msg_verifySuccess": {
        "string": "Überprüfung von \"{0}\" war erfolgreich!",
        "comment": "0: File name"
    },
    "msg_verifyFailure": {
        "string": "Überprüfung von \"{0}\" ist gescheitert!\tDatei wird gelöscht!",
        "comment": "0: File name"
    },
    "msg_noVerify": {
        "string": "Datei \"{0}\" wurde nicht überprüft!",
        "comment": "0: File name"
    },
    "msg_finishedDownload": {
        "string": "{0} Dateien wurden heruntergeladen!",
        "comment": "0: Number of files downloaded"
    },
    "msg_notEnoughDiskSpace": {
        "string": "Nicht genügend Speicherplatz!",
        "comment": ""
    },
    "msg_spaceBelowThreshold": {
        "string": "Freier Speicherplatz unter {0}",
        "comment": "0: Storage threshold"
    },
    "msg_relCheckError": {
        "string": "Konnte nicht nach neuer Version suchen!",
        "comment": ""
    },
    "msg_alreadyUpToDate": {
        "string": "Bereits neuste Version!",
        "comment": ""
    },
    "msg_foundNewRelease": {
        "string": "Neue Version \"{0}\" gefunden",
        "comment": "0: New programm version"
    },
    "msg_NoReleaseArchiveForPlatformOrArch": {
        "string": "Konnte kein Release für ihre Plattform oder Architektur finden. Plattform: \"{0}\" Architektur: \"{1}\" Kompiliert: \"{2}\"",
        "comment": "0: Platform, 1: Architecture, 2: App is compiled(True|False)"
    },
    "msg_dldirNotWriteable": {
        "string": "Ihr ausgewählter Download-Ordner \"{0}\" ist nicht schreibbar!",
        "comment": "0: Directory name"
    },
    "msg_checkProxySettings": {
        "string": "Bitte stellen Sie sicher, dass die Proxy-Einstellungen korrekt sind!",
        "comment": ""
    },
    "msg_sonyPS3StoreShutdownNotice": {
        "string": "!!! IMPORTANT !!! Sony hat angekündigt, den PS3-Store am 02.07.21 zu schließen und diese Entscheidung später rückgängig gemacht. Es scheint, dass in der Zeit zwischen der Ankündigung und der Rücknahme wurden einige Spielupdates gelöscht wurden. Ich empfehle Ihnen, Ihre heruntergeladenen Spielupdates zu sichern.",
        "comment": ""
    },
    "msg_newTitleDbVersion": {
        "string": "Neue Version der TitleDB heruntergeladen.",
        "comment": ""
    }
}

================================================
FILE: loc/en.json
================================================
{
    "language_name": {
        "string": "English",
        "comment": "Name of the language"
    },
    "language_short": {
        "string": "en",
        "comment": "Name of the language file"
    },
    "window_main_title": {
        "string": "PS3 Game Update Downloader",
        "comment": "Main window title (don't translate)"
    },
    "window_main_titleid_label": {
        "string": "Enter TitleID",
        "comment": ""
    },
    "window_main_enter_btn": {
        "string": "Search",
        "comment": ""
    },
    "window_main_progress_label": {
        "string": "Downloading file {0}:\n{1}/{2}({3}%)\nSpeed: {4}",
        "comment": "0: Number of download, 1: Amount of downloaded data, 2: Total file size, 3: Amount of downloaded data in %, 4: Download speed"
    },
    "window_main_config_btn": {
        "string": "Configuration",
        "comment": ""
    },
    "window_main_exit_btn": {
        "string": "Exit",
        "comment": ""
    },
    "window_main_queue_btn": {
        "string": "Queue",
        "comment": ""
    },
    "window_config_title": {
        "string": "Configuration",
        "comment": ""
    },
    "window_config_dldir_label": {
        "string": "Download directory:",
        "comment": ""
    },
    "window_config_verify_label": {
        "string": "Verify files:",
        "comment": ""
    },
    "window_config_checkIfAlreadyDownloaded_label": {
        "string": "Check if file was already downloaded:",
        "comment": ""
    },
    "window_config_checkForNewRelease_label": {
        "string": "Check for a new release at startup:",
        "comment": ""
    },
    "window_config_storageThreshold_label": {
        "string": "Storage threshold (in GiB):",
        "comment": ""
    },
    "window_config_currentLoc_label": {
        "string": "Language:",
        "comment": ""
    },
    "window_config_renamepkgs_label": {
        "string": "Rename PKGs:",
        "comment": ""
    },
    "window_config_renamepkgs_tooltip": {
        "string": "Renames PKGs to $GAMENAME_[$GAMEID]_$GAMEVERSION",
        "comment": ""
    },
	"window_config_add_all_updates_to_queue_automatically_label": {
        "string": "Add all updates to queue automatically:",
        "comment": ""
    },
    "window_config_add_all_updates_to_queue_automatically_tooltip": {
        "string": "Automatically add all game updates to queue without displaying the confirmation and selection window",
        "comment": ""
    },
	"window_config_bypass_ssl_label": {
        "string": "Bypass SSL(Insecure):",
        "comment": ""
    },
    "window_config_bypass_ssl_tooltip": {
        "string": "Only try this if you have problems finding updates.\nDo not attempt to resolve and validate SSL when downloading.",
        "comment": ""
    },
    "window_config_updatetitledb_label": {
        "string": "Update TitleDB on startup:",
        "comment": ""
    },
    "window_config_useproxy_label": {
        "string": "Use Proxy? (ONLY SOCKS5!)",
        "comment": ""
    },
    "window_config_proxyip_label": {
        "string": "Proxy IP:",
        "comment": ""
    },
    "window_config_proxyport_label": {
        "string": "Proxy Port:",
        "comment": ""
    },
    "window_config_proxyuser_laber": {
        "string": "Proxy User:",
        "comment": ""
    },
    "window_config_proxypass_label": {
        "string": "Proxy Password",
        "comment": ""
    },
    "window_config_cancel_btn": {
        "string": "Cancel",
        "comment": ""
    },
    "window_config_save_btn": {
        "string": "Save",
        "comment": ""
    },
    "window_select_title": {
        "string": "Select Updates",
        "comment": ""
    },
    "window_select_text_label": {
        "string": "Game: {0}\tTitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "window_select_table_ver": {
        "string": "Version",
        "comment": ""
    },
    "window_select_table_size": {
        "string": "Filesize",
        "comment": ""
    },
    "window_select_table_sysver": {
        "string": "PS3 FW Version",
        "comment": ""
    },
    "window_select_download_btn": {
        "string": "Download",
        "comment": ""
    },
    "window_select_cancel_btn": {
        "string": "Cancel",
        "comment": ""
    },
    "window_select_queue_btn": {
        "string": "Add to download queue",
        "comment": ""
    },
    "window_select_help_label": {
        "string": "Hold Ctrl and click on the updates you want to select.",
        "comment": ""
    },
    "window_relNotify_title": {
        "string": "New release found!",
        "comment": ""
    },
    "window_relNotify_version_label": {
        "string": "Current version: {0}\nNew version: {1}",
        "comment": "0: Current programm version, 1: New programm version"
    },
    "window_relNotify_changelog_label": {
        "string": "Changelog:",
        "comment": ""
    },
    "window_relNotify_web_btn": {
        "string": "Open website in browser",
        "comment": ""
    },
    "window_relNotify_dl_btn": {
        "string": "Download and install update",
        "comment": ""
    },
    "window_relNotify_close_btn": {
        "string": "Close",
        "comment": ""
    },
    "window_queue_title": {
        "string": "Download queue",
        "comment": ""
    },
    "window_queue_table_num": {
        "string": "Num",
        "comment": ""
    },
    "window_queue_table_game": {
        "string": "Game",
        "comment": ""
    },
    "window_queue_table_titleid": {
        "string": "TitleID",
        "comment": ""
    },
    "window_queue_table_ver": {
        "string": "Version",
        "comment": ""
    },
    "window_queue_table_size": {
        "string": "Filesize",
        "comment": ""
    },
    "window_queue_download_btn": {
        "string": "Start Download",
        "comment": ""
    },
    "window_queue_close_btn": {
        "string": "Close",
        "comment": ""
    },
    "window_queue_moveup_btn": {
        "string": "Move Up",
        "comment": ""
    },
    "window_queue_movedown_btn": {
        "string": "Move Down",
        "comment": ""
    },
    "window_queue_remove_btn": {
        "string": "Remove",
        "comment": ""
    },
    "window_queue_totalsize_label": {
        "string": "Total Size: {0}",
        "comment": "0: Total download size of queue"
    },
    "window_queue_export_label": {
        "string": "Export queue to:",
        "comment": ""
    },
    "window_queue_export_btn": {
        "string": "Export",
        "comment": ""
    },
    "window_keyring_support_info_label": {
        "string": "No viable keyring backends were found.\nPlease check the homepage of keyring for an installation guide.\n{0}",
        "comment": "0: Url of keyring homepage"
    },
    "window_keyring_support_dont_show_again_label": {
        "string": "Don't show again",
        "comment": ""
    },
    "window_keyring_support_ok_btn": {
        "string": "Ok",
        "comment": ""
    },
    "window_keyring_support_browser_btn": {
        "string": "Open in browser",
        "comment": ""
    },
    "window_keyring_support_title": {
        "string": "Warning! Proxy support disabled!",
        "comment": ""
    },
	"window_msgBox_ok_btn": {
		"string": "Ok",
		"comment": ""
	},
	"window_msgBox_queueExported_title": {
		"string": "Queue exported",
		"comment": ""
	},
	"window_msgBox_queueExported_label": {
		"string": "Queue exported to \"{0}\".",
		"comment": "0: File name"
	},
    "msg_configFileLoaded": {
        "string": "Loaded configuration file!",
        "comment": ""
    },
    "msg_noConfigFile": {
        "string": "No configuration file found! Using defaults!",
        "comment": ""
    },
    "msg_configFileSaved": {
        "string": "Saved configuration file!",
        "comment": ""
    },
    "msg_loadedTitledb": {
        "string": "Loaded TitleDB \"{0}\"",
        "comment": "0: Path to TitleDB"
    },
    "msg_titleIDIs": {
        "string": "Game is: {0}\t TitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "msg_titleIDNotValid": {
        "string": "TitleID is invalid!",
        "comment": ""
    },
    "msg_metaNotAvailable": {
        "string": "Meta file for this TitleID is not available!",
        "comment": ""
    },
    "msg_metaFileEmpty": {
        "string": "Meta file for this TitleID contains no info!",
        "comment": ""
    },
    "msg_startingDownloads": {
        "string": "Starting download of updates",
        "comment": ""
    },
    "msg_alreadyDownloadedNoVerify": {
        "string": "File \"{0}\" was already downloaded! Skipping it! Not verified!",
        "comment": "0: File name"
    },
    "msg_alreadyDownloadedVerify": {
        "string": "File \"{0}\" was already downloaded! Skipping it! SHA-1 Verified!",
        "comment": "0: File name"
    },
    "msg_startSingleDownload": {
        "string": "Starting download {0} of {1}",
        "comment": "0: Number of download, 1: Total number of downloads in queue"
    },
    "msg_verifySuccess": {
        "string": "Verification of \"{0}\" was successful!",
        "comment": "0: File name"
    },
    "msg_verifyFailure": {
        "string": "Verification of \"{0}\" has failed!\tDeleting file!",
        "comment": "0: File name"
    },
    "msg_noVerify": {
        "string": "File \"{0}\" was not verified!",
        "comment": "0: File name"
    },
    "msg_finishedDownload": {
        "string": "Finished downloading {0} files!",
        "comment": "0: Number of files downloaded"
    },
    "msg_notEnoughDiskSpace": {
        "string": "Not enough free disc space!",
        "comment": ""
    },
    "msg_spaceBelowThreshold": {
        "string": "Free disc space is below {0}",
        "comment": "0: Storage threshold"
    },
    "msg_relCheckError": {
        "string": "Couldn't check for new release!",
        "comment": ""
    },
    "msg_alreadyUpToDate": {
        "string": "Already on the newest release!",
        "comment": ""
    },
    "msg_foundNewRelease": {
        "string": "Found new Release \"{0}\"",
        "comment": "0: New programm version"
    },
    "msg_NoReleaseArchiveForPlatformOrArch": {
        "string": "Couldn't find a release archive for you architecture or platform. Platform: \"{0}\" Architecture: \"{1}\" Compiled: \"{2}\"",
        "comment": "0: Platform, 1: Architecture, 2: App is compiled(True|False)"
    },
    "msg_dldirNotWriteable": {
        "string": "Your select directory for downloads \"{0}\" is not writeable!",
        "comment": "0: Directory name"
    },
    "msg_checkProxySettings": {
        "string": "Please verify your proxy settings are correct!",
        "comment": ""
    },
    "msg_metaFileBrokenSyntax": {
        "string": "The requested meta file  for \"{0}\" contains broken syntax. This is most likely due to Sony prepairing to shutdown the update servers.",
        "comment": "0: TitleID"
    },
    "msg_sonyPS3StoreShutdownNotice": {
        "string": "!!! IMPORTANT !!! Sony has announced that they will be closing the PS3 store on 02.07.21 and later reversed that decision. It seems that some game updates got deleted in the time between the announcement and its reversal. I recommend you backup your downloaded game updates.",
        "comment": ""
    },
    "msg_newTitleDbVersion": {
        "string": "Downloaded new version of TitleDB",
        "comment": ""
    },
    "window_main_rpcs3import_btn": {
        "string": "Import from RPCS3",
        "comment": ""
    },
    "window_rpcs3import_label": {
        "string": "Please point to \"games.yml\" of your RPCS3 installation.",
        "comment": ""
    },
    "window_rpcs3import_ok_btn": {
        "string": "OK",
        "comment": ""
    },
    "window_rpcs3import_title": {
        "string": "Import from RPCS3",
        "comment": ""
    }
}

================================================
FILE: loc/es_ES.json
================================================
{
    "language_name": {
        "string": "Castellano",
        "comment": "Name of the language"
    },
    "language_short": {
        "string": "es_ES",
        "comment": "Name of the language file"
    },
    "window_main_title": {
        "string": "PS3 Game Update Downloader",
        "comment": "Main window title (don't translate)"
    },
    "window_main_titleid_label": {
        "string": "Introduce un TitleID",
        "comment": ""
    },
    "window_main_enter_btn": {
        "string": "Buscar",
        "comment": ""
    },
    "window_main_progress_label": {
        "string": "Descargando archivo {0}:\n{1}/{2}({3}%)\nVelocidad: {4}",
        "comment": "0: Number of download, 1: Amount of downloaded data, 2: Total file size, 3: Amount of downloaded data in %, 4: Download speed"
    },
    "window_main_config_btn": {
        "string": "Configuración",
        "comment": ""
    },
    "window_main_exit_btn": {
        "string": "Salir",
        "comment": ""
    },
    "window_main_queue_btn": {
        "string": "Cola",
        "comment": ""
    },
    "window_config_title": {
        "string": "Configuración",
        "comment": ""
    },
    "window_config_dldir_label": {
        "string": "Directorio de descargas:",
        "comment": ""
    },
    "window_config_verify_label": {
        "string": "Verificar archivos:",
        "comment": ""
    },
    "window_config_checkIfAlreadyDownloaded_label": {
        "string": "Comprobar si los archivos ya han sido descargados:",
        "comment": ""
    },
    "window_config_checkForNewRelease_label": {
        "string": "Buscar nuevas versiones del programa al iniciar:",
        "comment": ""
    },
    "window_config_storageThreshold_label": {
        "string": "Límite de almacenamiento (en GB):",
        "comment": ""
    },
    "window_config_currentLoc_label": {
        "string": "Idioma/Language:",
        "comment": ""
    },
    "window_config_renamepkgs_label": {
        "string": "Renombrar archivos PKG:",
        "comment": ""
    },
    "window_config_renamepkgs_tooltip": {
        "string": "Renombra los archivos PKGs a $NOMBRDEJUEGO_[$IDDEJUEGO]_$VERSIONDEJUEGO",
        "comment": ""
    },
    "window_config_updatetitledb_label": {
        "string": "Actualizar TitleDB al iniciar:",
        "comment": ""
    },
    "window_config_useproxy_label": {
        "string": "¿Utilizar un servidor proxy? (¡SOLO SOCKS5!)",
        "comment": ""
    },
    "window_config_proxyip_label": {
        "string": "IP del servidor proxy:",
        "comment": ""
    },
    "window_config_proxyport_label": {
        "string": "Puerto del servidor proxy:",
        "comment": ""
    },
    "window_config_proxyuser_laber": {
        "string": "Nombre de usuario del servidor proxy:",
        "comment": ""
    },
    "window_config_proxypass_label": {
        "string": "Contraseña del servidor proxy:",
        "comment": ""
    },
    "window_config_cancel_btn": {
        "string": "Cancelar",
        "comment": ""
    },
    "window_config_save_btn": {
        "string": "Guardar",
        "comment": ""
    },
    "window_select_title": {
        "string": "Selección de actualizaciones",
        "comment": ""
    },
    "window_select_text_label": {
        "string": "Juego: {0}\tTitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "window_select_table_ver": {
        "string": "Versión",
        "comment": ""
    },
    "window_select_table_size": {
        "string": "Tamaño del archivo",
        "comment": ""
    },
    "window_select_table_sysver": {
        "string": "Versión de firmware de PS3",
        "comment": ""
    },
    "window_select_download_btn": {
        "string": "Descargar",
        "comment": ""
    },
    "window_select_cancel_btn": {
        "string": "Cancelar",
        "comment": ""
    },
    "window_select_queue_btn": {
        "string": "Añadir a la cola de descargas",
        "comment": ""
    },
    "window_select_help_label": {
        "string": "Mantén pulsada la tecla Ctrl y haz clic en las actualizaciones que quieras seleccionar.",
        "comment": ""
    },
    "window_relNotify_title": {
        "string": "¡Nueva versión encontrada!",
        "comment": ""
    },
    "window_relNotify_version_label": {
        "string": "Versión actual: {0}\nVersión más reciente: {1}",
        "comment": "0: Current programm version, 1: New programm version"
    },
    "window_relNotify_changelog_label": {
        "string": "Historial de cambios:",
        "comment": ""
    },
    "window_relNotify_web_btn": {
        "string": "Abrir web en navegador",
        "comment": ""
    },
    "window_relNotify_dl_btn": {
        "string": "Descargar e instalar actualización",
        "comment": ""
    },
    "window_relNotify_close_btn": {
        "string": "Cerrar",
        "comment": ""
    },
    "window_queue_title": {
        "string": "Cola de descargas",
        "comment": ""
    },
    "window_queue_table_num": {
        "string": "N.º",
        "comment": ""
    },
    "window_queue_table_game": {
        "string": "Juego",
        "comment": ""
    },
    "window_queue_table_titleid": {
        "string": "TitleID",
        "comment": ""
    },
    "window_queue_table_ver": {
        "string": "Versión",
        "comment": ""
    },
    "window_queue_table_size": {
        "string": "Tamaño",
        "comment": ""
    },
    "window_queue_download_btn": {
        "string": "Iniciar descarga",
        "comment": ""
    },
    "window_queue_close_btn": {
        "string": "Cerrar",
        "comment": ""
    },
    "window_queue_moveup_btn": {
        "string": "Subir",
        "comment": ""
    },
    "window_queue_movedown_btn": {
        "string": "Bajar",
        "comment": ""
    },
    "window_queue_remove_btn": {
        "string": "Quitar",
        "comment": ""
    },
    "window_queue_totalsize_label": {
        "string": "Tamaño total: {0}",
        "comment": "0: Total download size of queue"
    },
    "window_queue_export_label": {
        "string": "Exportar cola a:",
        "comment": ""
    },
    "window_queue_export_btn": {
        "string": "Exportar",
        "comment": ""
    },
    "window_keyring_support_info_label": {
        "string": "No se han encontrado backends de keyrings viables.\nBusca una guía de instalación en la página web del keyring.\n{0}",
        "comment": "0: Url of keyring homepage"
    },
    "window_keyring_support_dont_show_again_label": {
        "string": "No volver a mostrar",
        "comment": ""
    },
    "window_keyring_support_ok_btn": {
        "string": "Aceptar",
        "comment": ""
    },
    "window_keyring_support_browser_btn": {
        "string": "Abrir en navegador",
        "comment": ""
    },
    "window_keyring_support_title": {
        "string": "¡Aviso! ¡El soporte de servidores proxy está desactivado!",
        "comment": ""
    },
	"window_msgBox_ok_btn": {
		"string": "Aceptar",
		"comment": ""
	},
	"window_msgBox_queueExported_title": {
		"string": "Cola exportada",
		"comment": ""
	},
	"window_msgBox_queueExported_label": {
		"string": "Cola exportada a «{0}».",
		"comment": "0: File name"
	},
    "msg_configFileLoaded": {
        "string": "¡Archivo de configuración cargado!",
        "comment": ""
    },
    "msg_noConfigFile": {
        "string": "¡No se ha encontrado un archivo de configuración! ¡Se utilizará la configuración predeterminada!",
        "comment": ""
    },
    "msg_configFileSaved": {
        "string": "¡Archivo de configuración guardado!",
        "comment": ""
    },
    "msg_loadedTitledb": {
        "string": "TitleDB cargado: «{0}»",
        "comment": "0: Path to TitleDB"
    },
    "msg_titleIDIs": {
        "string": "Juego: {0}\t TitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "msg_titleIDNotValid": {
        "string": "¡El TitleID no es válido!",
        "comment": ""
    },
    "msg_metaNotAvailable": {
        "string": "¡No está disponible el archivo de metadatos de este TitleID!",
        "comment": ""
    },
    "msg_metaFileEmpty": {
        "string": "¡El archivo de metadatos de este TitleID no contiene información!",
        "comment": ""
    },
    "msg_startingDownloads": {
        "string": "Iniciando descarga de actualizaciones",
        "comment": ""
    },
    "msg_alreadyDownloadedNoVerify": {
        "string": "¡El archivo «{0}» ya se ha descargado, omitiendo! ¡Archivo sin verificar!",
        "comment": "0: File name"
    },
    "msg_alreadyDownloadedVerify": {
        "string": "¡El archivo «{0}» ya se ha descargado, omitiendo! ¡SHA-1 verificado!",
        "comment": "0: File name"
    },
    "msg_startSingleDownload": {
        "string": "Iniciando descarga {0} de {1}",
        "comment": "0: Number of download, 1: Total number of downloads in queue"
    },
    "msg_verifySuccess": {
        "string": "¡La verificación de «{0}» ha tenido éxito!",
        "comment": "0: File name"
    },
    "msg_verifyFailure": {
        "string": "¡La verificación de «{0}» ha fallado!\t¡Eliminando el archivo!",
        "comment": "0: File name"
    },
    "msg_noVerify": {
        "string": "¡El archivo «{0}» no ha sido verificado!",
        "comment": "0: File name"
    },
    "msg_finishedDownload": {
        "string": "¡Se han terminado de descargar {0} archivos!",
        "comment": "0: Number of files downloaded"
    },
    "msg_notEnoughDiskSpace": {
        "string": "¡No queda espacio en el disco!",
        "comment": ""
    },
    "msg_spaceBelowThreshold": {
        "string": "El espacio en disco está por debajo de {0}",
        "comment": "0: Storage threshold"
    },
    "msg_relCheckError": {
        "string": "¡No se ha podido comprobar si hay versiones nuevas!",
        "comment": ""
    },
    "msg_alreadyUpToDate": {
        "string": "¡Ya tienes la última versión!",
        "comment": ""
    },
    "msg_foundNewRelease": {
        "string": "Se ha encontrado una versión nueva: «{0}»",
        "comment": "0: New programm version"
    },
    "msg_NoReleaseArchiveForPlatformOrArch": {
        "string": "No se ha podido encontrar un archivo de esta versión para tu arquitectura o plataforma. Platforma: «{0}» Arquitectura: «{1}» Compilación: «{2}»",
        "comment": "0: Platform, 1: Architecture, 2: App is compiled(True|False)"
    },
    "msg_dldirNotWriteable": {
        "string": "¡La carpeta de descargas «{0}» no tiene permisos de escritura!",
        "comment": "0: Directory name"
    },
    "msg_checkProxySettings": {
        "string": "¡Comprueba que tu configuración del servidor proxy sea correcta!",
        "comment": ""
    },
    "msg_metaFileBrokenSyntax": {
        "string": "El archivo de metadatos solicitado para «{0}» contiene una sintaxis errónea. Probablemente el motivo es que Sony se está preparando para desconectar los servidores de actualización.",
        "comment": "0: TitleID"
    },
    "msg_sonyPS3StoreShutdownNotice": {
        "string": "¡¡¡IMPORTANTE!!! Sony anunció el 07/02/21 que cerrarían la Store de PS3, pero más tarde cancelaron esa decisión. Parece ser que entre anuncios se eliminaron algunas actualizaciones de juegos. Recomiendo guardar una copia de seguridad de las actualizaciones descargadas.",
        "comment": ""
    },
    "msg_newTitleDbVersion": {
        "string": "Se ha descargado una nueva versión del TitleDB",
        "comment": ""
    }
}

================================================
FILE: loc/it.json
================================================
{
    "language_name": {
        "string": "Italiano",
        "comment": "Name of the language"
    },
    "language_short": {
        "string": "it",
        "comment": "Name of the language file"
    },
    "window_main_title": {
        "string": "PS3 Game Update Downloader",
        "comment": "Main window title (don't translate)"
    },
    "window_main_titleid_label": {
        "string": "Inserisci il TitleID",
        "comment": ""
    },
    "window_main_enter_btn": {
        "string": "Cerca",
        "comment": ""
    },
    "window_main_progress_label": {
        "string": "Download file {0}:\n{1}/{2}({3}%)\nVelocità: {4}",
        "comment": "0: Number of download, 1: Amount of downloaded data, 2: Total file size, 3: Amount of downloaded data in %, 4: Download speed"
    },
    "window_main_config_btn": {
        "string": "Configurazione",
        "comment": ""
    },
    "window_main_exit_btn": {
        "string": "Esci",
        "comment": ""
    },
    "window_main_queue_btn": {
        "string": "Coda",
        "comment": ""
    },
    "window_config_title": {
        "string": "Configurazione",
        "comment": ""
    },
    "window_config_dldir_label": {
        "string": "Cartella di download:",
        "comment": ""
    },
    "window_config_verify_label": {
        "string": "Verifica file:",
        "comment": ""
    },
    "window_config_checkIfAlreadyDownloaded_label": {
        "string": "Controlla se il file è già stato scaricato:",
        "comment": ""
    },
    "window_config_checkForNewRelease_label": {
        "string": "Cerca una nuova versione all'avvio:",
        "comment": ""
    },
    "window_config_currentLoc_label": {
        "string": "Lingua:",
        "comment": ""
    },
    "window_config_useproxy_label": {
        "string": "Utilizzare Proxy? (SOLO SOCKS5!)",
        "comment": ""
    },
    "window_config_proxyip_label": {
        "string": "IP Proxy:",
        "comment": ""
    },
    "window_config_proxyport_label": {
        "string": "Porta Proxy:",
        "comment": ""
    },
    "window_config_proxyuser_laber": {
        "string": "Utente Proxy:",
        "comment": ""
    },
    "window_config_proxypass_label": {
        "string": "Password Proxy",
        "comment": ""
    },
    "window_config_cancel_btn": {
        "string": "Annulla",
        "comment": ""
    },
    "window_config_save_btn": {
        "string": "Salva",
        "comment": ""
    },
    "window_select_title": {
        "string": "Seleziona Aggiornamenti",
        "comment": ""
    },
    "window_select_text_label": {
        "string": "Gioco: {0}\tTitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "window_select_table_ver": {
        "string": "Versione",
        "comment": ""
    },
    "window_select_table_size": {
        "string": "Dimensione file",
        "comment": ""
    },
    "window_select_table_sysver": {
        "string": "Versione FW PS3",
        "comment": ""
    },
    "window_select_download_btn": {
        "string": "Scarica",
        "comment": ""
    },
    "window_select_cancel_btn": {
        "string": "Annulla",
        "comment": ""
    },
    "window_select_queue_btn": {
        "string": "Aggiungi alla coda dei download",
        "comment": ""
    },
    "window_select_help_label": {
        "string": "Tieni premuto Ctrl e clicca gli aggiornamenti che vuoi selezionare.",
        "comment": ""
    },
    "window_relNotify_title": {
        "string": "Nuova versione trovata!",
        "comment": ""
    },
    "window_relNotify_version_label": {
        "string": "Versione in uso: {0}\nNuova versione: {1}",
        "comment": "0: Current programm version, 1: New programm version"
    },
    "window_relNotify_changelog_label": {
        "string": "Cambiamenti:",
        "comment": ""
    },
    "window_relNotify_web_btn": {
        "string": "Apri sito web nel browser",
        "comment": ""
    },
    "window_relNotify_dl_btn": {
        "string": "Scarica e installa aggiornamento",
        "comment": ""
    },
    "window_relNotify_close_btn": {
        "string": "Chiudi",
        "comment": ""
    },
    "window_queue_title": {
        "string": "Coda download",
        "comment": ""
    },
    "window_queue_table_num": {
        "string": "Num",
        "comment": ""
    },
    "window_queue_table_game": {
        "string": "Gioco",
        "comment": ""
    },
    "window_queue_table_titleid": {
        "string": "TitleID",
        "comment": ""
    },
    "window_queue_table_ver": {
        "string": "Versione",
        "comment": ""
    },
    "window_queue_table_size": {
        "string": "Dimensione file",
        "comment": ""
    },
    "window_queue_download_btn": {
        "string": "Avvia Download",
        "comment": ""
    },
    "window_queue_close_btn": {
        "string": "Chiudi",
        "comment": ""
    },
    "window_queue_moveup_btn": {
        "string": "Sposta in Alto",
        "comment": ""
    },
    "window_queue_movedown_btn": {
        "string": "Sposta in Basso",
        "comment": ""
    },
    "window_queue_remove_btn": {
        "string": "Rimuovi",
        "comment": ""
    },
    "window_queue_totalsize_label": {
        "string": "Dimensioni Totali: {0}",
        "comment": "0: Total download size of queue"
    },
    "msg_configFileLoaded": {
        "string": "File di configurazione caricato!",
        "comment": ""
    },
    "msg_noConfigFile": {
        "string": "Nessun file di configurazione trovato! Verranno utilizzati i valori predefiniti!",
        "comment": ""
    },
    "msg_configFileSaved": {
        "string": "File di configurazione salvato!",
        "comment": ""
    },
    "msg_loadedTitledb": {
        "string": "Caricato TitleDB \"{0}\"",
        "comment": "0: Path to TitleDB"
    },
    "msg_titleIDIs": {
        "string": "Il gioco è: {0}\t TitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "msg_titleIDNotValid": {
        "string": "Il TitleID non è valido!",
        "comment": ""
    },
    "msg_metaNotAvailable": {
        "string": "Il file meta per questo TitleID non è disponibile!",
        "comment": ""
    },
    "msg_metaFileEmpty": {
        "string": "Il file meta per questo TitleID non contiene informazioni!",
        "comment": ""
    },
    "msg_startingDownloads": {
        "string": "Avvio del download degli aggiornamenti",
        "comment": ""
    },
    "msg_alreadyDownloadedNoVerify": {
        "string": "Il file \"{0}\" è già stato scaricato! Lo salto! Non verificato!",
        "comment": "0: File name"
    },
    "msg_alreadyDownloadedVerify": {
        "string": "Il file \"{0}\" è già stato scaricato! Lo salto! SHA-1 Verificato!",
        "comment": "0: File name"
    },
    "msg_startSingleDownload": {
        "string": "Avvio del download {0} di {1}",
        "comment": "0: Number of download, 1: Total number of downloads in queue"
    },
    "msg_verifySuccess": {
        "string": "Verifica di \"{0}\" completata con successo!",
        "comment": "0: File name"
    },
    "msg_verifyFailure": {
        "string": "Verifica di \"{0}\" fallita!\tElimino il file!",
        "comment": "0: File name"
    },
    "msg_noVerify": {
        "string": "Il file \"{0}\" non è stato verificato!",
        "comment": "0: File name"
    },
    "msg_finishedDownload": {
        "string": "Download di {0} file completato!",
        "comment": "0: Number of files downloaded"
    },
    "msg_notEnoughDiskSpace": {
        "string": "Spazio su disco insufficiente!",
        "comment": ""
    },
    "msg_spaceBelowThreshold": {
        "string": "Lo spazio su disco disponibile è inferiore al {0}",
        "comment": "0: Storage threshold"
    },
    "msg_relCheckError": {
        "string": "Non è stato possibile cercare una nuova versione!",
        "comment": ""
    },
    "msg_alreadyUpToDate": {
        "string": "Stai già utilizzando l'ultima versione!",
        "comment": ""
    },
    "msg_foundNewRelease": {
        "string": "Nuova Versione Trovata \"{0}\"",
        "comment": "0: New programm version"
    },
    "msg_NoReleaseArchiveForPlatformOrArch": {
        "string": "Non è stato possibile trovare una versione compatibile con la tua architettura o piattaforma. Piattaforma: \"{0}\" Architettura: \"{1}\" Compilato: \"{2}\"",
        "comment": "0: Platform, 1: Architecture, 2: App is compiled(True|False)"
    },
    "msg_dldirNotWriteable": {
        "string": "La cartella di download selezionata \"{0}\" non è scrivibile!",
        "comment": "0: Directory name"
    },
    "msg_checkProxySettings": {
        "string": "Per favore controlla che le impostazioni del proxy siano corrette!",
        "comment": ""
    }
}

================================================
FILE: loc/ru.json
================================================
{
    "language_name": {
        "string": "Русский",
        "comment": "Name of the language"
    },
    "language_short": {
        "string": "ru",
        "comment": "Name of the language file"
    },
    "window_main_title": {
        "string": "PS3 Game Update Downloader",
        "comment": "Main window title (don't translate)"
    },
    "window_main_titleid_label": {
        "string": "Введите TitleID",
        "comment": ""
    },
    "window_main_enter_btn": {
        "string": "Найти",
        "comment": ""
    },
    "window_main_progress_label": {
        "string": "Загрузка файла {0}:\n{1}/{2}({3}%)\nСкорость: {4}",
        "comment": "0: Number of download, 1: Amount of downloaded data, 2: Total file size, 3: Amount of downloaded data in %, 4: Download speed"
    },
    "window_main_config_btn": {
        "string": "Настройки",
        "comment": ""
    },
    "window_main_exit_btn": {
        "string": "Выход",
        "comment": ""
    },
    "window_main_queue_btn": {
        "string": "Очередь загрузок",
        "comment": ""
    },
    "window_config_title": {
        "string": "Настройки",
        "comment": ""
    },
    "window_config_dldir_label": {
        "string": "Папка загрузок:",
        "comment": ""
    },
    "window_config_verify_label": {
        "string": "Проверять целостность файлов:",
        "comment": ""
    },
    "window_config_checkIfAlreadyDownloaded_label": {
        "string": "Проверять, был ли файл уже загружен:",
        "comment": ""
    },
    "window_config_checkForNewRelease_label": {
        "string": "Проверять обновления при запуске:",
        "comment": ""
    },
    "window_config_currentLoc_label": {
        "string": "Язык:",
        "comment": ""
    },
    "window_config_useproxy_label": {
        "string": "Использовать прокси? (ТОЛЬКО SOCKS5!)",
        "comment": ""
    },
    "window_config_proxyip_label": {
        "string": "IP прокси:",
        "comment": ""
    },
    "window_config_proxyport_label": {
        "string": "Порт прокси:",
        "comment": ""
    },
    "window_config_proxyuser_laber": {
        "string": "Пользователь прокси:",
        "comment": ""
    },
    "window_config_proxypass_label": {
        "string": "Пароль прокси",
        "comment": ""
    },
    "window_config_cancel_btn": {
        "string": "Отмена",
        "comment": ""
    },
    "window_config_save_btn": {
        "string": "Сохранить",
        "comment": ""
    },
    "window_select_title": {
        "string": "Выбор обновлений",
        "comment": ""
    },
    "window_select_text_label": {
        "string": "Игра: {0}\tTitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "window_select_table_ver": {
        "string": "Версия",
        "comment": ""
    },
    "window_select_table_size": {
        "string": "Размер файла",
        "comment": ""
    },
    "window_select_table_sysver": {
        "string": "Версия PS3 FW",
        "comment": ""
    },
    "window_select_download_btn": {
        "string": "Загрузить",
        "comment": ""
    },
    "window_select_cancel_btn": {
        "string": "Отмена",
        "comment": ""
    },
    "window_select_queue_btn": {
        "string": "Добавить в очередь загрузок",
        "comment": ""
    },
    "window_select_help_label": {
        "string": "Удерживайте Ctrl и кликайте на обновления, которые хотите выбрать.",
        "comment": ""
    },
    "window_relNotify_title": {
        "string": "Доступно обновление!",
        "comment": ""
    },
    "window_relNotify_version_label": {
        "string": "Текущая версия: {0}\nНовая версия: {1}",
        "comment": "0: Current programm version, 1: New programm version"
    },
    "window_relNotify_changelog_label": {
        "string": "Изменения:",
        "comment": ""
    },
    "window_relNotify_web_btn": {
        "string": "Открыть сайт в браузере",
        "comment": ""
    },
    "window_relNotify_dl_btn": {
        "string": "Загрузить и установить обновление",
        "comment": ""
    },
    "window_relNotify_close_btn": {
        "string": "Закрыть",
        "comment": ""
    },
    "window_queue_title": {
        "string": "Очередь загрузок",
        "comment": ""
    },
    "window_queue_table_num": {
        "string": "№",
        "comment": ""
    },
    "window_queue_table_game": {
        "string": "Игра",
        "comment": ""
    },
    "window_queue_table_titleid": {
        "string": "TitleID",
        "comment": ""
    },
    "window_queue_table_ver": {
        "string": "Версия",
        "comment": ""
    },
    "window_queue_table_size": {
        "string": "Размер файла",
        "comment": ""
    },
    "window_queue_download_btn": {
        "string": "Начать загрузку",
        "comment": ""
    },
    "window_queue_close_btn": {
        "string": "Закрыть",
        "comment": ""
    },
    "window_queue_moveup_btn": {
        "string": "Выше",
        "comment": ""
    },
    "window_queue_movedown_btn": {
        "string": "Ниже",
        "comment": ""
    },
    "window_queue_remove_btn": {
        "string": "Удалить",
        "comment": ""
    },
    "window_queue_totalsize_label": {
        "string": "Общий размер: {0}",
        "comment": "0: Total download size of queue"
    },
    "msg_configFileLoaded": {
        "string": "Конфигурация загружена из файла!",
        "comment": ""
    },
    "msg_noConfigFile": {
        "string": "Файл конфигурации не найден! Используются настройки по умолчанию!",
        "comment": ""
    },
    "msg_configFileSaved": {
        "string": "Файл конфигурации сохранен!",
        "comment": ""
    },
    "msg_loadedTitledb": {
        "string": "Загружен TitleDB \"{0}\"",
        "comment": "0: Path to TitleDB"
    },
    "msg_titleIDIs": {
        "string": "Игра: {0}\t TitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "msg_titleIDNotValid": {
        "string": "Неверный TitleID!",
        "comment": ""
    },
    "msg_metaNotAvailable": {
        "string": "Недоступен мета-файл для данного TitleID!",
        "comment": ""
    },
    "msg_metaFileEmpty": {
        "string": "Мета-файл для данного TitleID пустой!",
        "comment": ""
    },
    "msg_startingDownloads": {
        "string": "Начало загрузки",
        "comment": ""
    },
    "msg_alreadyDownloadedNoVerify": {
        "string": "Файл \"{0}\" был загружен ранее и будет пропущен! Целостность не подтрерждена!",
        "comment": "0: File name"
    },
    "msg_alreadyDownloadedVerify": {
        "string": "Файл \"{0}\" был загружен ранее и будет пропущен! Хеш SHA-1 подтрержден!",
        "comment": "0: File name"
    },
    "msg_startSingleDownload": {
        "string": "Начало загрузки {0} из {1}",
        "comment": "0: Number of download, 1: Total number of downloads in queue"
    },
    "msg_verifySuccess": {
        "string": "Целостность файла \"{0}\" подтверждена!",
        "comment": "0: File name"
    },
    "msg_verifyFailure": {
        "string": "Целостность файла \"{0}\" не подтверждена!\tФайл будет удален!",
        "comment": "0: File name"
    },
    "msg_noVerify": {
        "string": "Целостность файла \"{0}\" не подтверждена!",
        "comment": "0: File name"
    },
    "msg_finishedDownload": {
        "string": "Завершена загрузка {0} файлов!",
        "comment": "0: Number of files downloaded"
    },
    "msg_notEnoughDiskSpace": {
        "string": "Недостаточно места на диске!",
        "comment": ""
    },
    "msg_spaceBelowThreshold": {
        "string": "На диске менее {0} свободного места",
        "comment": "0: Storage threshold"
    },
    "msg_relCheckError": {
        "string": "Не удалось проверить обновления!",
        "comment": ""
    },
    "msg_alreadyUpToDate": {
        "string": "Используется последняя версия!",
        "comment": ""
    },
    "msg_foundNewRelease": {
        "string": "Найдена новая версия \"{0}\"",
        "comment": "0: New programm version"
    },
    "msg_NoReleaseArchiveForPlatformOrArch": {
        "string": "Не удалось найти версию для вашей архитектуры или платформы. Платформа: \"{0}\" Архитектура: \"{1}\" Скомпилированный код: \"{2}\"",
        "comment": "0: Platform, 1: Architecture, 2: App is compiled(True|False)"
    },
    "msg_dldirNotWriteable": {
        "string": "Нет доступа для записи файлов в выбранную папку загрузок \"{0}\"",
        "comment": "0: Directory name"
    },
    "msg_checkProxySettings": {
        "string": "Убедитесь, что настройки прокси введены правльно!",
        "comment": ""
    }
}

================================================
FILE: loc/th.json
================================================
{
    "language_name": {
        "string": "ภาษาไทย",
        "comment": "Name of the language"
    },
    "language_short": {
        "string": "th",
        "comment": "Name of the language file"
    },
    "window_main_title": {
        "string": "ระบบดาวน์โหลดอัปเดตเกม PS3",
        "comment": "Main window title (don't translate)"
    },
    "window_main_titleid_label": {
        "string": "กรุณาใส่รหัส TitleID",
        "comment": ""
    },
    "window_main_enter_btn": {
        "string": "ค้นหา",
        "comment": ""
    },
    "window_main_progress_label": {
        "string": "กำลังโหลดไฟล์ {0}:\n{1}/{2}({3}%)\nความเร็วในการดาวน์โหลด: {4}",
        "comment": "0: Number of download, 1: Amount of downloaded data, 2: Total file size, 3: Amount of downloaded data in %, 4: Download speed"
    },
    "window_main_config_btn": {
        "string": "การกำหนดค่า",
        "comment": ""
    },
    "window_main_exit_btn": {
        "string": "ออก",
        "comment": ""
    },
    "window_main_queue_btn": {
        "string": "คิว",
        "comment": ""
    },
    "window_config_title": {
        "string": "การกำหนดค่า",
        "comment": ""
    },
    "window_config_dldir_label": {
        "string": "ตำแหน่งการดาวน์โหลด:",
        "comment": ""
    },
    "window_config_verify_label": {
        "string": "ยืนยันไฟล์:",
        "comment": ""
    },
    "window_config_checkIfAlreadyDownloaded_label": {
        "string": "ตรวจสอบไฟล์ที่ถูกดาวน์โหลดแล้ว:",
        "comment": ""
    },
    "window_config_checkForNewRelease_label": {
        "string": "ตรวบจสอบเนื้อหาใหม่ขณะกำลังเริ่มต้น:",
        "comment": ""
    },
    "window_config_currentLoc_label": {
        "string": "ภาษา:",
        "comment": ""
    },
    "window_config_useproxy_label": {
        "string": "ใช้งานพร็อกซี่เซิฟเวอร์ใหม่ไม่? (สำหรับ SOCKS5 เท่านั้น!)",
        "comment": ""
    },
    "window_config_proxyip_label": {
        "string": "พร็อกซี่ IP:",
        "comment": ""
    },
    "window_config_proxyport_label": {
        "string": "พร็อกซี่ Port:",
        "comment": ""
    },
    "window_config_proxyuser_laber": {
        "string": "พร็อกซี่ชื่อผู้ใช้:",
        "comment": ""
    },
    "window_config_proxypass_label": {
        "string": "พร็อกซี่รหัสผ่าน",
        "comment": ""
    },
    "window_config_cancel_btn": {
        "string": "ยกเลิก",
        "comment": ""
    },
    "window_config_save_btn": {
        "string": "บันทึก",
        "comment": ""
    },
    "window_select_title": {
        "string": "เลือกการอัปเดต",
        "comment": ""
    },
    "window_select_text_label": {
        "string": "เกม: {0}\tรหัสเกม: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "window_select_table_ver": {
        "string": "เวอร์ชั่น",
        "comment": ""
    },
    "window_select_table_size": {
        "string": "ขนาดไฟล์",
        "comment": ""
    },
    "window_select_table_sysver": {
        "string": "PS3 เวอร์ชั่นเฟิร์มแวร์",
        "comment": ""
    },
    "window_select_download_btn": {
        "string": "ดาวน์โหลด",
        "comment": ""
    },
    "window_select_cancel_btn": {
        "string": "ยกเลิก",
        "comment": ""
    },
    "window_select_queue_btn": {
        "string": "เพิ่มเข้าคิวดาวน์โหลด",
        "comment": ""
    },
    "window_select_help_label": {
        "string": "กดปุ่ม Ctrl ค้างและคลิกการอัปเดตที่คุณต้องการเลือก",
        "comment": ""
    },
    "window_relNotify_title": {
        "string": "พบเนื้อหาใหม่!",
        "comment": ""
    },
    "window_relNotify_version_label": {
        "string": "เวอร์ชั่นปัจจุบัน: {0}\nเวอร์ชั่นใหม่: {1}",
        "comment": "0: Current programm version, 1: New programm version"
    },
    "window_relNotify_changelog_label": {
        "string": "การเปลี่ยนแปลง:",
        "comment": ""
    },
    "window_relNotify_web_btn": {
        "string": "เปิดในเว็บเบราว์เซอร์",
        "comment": ""
    },
    "window_relNotify_dl_btn": {
        "string": "ดาวน์โหลดและติดตั้งอัปเดต",
        "comment": ""
    },
    "window_relNotify_close_btn": {
        "string": "ปิด",
        "comment": ""
    },
    "window_queue_title": {
        "string": "คิดการดาวน์โหลด",
        "comment": ""
    },
    "window_queue_table_num": {
        "string": "เลขที่",
        "comment": ""
    },
    "window_queue_table_game": {
        "string": "เกม",
        "comment": ""
    },
    "window_queue_table_titleid": {
        "string": "รหัสเกม",
        "comment": ""
    },
    "window_queue_table_ver": {
        "string": "เวอร์ชั่น",
        "comment": ""
    },
    "window_queue_table_size": {
        "string": "ขนาดไฟล์",
        "comment": ""
    },
    "window_queue_download_btn": {
        "string": "เริ่มดาวน์โหลด",
        "comment": ""
    },
    "window_queue_close_btn": {
        "string": "ปิด",
        "comment": ""
    },
    "window_queue_moveup_btn": {
        "string": "ย้ายขั้น",
        "comment": ""
    },
    "window_queue_movedown_btn": {
        "string": "ย้ายลง",
        "comment": ""
    },
    "window_queue_remove_btn": {
        "string": "ลบ",
        "comment": ""
    },
    "window_queue_totalsize_label": {
        "string": "ขนาดไฟล์: {0}",
        "comment": "0: Total download size of queue"
    },
    "msg_configFileLoaded": {
        "string": "โหลดไฟล์การกำหนดค่าเรียบร้อยแล้ว!",
        "comment": ""
    },
    "msg_noConfigFile": {
        "string": "ไม่พบไฟล์การกำหนดค่าใช้การตั้งค่าเดิม!",
        "comment": ""
    },
    "msg_configFileSaved": {
        "string": "บันทึกการกำหนดค่าแล้วร้อยแล้ว",
        "comment": ""
    },
    "msg_loadedTitledb": {
        "string": "โหลดรหัสเกม \"{0}\"",
        "comment": "0: Path to TitleDB"
    },
    "msg_titleIDIs": {
        "string": "เกม: {0}\t รหัสเกม: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "msg_titleIDNotValid": {
        "string": "รหัสเกมไม่ถูกต้องd!",
        "comment": ""
    },
    "msg_metaNotAvailable": {
        "string": "ไม่พบไฟล์ Meta สำหรับรหัสเกมนี้!",
        "comment": ""
    },
    "msg_metaFileEmpty": {
        "string": "ไม่พบข้อมูลที่อยู่ในไฟล์ Meta สำหรับรหัสเกมนี้!",
        "comment": ""
    },
    "msg_startingDownloads": {
        "string": "เริ่มดาวน์โหลดอัปเดต",
        "comment": ""
    },
    "msg_alreadyDownloadedNoVerify": {
        "string": "ไฟล์ \"{0}\" ถูกดาวน์โหลดแล้วกำลังทำการข้าม! ไฟล์ไม่ถูกยืนยัน!",
        "comment": "0: File name"
    },
    "msg_alreadyDownloadedVerify": {
        "string": "ไฟล์ \"{0}\" ถูกดาวน์โหลดแล้วกำลังทำการข้าม! ยืนยันโดยการเข้ารหัส SHA-1!",
        "comment": "0: File name"
    },
    "msg_startSingleDownload": {
        "string": "เริ่มการดาวน์โหลดแล้ว {0} จาก {1}",
        "comment": "0: Number of download, 1: Total number of downloads in queue"
    },
    "msg_verifySuccess": {
        "string": "การยืนยันสำหรับ \"{0}\" เสร็จสิ้นแล้ว!",
        "comment": "0: File name"
    },
    "msg_verifyFailure": {
        "string": "การยืนยันสำหรับ \"{0}\" ล้มเหลว!\tกำลังลบไฟล์!",
        "comment": "0: File name"
    },
    "msg_noVerify": {
        "string": "ไฟล์ \"{0}\" ไม่ได้รับการยืนยัน!",
        "comment": "0: File name"
    },
    "msg_finishedDownload": {
        "string": "กำลังเสร็จสิ้นการดาวน์โหลด {0} ไฟล์!",
        "comment": "0: Number of files downloaded"
    },
    "msg_notEnoughDiskSpace": {
        "string": "พื้นที่ไม่เพียงพอ!",
        "comment": ""
    },
    "msg_spaceBelowThreshold": {
        "string": "ขนาดที่ว่างมีน้อยกว่า {0}",
        "comment": "0: Storage threshold"
    },
    "msg_relCheckError": {
        "string": "ไม่สามารถตรวจสอบเนื้อหาใหม่ได้!",
        "comment": ""
    },
    "msg_alreadyUpToDate": {
        "string": "เป็นเนื้อหาล่าสุดอยู่แล้ว!",
        "comment": ""
    },
    "msg_foundNewRelease": {
        "string": "พบเนื้อหาใหม่ \"{0}\"",
        "comment": "0: New programm version"
    },
    "msg_NoReleaseArchiveForPlatformOrArch": {
        "string": "ไม่สามารถค้นหาเนื้อใหม่สำหรับสถาปัตยกรรมหรือแพลตฟอร์มปัจจุบันของคุณได้. แพลตฟอร์ม(Platform): \"{0}\" สถาปัตยกรรม(Architecture): \"{1}\" การประมวลผล(Compile): \"{2}\"",
        "comment": "0: Platform, 1: Architecture, 2: App is compiled(True|False)"
    },
    "msg_dldirNotWriteable": {
        "string": "เส้นการดาวน์โหลดที่คุณได้เลือกไว้ไม่สามารถเขียนข้อมูลได้! \"{0}\"",
        "comment": "0: Directory name"
    },
    "msg_checkProxySettings": {
        "string": "กรุณาตรวจสอบความถูกต้องของการตั้งค่าพร็อกซี่เซิฟเวอร์!",
        "comment": ""
    }
}

================================================
FILE: loc/tr.json
================================================
{
    "language_name": {
        "string": "Türkçe",
        "comment": "Name of the language"
    },
    "language_short": {
        "string": "tr",
        "comment": "Name of the language file"
    },
    "window_main_title": {
        "string": "PS3 Game Update Downloader",
        "comment": "Main window title (don't translate)"
    },
    "window_main_titleid_label": {
        "string": "TitleID Gir",
        "comment": ""
    },
    "window_main_enter_btn": {
        "string": "Ara",
        "comment": ""
    },
    "window_main_progress_label": {
        "string": "Dosya indiriliyor {0}:\n{1}/{2}({3}%)\nHız: {4}",
        "comment": "0: Number of download, 1: Amount of downloaded data, 2: Total file size, 3: Amount of downloaded data in %, 4: Download speed"
    },
    "window_main_config_btn": {
        "string": "Ayarlar",
        "comment": ""
    },
    "window_main_exit_btn": {
        "string": "Kapat",
        "comment": ""
    },
    "window_main_queue_btn": {
        "string": "Sıra",
        "comment": ""
    },
    "window_config_title": {
        "string": "Ayarlar",
        "comment": ""
    },
    "window_config_dldir_label": {
        "string": "İndirilenler klasörü:",
        "comment": ""
    },
    "window_config_verify_label": {
        "string": "Dosyaları doğrula:",
        "comment": ""
    },
    "window_config_checkIfAlreadyDownloaded_label": {
        "string": "Dosyanın zaten indirilip indirilmediğini kontrol et:",
        "comment": ""
    },
    "window_config_checkForNewRelease_label": {
        "string": "Başlangıçta yeni sürüm olup olmadığını kontrol et:",
        "comment": ""
    },
    "window_config_currentLoc_label": {
        "string": "Dil:",
        "comment": ""
    },
    "window_config_useproxy_label": {
        "string": "Proxy kullan? (SADECE SOCKS5!)",
        "comment": ""
    },
    "window_config_proxyip_label": {
        "string": "Proxy IP:",
        "comment": ""
    },
    "window_config_proxyport_label": {
        "string": "Proxy Port:",
        "comment": ""
    },
    "window_config_proxyuser_laber": {
        "string": "Proxy Kullanıcısı:",
        "comment": ""
    },
    "window_config_proxypass_label": {
        "string": "Proxy Parolası",
        "comment": ""
    },
    "window_config_cancel_btn": {
        "string": "İptal",
        "comment": ""
    },
    "window_config_save_btn": {
        "string": "Kaydet",
        "comment": ""
    },
    "window_select_title": {
        "string": "Güncellemeleri seç",
        "comment": ""
    },
    "window_select_text_label": {
        "string": "Oyun: {0}\tTitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "window_select_table_ver": {
        "string": "Versiyon",
        "comment": ""
    },
    "window_select_table_size": {
        "string": "Dosya boyutu",
        "comment": ""
    },
    "window_select_table_sysver": {
        "string": "PS3 FW Versiyon",
        "comment": ""
    },
    "window_select_download_btn": {
        "string": "İndir",
        "comment": ""
    },
    "window_select_cancel_btn": {
        "string": "İptal",
        "comment": ""
    },
    "window_select_queue_btn": {
        "string": "İndirme sırasına ekle",
        "comment": ""
    },
    "window_select_help_label": {
        "string": "CTRL'ye basılı tutarak istediğin güncellemeleri seç.",
        "comment": ""
    },
    "window_relNotify_title": {
        "string": "Yeni sürüm bulundu!",
        "comment": ""
    },
    "window_relNotify_version_label": {
        "string": "Şu anki sürüm: {0}\nYeni sürüm: {1}",
        "comment": "0: Current programm version, 1: New programm version"
    },
    "window_relNotify_changelog_label": {
        "string": "Değişiklikler:",
        "comment": ""
    },
    "window_relNotify_web_btn": {
        "string": "Siteyi tarayıcı da aç",
        "comment": ""
    },
    "window_relNotify_dl_btn": {
        "string": "Güncellemeyi indir ve yükle",
        "comment": ""
    },
    "window_relNotify_close_btn": {
        "string": "Kapat",
        "comment": ""
    },
    "window_queue_title": {
        "string": "İndirme sırası",
        "comment": ""
    },
    "window_queue_table_num": {
        "string": "Sıra",
        "comment": ""
    },
    "window_queue_table_game": {
        "string": "Oyun",
        "comment": ""
    },
    "window_queue_table_titleid": {
        "string": "TitleID",
        "comment": ""
    },
    "window_queue_table_ver": {
        "string": "Versiyon",
        "comment": ""
    },
    "window_queue_table_size": {
        "string": "Dosya boyutu",
        "comment": ""
    },
    "window_queue_download_btn": {
        "string": "İndirmeyi başlat",
        "comment": ""
    },
    "window_queue_close_btn": {
        "string": "Kapat",
        "comment": ""
    },
    "window_queue_moveup_btn": {
        "string": "Yukarı çıkar",
        "comment": ""
    },
    "window_queue_movedown_btn": {
        "string": "Aşağı indir",
        "comment": ""
    },
    "window_queue_remove_btn": {
        "string": "Kaldır",
        "comment": ""
    },
    "window_queue_totalsize_label": {
        "string": "Toplam Boyut: {0}",
        "comment": "0: Total download size of queue"
    },
    "window_keyring_support_info_label": {
        "string": "Geçerli backend keyring'i bulunamadı.\nLütfen, ilgili yükleme rehberi için keyring'in anasayfasını ziyaret edin.\n{0}",
        "comment": "0: Url of keyring homepage"
    },
    "window_keyring_support_dont_show_again_label": {
        "string": "Tekrar gösterme",
        "comment": ""
    },
    "window_keyring_support_ok_btn": {
        "string": "Tamam",
        "comment": ""
    },
    "window_keyring_support_browser_btn": {
        "string": "Tarayıcıda aç",
        "comment": ""
    },
    "window_keyring_support_title": {
        "string": "Dikkat! Proxy desteği kapatıldı!",
        "comment": ""
    },
    "msg_configFileLoaded": {
        "string": "Ayar dosyası indirildi!",
        "comment": ""
    },
    "msg_noConfigFile": {
        "string": "Ayar dosyası bulunamadı! Varsayılan ayarlar kullanılıyor!",
        "comment": ""
    },
    "msg_configFileSaved": {
        "string": "Ayarlar kaydedildi!",
        "comment": ""
    },
    "msg_loadedTitledb": {
        "string": "TitleDB \"{0}\" yüklendi.",
        "comment": "0: Path to TitleDB"
    },
    "msg_titleIDIs": {
        "string": "Oyun: {0}\t TitleID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "msg_titleIDNotValid": {
        "string": "TitleID geçersiz!",
        "comment": ""
    },
    "msg_metaNotAvailable": {
        "string": "Bu TitleID için meta dosyası mevcut değil!",
        "comment": ""
    },
    "msg_metaFileEmpty": {
        "string": "Bu TitleID için meta dosyası hiçbir veri bulundurmuyor!",
        "comment": ""
    },
    "msg_startingDownloads": {
        "string": "Güncelleme indirmeleri başlıyor",
        "comment": ""
    },
    "msg_alreadyDownloadedNoVerify": {
        "string": "Dosya \"{0}\" zaten indirilmişti! Geçiliyor! Doğrulanmadı!",
        "comment": "0: File name"
    },
    "msg_alreadyDownloadedVerify": {
        "string": "Dosya \"{0}\" zaten indirilmişti! Geçiliyor! SHA-1 doğrulandı!",
        "comment": "0: File name"
    },
    "msg_startSingleDownload": {
        "string": "İndirme başlatılıyor {0}/{1}",
        "comment": "0: Number of download, 1: Total number of downloads in queue"
    },
    "msg_verifySuccess": {
        "string": "\"{0}\" doğrulaması başarılı!",
        "comment": "0: File name"
    },
    "msg_verifyFailure": {
        "string": "\"{0}\" doğrulaması başarısız!\tDosya siliniyor!",
        "comment": "0: File name"
    },
    "msg_noVerify": {
        "string": "\"{0}\" doğrulanamadı!",
        "comment": "0: File name"
    },
    "msg_finishedDownload": {
        "string": "{0} dosyalar indirildi!",
        "comment": "0: Number of files downloaded"
    },
    "msg_notEnoughDiskSpace": {
        "string": "Yetersiz depo alanı!",
        "comment": ""
    },
    "msg_spaceBelowThreshold": {
        "string": "Depo alanı {0} altında",
        "comment": "0: Storage threshold"
    },
    "msg_relCheckError": {
        "string": "Yeni sürüm kontrol edilemedi!",
        "comment": ""
    },
    "msg_alreadyUpToDate": {
        "string": "Zaten en yeni sürüm bu!",
        "comment": ""
    },
    "msg_foundNewRelease": {
        "string": "Yeni sürüm bulundu \"{0}\"",
        "comment": "0: New programm version"
    },
    "msg_NoReleaseArchiveForPlatformOrArch": {
        "string": "Bu mimari veya platform için uygun bir arşiv sürümü bulunamadı. Platform: \"{0}\" Mimari: \"{1}\" Derleme: \"{2}\"",
        "comment": "0: Platform, 1: Architecture, 2: App is compiled(True|False)"
    },
    "msg_dldirNotWriteable": {
        "string": "\"{0}\" indirmeleri için seçilen klasör yazılabilir değil!",
        "comment": "0: Directory name"
    },
    "msg_checkProxySettings": {
        "string": "Lütfen, Proxy ayarlarının doğruluğunu kontrol et!",
        "comment": ""
    }
}

================================================
FILE: loc/zh_CN.json
================================================
{
    "language_name": {
        "string": "简体中文",
        "comment": "Name of the language"
    },
    "language_short": {
        "string": "zh_CN",
        "comment": "Name of the language file"
    },
    "window_main_title": {
        "string": "PS3 Game Update Downloader",
        "comment": "Main window title (don't translate)"
    },
    "window_main_titleid_label": {
        "string": "输入内容 ID",
        "comment": ""
    },
    "window_main_enter_btn": {
        "string": "搜索",
        "comment": ""
    },
    "window_main_progress_label": {
        "string": "下载文件 {0}:\n{1}/{2}({3}%)\n速度: {4}",
        "comment": "0: Number of download, 1: Amount of downloaded data, 2: Total file size, 3: Amount of downloaded data in %, 4: Download speed"
    },
    "window_main_config_btn": {
        "string": "配置",
        "comment": ""
    },
    "window_main_exit_btn": {
        "string": "退出",
        "comment": ""
    },
    "window_main_queue_btn": {
        "string": "队列",
        "comment": ""
    },
    "window_config_title": {
        "string": "配置",
        "comment": ""
    },
    "window_config_dldir_label": {
        "string": "下载目录:",
        "comment": ""
    },
    "window_config_verify_label": {
        "string": "验证文件:",
        "comment": ""
    },
    "window_config_checkIfAlreadyDownloaded_label": {
        "string": "检查文件是否已经下载:",
        "comment": ""
    },
    "window_config_checkForNewRelease_label": {
        "string": "启动时检查新版本:",
        "comment": ""
    },
    "window_config_storageThreshold_label": {
        "string": "存储阈值 (GiB):",
        "comment": ""
    },
    "window_config_currentLoc_label": {
        "string": "语言:",
        "comment": ""
    },
    "window_config_renamepkgs_label": {
        "string": "重命名 .pkg 文件:",
        "comment": ""
    },
    "window_config_renamepkgs_tooltip": {
        "string": "将该 .pkg 文件重命名为 $GAMENAME_[$GAMEID]_$GAMEVERSION",
        "comment": ""
    },
    "window_config_updatetitledb_label": {
        "string": "启动时更新内容数据:",
        "comment": ""
    },
    "window_config_useproxy_label": {
        "string": "使用代理?(只支持 SOCKS5!)",
        "comment": ""
    },
    "window_config_proxyip_label": {
        "string": "代理 IP:",
        "comment": ""
    },
    "window_config_proxyport_label": {
        "string": "代理端口:",
        "comment": ""
    },
    "window_config_proxyuser_laber": {
        "string": "代理用户名:",
        "comment": ""
    },
    "window_config_proxypass_label": {
        "string": "代理密码",
        "comment": ""
    },
    "window_config_cancel_btn": {
        "string": "取消",
        "comment": ""
    },
    "window_config_save_btn": {
        "string": "保存",
        "comment": ""
    },
    "window_select_title": {
        "string": "选择更新内容",
        "comment": ""
    },
    "window_select_text_label": {
        "string": "游戏标题: {0}\t内容 ID: {1}",
        "comment": "0: Game name, 1: TitleID"
    },
    "window_select_table_ver": {
        "string": "版本",
        "comment": ""
    },
    "window_select_table_size": {
        "string": "文件大小",
        "comment": ""
    },
    "window_select_table_sysver": {
        "string": "PS3 软件版本",
        "comment": ""
    },
    "window_select_download_btn": {
        "string": "下载",
        "comment": ""
    },
    "window_select_cancel_btn": {
        "string": "取消",
        "comment": ""
    },
    "window_select_queue_btn": {
        "string": "添加到下载队列",
        "comment": ""
    },
    "window_select_help_label": {
        "string": "按住 Ctrl 键并点击要选择的更新补丁",
        "comment": ""
    },
    "window_relNotify_title": {
        "string": "发现新版本!",
        "comment": ""
    },
    "window_relNotify_version_label": {
        "string": "当前版本: {0}\n新版本: {1}",
        "comment": "0: Current programm version, 1: New programm version"
    },
    "window_relNotify_changelog_label": {
        "string": "更新日志:",
        "comment": ""
    },
    "window_relNotify_web_btn": {
        "string": "在浏览器中打开网站",
        "comment": ""
    },
    "window_relNotify_dl_btn": {
        "string": "下载并安装更新",
        "comment": ""
    },
    "window_relNotify_close_btn": {
        "string": "关闭",
        "comment": ""
    },
    "window_queue_title": {
        "string": "下载队列",
        "comment": ""
    },
    "window_queue_table_num": {
        "string": "序号",
        "comment": ""
    },
    "window_queue_table_game": {
        "string": "游戏标题",
        "comment": ""
    },
    "window_queue_table_titleid": {
        "string": "内容 ID",
        "comment": ""
    },
    "window_queue_table_ver": {
        "string": "版本",
        "comment": ""
    },
    "window_queue_table_size": {
        "string": "文件大小",
        "comment": ""
    },
    "window_queue_download_btn": {
        "string": "开始下载",
        "comment": ""
    },
    "window_queue_close_btn": {
        "string": "关闭",
        "comment": ""
    },
    "window_queue_moveup_btn": {
        "string": "上移",
        "comment": ""
    },
    "window_queue_movedown_btn": {
        "string": "下移",
        "comment": ""
    },
    "window_queue_remove_btn": {
        "string": "移除",
        "comment": ""
    },
    "window_queue_totalsize_label": {
        "string": "全部大小: {0}",
        "comment": "0: Total download size of queue"
    },
    "window_queue_export_label": {
        "string": "导出队列到:",
        "comment": ""
    },
    "window_queue_export_btn": {
        "string": "导出",
        "comment": ""
    },
    "window_keyring_support_info_label": {
        "string": "未找到可用的密钥链后端,\n请查看主页上的密钥链安装指南。\n{0}",
        "comment": "0: Url of keyring homepage"
    },
    "window_keyring_support_dont_show_again_label": {
        "string": "以后不再显示",
        "comment": ""
    },
    "window_keyring_support_ok_btn": {
        "string": "确定",
        "comment": ""
    },
    "window_keyring_support_browser_btn": {
        "string": "在浏览器中打开",
        "comment": ""
    },
    "window_keyring_support_title": {
        "string": "警告! 代理支持已禁用!",
        "comment": ""
    },
	"window_msgBox_ok_btn": {
		"string": "确定",
		"comment": ""
	},
	"window_msgBox_queueExported_title": {
		"string": "队列已导出",
		"comment": ""
	},
	"window_msgBox_queueExported_label": {
		"string": "队列已导出到 \"{0}\".",
		"comment": "0: File name"
	},
    "msg_configFileLoaded": {
        "string": "已加载配置文件!",
        "comment": ""
    },
    "msg_noConfigFile": {
        "string": "未发现配置文件,将使用默认配置!",
        "comment": ""
    },
    "msg_configFileSaved": {
        "string": "配置文件已保存!",
        "comment": ""
    },
    "msg_loadedTitledb": {
        "string": "内容数据已加载 \"{0}\"",
        "comment": "0: Path to TitleDB"
    },
    "msg_titleIDIs": {
        "string": "游戏标题: {0}\t 内容 ID: {1} ",
        "comment": "0: Game name, 1: TitleID"
    },
    "msg_titleIDNotValid"
Download .txt
gitextract_ua6xxo6r/

├── .gitattributes
├── .github/
│   └── dependabot.yml
├── .gitignore
├── CHANGELOG
├── LICENSE
├── PS3GUD.py
├── README.md
├── build.py
├── buildrequirements.txt
├── gui.py
├── images/
│   └── icon.xcf
├── loc/
│   ├── de.json
│   ├── en.json
│   ├── es_ES.json
│   ├── it.json
│   ├── ru.json
│   ├── th.json
│   ├── tr.json
│   └── zh_CN.json
├── main_ps3gud.py
├── missingstrings.py
├── ps3gud_jdownloader_renamepkgs.packagizer
├── release.debug.json
├── release.json
├── requirements.txt
├── sony.pem
├── titledb.debug.json
├── titledb.json
├── updater.py
└── utils.py
Download .txt
SYMBOL INDEX (100 symbols across 5 files)

FILE: PS3GUD.py
  class PS3GUD (line 37) | class PS3GUD:
    method __init__ (line 38) | def __init__(self, window=None):
    method setupRequests (line 70) | def setupRequests(self):
    method setWindow (line 78) | def setWindow(self, window):
    method setLoc (line 81) | def setLoc(self, loc):
    method logHeader (line 84) | def logHeader(self, version, psgversion, commit):
    method loadConfig (line 96) | def loadConfig(self):
    method setConfig (line 122) | def setConfig(self, config):
    method saveConfig (line 126) | def saveConfig(self):
    method setProxyCredentials (line 135) | def setProxyCredentials(self, pwd, user):
    method getProxyCredentials (line 141) | def getProxyCredentials(self):
    method setupProxy (line 147) | def setupProxy(self):
    method getConfig (line 170) | def getConfig(self, key):
    method checkTitleDbVersion (line 176) | def checkTitleDbVersion(self):
    method loadTitleDb (line 205) | def loadTitleDb(self):
    method getTitleNameFromId (line 212) | def getTitleNameFromId(self, titleid=None):
    method getUpdates (line 219) | def getUpdates(self):
    method checkForUpdates (line 222) | def checkForUpdates(self, titleid):
    method downloadFiles (line 300) | def downloadFiles(self, window):
    method _download_file (line 417) | def _download_file(self, url, local_filename, size, window, num):
    method _sha1File (line 454) | def _sha1File(self, fname):
    method __del__ (line 479) | def __del__(self):
  class Queue (line 483) | class Queue:
    method __init__ (line 484) | def __init__(self, ps3):
    method addEntry (line 488) | def addEntry(self, entry):
    method removeEntry (line 502) | def removeEntry(self, code):
    method _sortQueue (line 510) | def _sortQueue(self):
    method moveUp (line 522) | def moveUp(self, code):
    method moveDown (line 543) | def moveDown(self, code):
    method getTotalDownloadSize (line 565) | def getTotalDownloadSize(self):
    method isAlreadInQueue (line 571) | def isAlreadInQueue(self, code):
    method exportQueue (line 578) | def exportQueue(self, exportFile):
  class SonySSLContextAdapter (line 611) | class SonySSLContextAdapter(requests.adapters.HTTPAdapter):
    method __init__ (line 612) | def __init__(self, bypassSSL=False, **kwargs):
    method init_poolmanager (line 616) | def init_poolmanager(self, *args, **kwargs):

FILE: build.py
  function buildheader (line 29) | def buildheader(release, filepath , pyiver="None", winever=None):
  function createDigest (line 48) | def createDigest(file):
  function validateJSON (line 54) | def validateJSON(filename):
  function minifyJSON (line 65) | def minifyJSON(jsonfiles):
  function getJSONFiles (line 78) | def getJSONFiles():
  function copyData (line 91) | def copyData(builddir, locdirname, imagedirname, debug=False, source=Fal...
  function copySource (line 108) | def copySource(builddir):
  function saveCommitId (line 132) | def saveCommitId(release, builddir):
  function remove_readonly (line 140) | def remove_readonly(func, path, _):
  class Prepender (line 145) | class Prepender(object):
    method __init__ (line 146) | def __init__(self,
    method write_line (line 155) | def write_line(self, line): # line order is reversed
    method write_lines (line 160) | def write_lines(self, lines): # line order is maintained
    method close (line 165) | def close(self):
    method __enter__ (line 168) | def __enter__(self):
    method __exit__ (line 171) | def __exit__(self, type, value, traceback):

FILE: gui.py
  class Gui (line 30) | class Gui:
    method __init__ (line 31) | def __init__(self):
    method updatePackToTable (line 71) | def updatePackToTable(self, update):
    method queueToTable (line 78) | def queueToTable(self, queue, ps3):
    method retranslateWindow (line 96) | def retranslateWindow(self, window, loc, items):
    method getCodeFromQueueData (line 100) | def getCodeFromQueueData(self, queueData, resp):
    method mainWin (line 103) | def mainWin(self):
    method newReleaseWin (line 193) | def newReleaseWin(self):
    method configWin (line 275) | def configWin(self, nocancel=False):
    method selectWin (line 500) | def selectWin(self, only_queue=False):
    method queueWin (line 614) | def queueWin(self):
    method keyring_supportWin (line 738) | def keyring_supportWin(self):
    method msgBox (line 782) | def msgBox(self, text, title, parent):
    method RPCS3ImportWin (line 799) | def RPCS3ImportWin(self):

FILE: main_ps3gud.py
  function run (line 17) | def run():

FILE: utils.py
  class Logger (line 36) | class Logger():
    method __init__ (line 37) | def __init__(self, window=None):
    method log (line 49) | def log(self, text, level="i"):
    method __del__ (line 67) | def __del__(self):
  class Loc (line 70) | class Loc():
    method __init__ (line 71) | def __init__(self):
    method _scanForLoc (line 78) | def _scanForLoc(self):
    method getLocs (line 86) | def getLocs(self):
    method getLoc (line 89) | def getLoc(self):
    method setLoc (line 92) | def setLoc(self, loc=None):
    method getKey (line 103) | def getKey(self, key, args=[]):
  class UpdaterGithubRelease (line 112) | class UpdaterGithubRelease():
    method __init__ (line 113) | def __init__(self, releaseFile):
    method getVersion (line 124) | def getVersion(self):
    method getCommitID (line 127) | def getCommitID(self):
    method getChangelog (line 133) | def getChangelog(self):
    method getRightAssetNum (line 137) | def getRightAssetNum(self):
    method getRightAssetNumSHA256 (line 145) | def getRightAssetNumSHA256(self):
    method checkForNewRelease (line 153) | def checkForNewRelease(self):
    method downloadNewRelease (line 174) | def downloadNewRelease(self, cwd, window):
    method startUpdater (line 247) | def startUpdater(self):
  function formatSize (line 278) | def formatSize(size):
  function massReplace (line 288) | def massReplace(find, replace, stri):
  function massFormat (line 294) | def massFormat(stri, args):
  function filterIllegalCharsFilename (line 297) | def filterIllegalCharsFilename(path):
  function rmDirContents (line 305) | def rmDirContents(folder_path):
  function isAppFrozen (line 313) | def isAppFrozen():
  function getExecutableSuffix (line 321) | def getExecutableSuffix():
  function getArchiveSuffix (line 331) | def getArchiveSuffix():
  function logUncaughtException (line 346) | def logUncaughtException(exctype, value, tb):
  function cleanupAfterUpdate (line 355) | def cleanupAfterUpdate():
  function sha256File (line 367) | def sha256File(file):
  function getMainExecutableBasename (line 374) | def getMainExecutableBasename():
  function waitForMainAppExit (line 382) | def waitForMainAppExit(pid = None, window = None):
Condensed preview — 30 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,769K chars).
[
  {
    "path": ".gitattributes",
    "chars": 29,
    "preview": "* text=auto\n\n*.sh text eol=lf"
  },
  {
    "path": ".github/dependabot.yml",
    "chars": 144,
    "preview": "version: 2\nupdates:\n - package-ecosystem: \"pip\"\n   directory: \"/\"\n   schedule:\n    interval: \"monthly\"\n   allow:\n    - d"
  },
  {
    "path": ".gitignore",
    "chars": 1348,
    "preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packagi"
  },
  {
    "path": "CHANGELOG",
    "chars": 5163,
    "preview": "! important change\n+ new feature or minor change\n- bugfix\n\nfuture release (aka current master branch):\n\nv013:\n+  added s"
  },
  {
    "path": "LICENSE",
    "chars": 35149,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "PS3GUD.py",
    "chars": 24071,
    "preview": "#!/usr/bin/env python3\n# -*- coding: UTF-8 -*-\n#\n# PS3GameUpdateDownloader downloads PS3 game updates from official Sony"
  },
  {
    "path": "README.md",
    "chars": 1730,
    "preview": "# PS3GameUpdateDownloader\nThis program downloads updates for PS3 games from the official PS3 servers.\n\nFeatures:\n- Windo"
  },
  {
    "path": "build.py",
    "chars": 20566,
    "preview": "#!/usr/bin/env python3\n# -*- coding: UTF-8 -*-\n#\n#PS3GameUpdateDownloader downloads PS3 game updates from official Sony "
  },
  {
    "path": "buildrequirements.txt",
    "chars": 53,
    "preview": "pyinstaller==6.19.0\npyinstaller-hooks-contrib==2026.1"
  },
  {
    "path": "gui.py",
    "chars": 33646,
    "preview": "#!/usr/bin/env python3\n# -*- coding: UTF-8 -*-\n#\n# PS3GameUpdateDownloader downloads PS3 game updates from official Sony"
  },
  {
    "path": "loc/de.json",
    "chars": 10922,
    "preview": "{\n    \"language_name\": {\n        \"string\": \"Deutsch\",\n        \"comment\": \"Name of the language\"\n    },\n    \"language_sho"
  },
  {
    "path": "loc/en.json",
    "chars": 11885,
    "preview": "{\n    \"language_name\": {\n        \"string\": \"English\",\n        \"comment\": \"Name of the language\"\n    },\n    \"language_sho"
  },
  {
    "path": "loc/es_ES.json",
    "chars": 11439,
    "preview": "{\n    \"language_name\": {\n        \"string\": \"Castellano\",\n        \"comment\": \"Name of the language\"\n    },\n    \"language_"
  },
  {
    "path": "loc/it.json",
    "chars": 8752,
    "preview": "{\n    \"language_name\": {\n        \"string\": \"Italiano\",\n        \"comment\": \"Name of the language\"\n    },\n    \"language_sh"
  },
  {
    "path": "loc/ru.json",
    "chars": 8568,
    "preview": "{\n    \"language_name\": {\n        \"string\": \"Русский\",\n        \"comment\": \"Name of the language\"\n    },\n    \"language_sho"
  },
  {
    "path": "loc/th.json",
    "chars": 8507,
    "preview": "{\n    \"language_name\": {\n        \"string\": \"ภาษาไทย\",\n        \"comment\": \"Name of the language\"\n    },\n    \"language_sho"
  },
  {
    "path": "loc/tr.json",
    "chars": 9101,
    "preview": "{\n    \"language_name\": {\n        \"string\": \"Türkçe\",\n        \"comment\": \"Name of the language\"\n    },\n    \"language_shor"
  },
  {
    "path": "loc/zh_CN.json",
    "chars": 9351,
    "preview": "{\n    \"language_name\": {\n        \"string\": \"简体中文\",\n        \"comment\": \"Name of the language\"\n    },\n    \"language_short\""
  },
  {
    "path": "main_ps3gud.py",
    "chars": 889,
    "preview": "#!/usr/bin/env python3\n# -*- coding: UTF-8 -*-\n#\n#PS3GameUpdateDownloader downloads PS3 game updates from official Sony "
  },
  {
    "path": "missingstrings.py",
    "chars": 925,
    "preview": "#!/usr/bin/env python3\n# -*- coding: UTF-8 -*-\n#\n# missingstrings.py for PS3GameUpdateDownloader by shinrax2\n\n#built-in\n"
  },
  {
    "path": "ps3gud_jdownloader_renamepkgs.packagizer",
    "chars": 1552,
    "preview": "[\n {\"filetypeFilter\":{\"customs\":null,\"matchType\":\"IS\",\"archivesEnabled\":false,\"audioFilesEnabled\":false,\"docFilesEnabled"
  },
  {
    "path": "release.debug.json",
    "chars": 98,
    "preview": "{\n    \"version\": \"v000\",\n    \"author\": \"shinrax2\",\n    \"repo\": \"test-repo\",\n    \"tdb_version\": 0\n}"
  },
  {
    "path": "release.json",
    "chars": 112,
    "preview": "{\n    \"version\": \"v013\",\n    \"author\": \"shinrax2\",\n    \"repo\": \"PS3GameUpdateDownloader\",\n    \"tdb_version\": 1\n}"
  },
  {
    "path": "requirements.txt",
    "chars": 131,
    "preview": "requests==2.33.0\nFreeSimpleGUI==5.2.0.post1\nkeyring==25.7.0\nrequests[socks]==2.33.0\nsetuptools==82.0.0\npsutil==7.2.2\npyy"
  },
  {
    "path": "sony.pem",
    "chars": 2944,
    "preview": "-----BEGIN CERTIFICATE-----\nMIID0jCCArqgAwIBAgIBADANBgkqhkiG9w0BAQUFADBUMQswCQYDVQQGEwJKUDEp\nMCcGA1UEChMgU29ueSBDb21wdXR"
  },
  {
    "path": "titledb.debug.json",
    "chars": 849926,
    "preview": "{\n    \"db\": [\n        {\n            \"id\": \"ASIA00048\",\n            \"name\": \"Ultimate Shooter Pack: Resistance 3 / Killzo"
  },
  {
    "path": "titledb.json",
    "chars": 505930,
    "preview": "{\"db\": [{\"id\": \"ASIA00048\", \"name\": \"Ultimate Shooter Pack: Resistance 3 / Killzone 3\"}, {\"id\": \"ASIA00049\", \"name\": \"Sq"
  },
  {
    "path": "updater.py",
    "chars": 1851,
    "preview": "#!/usr/bin/env python3\n# -*- coding: UTF-8 -*-\n#\n# PS3GameUpdateDownloader by shinrax2\n\n# builtin\nimport time\nimport tem"
  },
  {
    "path": "utils.py",
    "chars": 16888,
    "preview": "#!/usr/bin/env python3\n# -*- coding: UTF-8 -*-\n#\n#PS3GameUpdateDownloader downloads PS3 game updates from official Sony "
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the shinrax2/PS3GameUpdateDownloader GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 30 files (1.5 MB), approximately 483.6k tokens, and a symbol index with 100 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!