Skip to content

Commit

Permalink
Merge pull request #21 from smvueno/master
Browse files Browse the repository at this point in the history
Added avatars support for PS3
  • Loading branch information
evertonstz authored Jun 13, 2020
2 parents 8676a0e + d0b1ec5 commit d7d21e8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pynps/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def validate(self, document):
else:

what_to_dl = {"games": args.games, "dlcs": args.dlcs, "themes": args.themes,
"updates": args.updates, "demos": args.demos}
"updates": args.updates, "demos": args.demos, "avatars": args.avatars}

if set(what_to_dl.values()) == set([False]):
for i in what_to_dl:
Expand Down
24 changes: 19 additions & 5 deletions pynps/functions/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,8 @@ def create_args():
action="store_true")
parser.add_argument("-E", "-dde", "--demos", help="to download PSV demos.",
action="store_true")
parser.add_argument("-A", "-da", "--avatars", help="to download PS3 avatars.",
action="store_true")
parser.add_argument("-k", "--keepkg", help="using this flag will keep the pkg after the extraction",
action="store_true")
parser.add_argument("-eb", "--eboot", help="use this argument to unpack PSP games as EBOOT.PBP",
Expand Down Expand Up @@ -800,20 +802,20 @@ def create_args():
printft(HTML("<orange>[WARNING] PS3 games can't be packed as eboot files</orange>"))

# exclusions
test = [a.console, a.region, a.games, a.dlcs, a.themes, a.updates, a.demos, a.eboot, a.compress_cso, a.update] == [['PSV', 'PSP', 'PSX', 'PSM'], None, False, False, False, False, False, False, None, False]
test = [a.console, a.region, a.games, a.dlcs, a.themes, a.updates, a.demos, a.eboot, a.compress_cso, a.update, a.avatars] == [['PSV', 'PSP', 'PSX', 'PSM', 'PS3'], None, False, False, False, False, False, False, None, False, False]
if a.resume_session is True and test is False:
printft(HTML("<red>[ERROR] you can only use -R/--resume_session alongside the -l/--limit_rate and -k/--keepkg arguments</red>"))
sys.exit(1)

# unsuported download types
if "PSP" in a.console and a.demos == True:
if "PSP" in a.console and True in [a.demos, a.avatars]:
if len(a.console) > 1:
printft(HTML("<orange>[WARNING] NPS has no support for demos with the Playstation Portable (PSP)</orange>"))
printft(HTML("<orange>[WARNING] NPS has no support for demos or avatars with the Playstation Portable (PSP)</orange>"))
else:
printft(HTML("<red>[ERROR] NPS has no support for demos with the Playstation Portable (PSP)</red>"))
printft(HTML("<red>[ERROR] NPS has no support for demos or avatars with the Playstation Portable (PSP)</red>"))
sys.exit(1)

if "PSX" in a.console and True in [a.dlcs, a.themes, a.updates, a.demos]:
if "PSX" in a.console and True in [a.dlcs, a.themes, a.updates, a.demos, a.avatars]:
if len(a.console) > 1:
printft(HTML("<orange>[WARNING] NPS only supports game downlaods for the Playstation (PSX)</orange>"))
else:
Expand All @@ -825,6 +827,18 @@ def create_args():
else:
printft(HTML("<red>[ERROR] NPS has no support for updates with the Playstation 3 (PS3))</red>"))
sys.exit(1)
if "PSV" in a.console and a.avatars == True:
if len(a.console) > 1:
printft(HTML("<orange>[WARNING] NPS has no support for avatars with the Playstation Vita (PSV)</orange>"))
else:
printft(HTML("<red>[ERROR] NPS has no support for avatars with the Playstation Vita (PSV)</red>"))
sys.exit(1)
if "PSM" in a.console and a.avatars == True:
if len(a.console) > 1:
printft(HTML("<orange>[WARNING] NPS has no support for avatars with the Playstation Mobile (PSM)</orange>"))
else:
printft(HTML("<red>[ERROR] NPS has no support for avatars with the Playstation Mobile (PSM)</red>"))
sys.exit(1)

# limit rate string
if a.limit_rate is not None:
Expand Down
2 changes: 1 addition & 1 deletion pynps/variables/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']

TYPE_DICT = {"GAMES": "Game", "THEMES": "Theme",
"DLCS": "DLC", "DEMOS": "Demo", "UPDATES": "Update"}
"DLCS": "DLC", "DEMOS": "Demo", "UPDATES": "Update", "AVATARS": "Avatar"}

REGION_DICT = {"US": "USA", "EU": "EUR", "JP": "JAP", "ASIA": "ASIA",
"INT": "INT", "usa": "US", "jap": "JP", "eur": "EU",
Expand Down

0 comments on commit d7d21e8

Please sign in to comment.