Join Us and become a Member for a Verified Badge on Discord to access private areas with the latest PS4 FPKGs.
PS5 CFW and Hacks       Thread starter PSXHAX       Start date Dec 8, 2020 at 2:48 AM       6,358       10      
Status
Not open for further replies.
Proceeding the PS5 XML Updaters, first PS5 PKGs, PS5UPDATE.PUP Unpacker via BLSUnpack, PS5 Firmware Checker, PS5 Scene Game Dumps and PS5 Error Codes today 1jtp8sobiu shared a PS5 PKG project on Github that includes a PS5 XML Update Checker Python script alongside some PS5 XML JSON (JavaScript Object Notation file format) update links for those interested in PlayStation 5 research documentation. :geek:

Download: ps5_xml_update_checker.py / ps5-pkg-master.zip / GIT / PS5_TITLE_ID.tsv / PS5 Title ID List (contains PS5 PKG Links XML with PS5 TitleIDs) / PS5 PKG forked by 0x199 with PS5 Patch Submitter via ProsperoPatches.com

From PS5_XML.tsv:

Content ID Title Pkg Link (xml)
EP0001-PPSA01490_00-GAME000000000000 Assassin's Creed® Valhalla https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01490_00/b94df226-94ce-4cac-897a-161efd9124a1-version.xml
UP0001-PPSA01491_00-GAME000000000000 Assassin's Creed® Valhalla https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01491_00/a74afd96-ee9a-4d79-a1a6-0603f1ef98dc-version.xml
JP0001-PPSA01504_00-GAME000000000000 Assassin's Creed® Valhalla https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01504_00/1faf9b07-67a3-4672-8c2e-09bd51acfc5b-version.xml
IP9100-PPSA01325_00-PREINMASTER00000 ASTRO's PLAYROOM https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01325_00/c0d746cf-c687-4e72-946a-e2396b584362-version.xml
UP1001-PPSA01462_00-0000000OAKNGSIEA Borderlands® 3 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01462_00/ed616f4d-c5de-47b3-a7ad-68ce8224f91e-version.xml
EP1001-PPSA01463_00-0000000OAKNGSIEE Borderlands® 3 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01463_00/4e400b2f-9fec-400c-97ab-307b529adb57-version.xml
UP3509-PPSA02048_00-DEADBYDAYLIGHT00 Dead by Daylight https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA02048_00/47a0c194-46c9-4547-b82f-aaaf7340cb49-version.xml
EP3367-PPSA02049_00-DEADBYDAYLIGHT00 Dead by Daylight https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA02049_00/8ebb13e7-a984-403f-9c9b-e541f8f7c47d-version.xml
EP4001-PPSA01551_00-DIRTFIVEPS5EDITI DIRT5 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01551_00/945ec86b-3049-42eb-8e10-c3e1bf0a1378-version.xml
UP4001-PPSA01552_00-DIRTFIVEPS5EDITI DIRT5 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01552_00/013a769d-9ef5-471f-bd56-202763fe0379-version.xml
EP0006-PPSA01326_00-FIFAFOOTBALL2021 FIFA 21 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01326_00/ed802cf3-5b7b-4f09-9956-1421ca3f8b4a-version.xml
UP0006-PPSA01327_00-FIFAFOOTBALL2021 FIFA 21 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01327_00/59c1ad8c-bcce-4818-9dac-c6dd10635f95-version.xml
EP0006-PPSA01432_00-FIFAFOOTBALL2021 FIFA 21 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01432_00/395b664f-b517-4c51-95af-700c40fda58a-version.xml
UP1477-PPSA01922_00-FORTNITETESTING2 Fortnite https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01922_00/cbafb8dc-c780-4137-af2c-2aa0a8e2afc2-version.xml
EP1464-PPSA01923_00-FORTNITETESTING2 Fortnite https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01923_00/b2cabdbe-d5f2-43e1-a108-5b95f380fbdd-version.xml
EP0001-PPSA01506_00-GAME000000000000 Immortals Fenyx Rising ™ https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01506_00/bbe211a3-418e-4c5c-8c09-4b9541e3ec4c-version.xml
UP0001-PPSA01507_00-GAME000000000000 Immortals Fenyx Rising ™ https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01507_00/d5aee0f2-2969-4176-92c5-3318e080a93d-version.xml
JP0001-PPSA01508_00-GAME000000000000 Immortals Fenyx Rising ™ https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01508_00/42e33fd1-9cc2-46db-8c87-60ea9e3ec5ed-version.xml
UP0006-PPSA01343_00-MADDENNFL21GAME1 Madden NFL 21 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01343_00/333f0639-d911-45d5-8b2f-1bf7849355dd-version.xml
EP0006-PPSA01344_00-MADDENNFL21GAME1 Madden NFL 21 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01344_00/5db7d7f7-caab-4759-b528-f370d68c0935-version.xml
UP0115-PPSA01861_00-MANEATER00000001 Maneater https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01861_00/0dc09abf-89df-45f0-9ea4-0ceb9cf7df96-version.xml
EP0114-PPSA01862_00-MANEATER00000001 Maneater https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01862_00/6cf20cc0-645f-4fcc-b5c8-092679f5cef0-version.xml
UP9000-PPSA01411_00-MARVELSSMMORALES Marvel's Spider-Man: Miles Morales https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01411_00/74289cac-d011-4fc8-88f4-6c2e36bfa908-version.xml
JP9000-PPSA01418_00-MARVELSMSMORALES Marvel's Spider-Man: Miles Morales https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01418_00/76687e64-cd93-498f-93b2-b7bcaff49d7b-version.xml
HP9000-PPSA01419_00-MARVELSSMMORALES Marvel's Spider-Man: Miles Morales https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01419_00/19bfe524-3054-40ef-adeb-9772e6be5fb1-version.xml
EP9000-PPSA01461_00-MARVELSSMMORALES Marvel's Spider-Man: Miles Morales https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01461_00/8de33b32-03a3-4a2d-8bb1-87c68152d74f-version.xml
UP1018-PPSA01617_00-00MORTALKOMBAT11 Mortal Kombat 11 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01617_00/22fce07e-73c2-4d0a-b988-305dccf7a86d-version.xml
EP1018-PPSA01619_00-00MORTALKOMBAT11 Mortal Kombat 11 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01619_00/d13316b3-ee9c-4082-bc86-f8a38f4c1278-version.xml
EP2034-PPSA01412_00-NOMANSSKYHG00001 No Man's Sky https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01412_00/9c9af5bc-0037-4dff-9def-7148714fce5d-version.xml
UP2034-PPSA02110_00-NOMANSSKYHG00001 No Man's Sky https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA02110_00/f4cb6658-c16e-4751-a2e1-fec2afa2725a-version.xml
HP2034-PPSA02112_00-NOMANSSKYHG00001 No Man's Sky https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA02112_00/ccc4d637-789f-4156-bfea-60425c4e164d-version.xml
EP2377-PPSA01735_00-PLANETCOASTER000 Planet Coaster https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01735_00/1161facb-2845-47c7-af1e-81404dc00637-version.xml
UP2514-PPSA01736_00-PLANETCOASTER000 Planet Coaster https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01736_00/8d426b3e-d689-4712-88e7-7543f5a16a90-version.xml
EP9000-PPSA01288_00-SACKBOYADVENTURE Sackboy: A Big Adventure https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01288_00/1db8a953-699b-47e8-8082-799b1eea8118-version.xml
UP9000-PPSA01289_00-SACKBOYADVENTURE Sackboy: A Big Adventure https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01289_00/0c1789e3-10b1-41eb-8ede-c159db8ef1e7-version.xml
JP9000-PPSA01291_00-SACKBOYADVENTURE Sackboy™: A Big Adventure https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01291_00/04593efe-23f5-4265-9f21-16b880cead6a-version.xml
HP9000-PPSA01292_00-SACKBOYADVENTURE Sackboy™: A Big Adventure https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01292_00/183fd31e-647e-4570-9328-2956dc17dd44-version.xml
IP9100-PPSA01280_00-SFSRELE000000100 Share Factory Studio https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01280_00/d8ec167a-59da-4e54-8e2c-1161c706516a-version.xml
UP2470-PPSA01825_00-PATHLESSSIEA0000 The Pathless https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01825_00/65724500-c485-4117-b31c-e7e905e7493f-version.xml
EP2333-PPSA01826_00-PATHLESSSIEE0000 The Pathless https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01826_00/f5d50082-c248-4137-8583-df9e290cfe0f-version.xml
UP0001-PPSA01396_00-RAINBOWSIXSIEGE0 Tom Clancy's Rainbow Six® Siege https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01396_00/6a283a86-7b14-4380-84d1-2aeab5a509ab-version.xml
EP0001-PPSA01397_00-RAINBOWSIXSIEGE0 Tom Clancy's Rainbow Six® Siege https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01397_00/8a1cab18-f015-4e12-9b59-04c5fde6bb60-version.xml
EP4432-PPSA01948_00-5311322004715828 War Thunder https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01948_00/eb9c490e-13d0-4329-a8bf-e48e5d4c74da-version.xml
UP4432-PPSA01950_00-2173548409910606 War Thunder https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01950_00/8f1497d1-4693-4493-8b59-01248ffd020e-version.xml
JP1201-PPSA02190_00-8765687607573553 War Thunder https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA02190_00/cac36118-d25c-4e62-a92c-29217841d5de-version.xml
UP2097-PPSA01737_00-WARFRAMEPS500000 Warframe https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01737_00/5ce04010-093d-4478-9d67-3387ac3cdb3d-version.xml
EP2097-PPSA01980_00-7357509687265755 Warframe https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01980_00/037d5d41-db9e-4b39-8a0c-aff78b557559-version.xml
JP0141-PPSA02323_00-8148339690872080 Warframe https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA02323_00/872fbda4-724c-4a28-915b-4ec801a3966f-version.xml
UP0001-PPSA01487_00-ORWFULLGAME00000 Watch Dogs®: Legion https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01487_00/10e74c69-286c-44ad-bade-3321a464637a-version.xml
EP0001-PPSA01488_00-ORWFULLGAME00000 Watch Dogs®: Legion https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01488_00/f316ebfb-6159-46c8-bec2-ed167d1208eb-version.xml
JP0001-PPSA01489_00-ORWFULLGAME00000 Watch Dogs®: Legion https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01489_00/f4d49f53-3a6a-4f8b-a574-e4a64075cd68-version.xml
EP4008-PPSA01363_00-WRC9SIEE00000000 WRC 9 FIA World Rally Championship https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01363_00/fc793c99-1eb9-44a2-906c-e043702ed9b3-version.xml
UP4008-PPSA01364_00-WRC9SIEA00000000 WRC 9 FIA World Rally Championship https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01364_00/558d81bd-6521-4fdf-b2dc-cbc506e2ca35-version.xml
JP0177-PPSA02329_00-TENPEXTENPEXDEMO ぷよぷよ™テトリス®2 たいけんばん https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA02329_00/01217667-2fea-4a9e-a031-84d772d13311-version.xml
JP0106-PPSA02097_00-RYZA200000MASTER ライザのアトリエ2 ~失われた伝承と秘密の妖精~ https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA02097_00/7ed8dae4-b306-4cab-8e66-06ae1a0787d9-version.xml
HP0106-PPSA02095_00-RYZA200000MASTER 萊莎的鍊金工房2 ~失落傳說與秘密妖精~ https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA02095_00/abed899f-ce21-401f-a163-f7ada9371ff4-version.xml
EP0006-PPSA01430_00-FIFAFOOTBALL2021 FIFA 21 https://sgst.prod.dl.playstation.net/sgst/prod/00/np/PPSA01430_00/123c6865-d129-4284-890c-016710cd30a3-version.xml
From XML_HASH.json:
Code:
{"PPSA01280_00": "1781eb161bae5be95af7238c1343c695eb6879278944b63f137033fb1165359a", "PPSA01288_00": "60c189d697266893dd607b38a7899c40891c7ddc1136306438d6b12577c99468", "PPSA01289_00": "0be525707717e8a32f7cbff809b988b1f18d420067b705c376ff6d761367120c", "PPSA01291_00": "92de317c9e23715a828db9d5c8742f5442f90c72ea01b8c7cffc7805ef7e93c7", "PPSA01325_00": "36595e8bceece06d374df954bfaafb2c687257da73f648c713b45699399c7388", "PPSA01343_00": "401bf3212e7c1ee0392c0b8984a9ef021c96733c0c0a76df9dba4b21ace33fb8", "PPSA01418_00": "c2057a69bb6587b0e6755f3a4d87f8aca92006000ae717b37552e95f88aef120", "PPSA01432_00": "3afbe74febf4678873712ddb66ef416b781fcf0fb357a738feea364e2bf755c8", "PPSA01462_00": "a3f27309b004e4a1b781f19a674111eba796017b9620e098708b298ef64ac630", "PPSA01489_00": "06ae9e45603539678147cefc63216e591cc8fdd770fd75b66c93a2d02cfaedf4", "PPSA01504_00": "63c8965aaa86c2b8c957cd9e1db33363cd9350c2ad02fc44d842b882d8029311", "PPSA01508_00": "95a20c13daba2418fd1879c1f5048ed82ccc0e7518472603a80634675b6346ec", "PPSA01735_00": "184ae659e9f2c2783d687221118b9411dd0eefe05fda4f087ae6f8775830ed42", "PPSA01922_00": "e391a7fb912bf5314c30cd61db3bf668f61a01046fdb4868d52ada9c0d04b81c", "PPSA01948_00": "04cd1785af0fd3f0615befc1d4be0409ce84f1bf2760e96613e9d8189718ec97", "PPSA02097_00": "d2f874895b276e43c96dc5dffe06d9e12d663e6ca015c2885c3f3994fd1fbab7", "PPSA02190_00": "38bff75087bfb0f8b3dce7572f9c463fa069f8621af6acf78799631c393c0e99", "PPSA02323_00": "c505f8d1b65f9e19a04eb62446f962f7e5b5ffd5eaf16b5b92c3152fdd684f2d", "PPSA01292_00": "f78a4f042090a16cdec7e5eea27032f90be76728a214995808494fba46b1fb50", "PPSA01397_00": "11a3dc6213af0f9ba056f554dfead07ee6f332db64737850b17498b4cfc5bb22", "PPSA01419_00": "737a070813cdbb1d10a35638676649dbc588f3dc29ed0066b701e1cb5828604f", "PPSA02048_00": "abd71f92f3e892cd4a76c163a3f312ab0f92132d4a78e629645ba3c4f0e10947", "PPSA02095_00": "c7ee82660bf76f931adc8e1627aea891d115f2d7691a493d33ef1efe980b36f0", "PPSA02112_00": "143f2ccaf9045232bf768d4a8f5deefb485986c5b1cb934be68e55af8cc988ca", "PPSA01363_00": "ccdcffc7d86b6d94b4e2f73cd3639c56309acb33905e64bce287e28efb2f024d", "PPSA01737_00": "788e81286d1217e617b6ce0c506ad040f056f948d3169dfb7c09ff626e402270", "PPSA01327_00": "2c0e7954b15628f4c32af1c8ae74caacc6f189936e516143b30e17838bc689ba", "PPSA01364_00": "83b37522659802b8b0fc0f3317f59d8660838f2c64105068e1dcb2f3ec413a9a", "PPSA01396_00": "a9c54c21a5c181f231d93b659fa657d221fdb840fa4101752c9d76a4d80227e2", "PPSA01411_00": "708f0bd01aba9c1dc94c6c53f1dcd41002778eda4b90bc0a16e22f20f505af5f", "PPSA01487_00": "11d9bc86aacda789a00696082c2e737d76700da847cc6d3951c96d142f1c27a7", "PPSA01491_00": "4a84d056fecbc5bc3439454c12cc53a5b94664faca02f522d4effa80195d0b23", "PPSA01507_00": "e55b012917eff025a72ea5d1707138d26249e15fab371cd27a47f1b922dc29ed", "PPSA01552_00": "4274b86a90e7a8c8524bb32beb5800ff9875751b656bce4e4581632b5db7519b", "PPSA01617_00": "da1a2eb37aaaf2145197e1d56fba9dba1a69e95bb166026c7c449a520e075d16", "PPSA01736_00": "a64f774fe43b2b81086fe57fc708025fddbaff9d3b802a7d7f27d9f25d696e0d", "PPSA01825_00": "7ca5007d9ff45d7ca9793e099cd92f7e42931d9fe864fa2878f798c62b8c425e", "PPSA01950_00": "645c925d35ba1767cdbee7228df8a0b2dcd01d46a200a1dfe496552f93789e62", "PPSA02110_00": "135d1850b6c1fe5feaf6e53c3fbddc89421b4313664edb820b59ad03d01d3d5b", "PPSA01326_00": "a62592dd11d72713e4f42d51209e7b70861ac18141c4e33aba0a41c953d3ab34", "PPSA01344_00": "1a7c015fc412be30c6ed801a187f807673f710ab8d759c9fa47fee94bb0f1a65", "PPSA01412_00": "254fb5cf0d997bff6d4609a4cc286fba261c44358fe56ce1c5d11b36be774a29", "PPSA01461_00": "d21fa8f46d714840f079f215696c5291547d3e059e7f6db80a8ba26b448c2026", "PPSA01463_00": "d1b383bdef69693691cf0836c647f5202208e6d1804efe17af1f8b3f92170f64", "PPSA01488_00": "d85e1077146685600871d1a3d940191365ca7dc409d61297c215a729c595bfc6", "PPSA01490_00": "d54f26b3ae0b2ddf984917b685ca01082e92cfe47c2f575efcf8e2f508598916", "PPSA01506_00": "73d8ee97378a16137de0cd2a574ab362a9e44299f54a2bb520f399efbbda82ae", "PPSA01551_00": "1f680b9f68c5b374109caeaedd989aba180312eca6aa107d7a1e03643d6ee762", "PPSA01619_00": "11409212b7d315c00e3e84d1cf73257d46c694969f5beb17c3bdc94d327aa9e9", "PPSA01826_00": "d5cff0cc22398c4e0e078881bef862b05ed2a17fe0af2063646f8b8f905d3840", "PPSA01861_00": "cc39c5ee8610dd957274845ac1c3d26e36f670be2ff6e8d6190faea8569c3076", "PPSA01862_00": "c7e813650b75fce42b02f6c4a97f7dbceef6fceb247fc0987154873c0dd86a86", "PPSA01923_00": "f5c8e495ae0565b4f0f2cee1068e98ae303e68a29c8238a36c5fad57512cc999", "PPSA01980_00": "19db4b6bf3b88079b1413f95d4cc6c4c91c8e388026156399700875b76f1f70b", "PPSA02049_00": "ea22957eba38538b7d1c14b18d738fc37550f10458c9d58b7a275637a20e9e28", "PPSA02329_00": "b3f667226f94dbce6acd641fef4fbcc125993c8570a7d98cefbf691aaeaa641b", "PPSA01430_00": "f571309e33b4f83d275669edc32bb601cd16c95be38964fc3523396a5a94374e"}
And from ps5_xml_update_checker.py:
Code:
#!/usr/bin/env python3
import os
import json
import urllib.request
import urllib.error
import hashlib
import sys
import datetime
import subprocess
import time
import ssl
import csv
ssl._create_default_https_context = ssl._create_unverified_context

def conver_date_format(CURRENT_LASTMODIFIED):
    modified_yyyy = CURRENT_LASTMODIFIED[12:16]
    modified_month = CURRENT_LASTMODIFIED[8:11]

    if   modified_month == 'Jan':
        modified_mm = '01'
    elif modified_month == 'Feb':
        modified_mm = '02'
    elif modified_month == 'Mar':
        modified_mm = '03'
    elif modified_month == 'Apr':
        modified_mm = '04'
    elif modified_month == 'May':
        modified_mm = '05'
    elif modified_month == 'Jun':
        modified_mm = '06'
    elif modified_month == 'Jul':
        modified_mm = '07'
    elif modified_month == 'Aug':
        modified_mm = '08'
    elif modified_month == 'Sep':
        modified_mm = '09'
    elif modified_month == 'Oct':
        modified_mm = '10'
    elif modified_month == 'Nov':
        modified_mm = '11'
    elif modified_month == 'Dec':
        modified_mm = '12'

    modified_dd = CURRENT_LASTMODIFIED[5:7]
    modified_hh = CURRENT_LASTMODIFIED[17:19]
    modified_mn = CURRENT_LASTMODIFIED[20:22]
    modified_ss = CURRENT_LASTMODIFIED[23:25]

    modified_mmdd = modified_mm + modified_dd
    modified_hhmnss = modified_hh + modified_mn + modified_ss

    return modified_yyyy + modified_mmdd + '_' + modified_hhmnss

def get_hash_value(data, algo='sha256'):
    h = hashlib.new(algo)
    h.update(data)
    return h.hexdigest()


def wait_interval():
    # チェック中(1) or 待機中(0)かをテキストに書き出し

    with open('C:/Settings/running.txt', 'w') as f:
        f.write('0')

    print('waiting...')
    count = 0
    while count < 3600 * 1:
        time.sleep(10)
        count += 10
        dt_now = datetime.datetime.now()
        print(dt_now, '\r', end='')

    # while True:
    #     time.sleep(10)
    #
    #     dt_now = datetime.datetime.now()
    #     print(dt_now, '\r', end='')
    #     print()
    #     print(dt_now.strftime('%H'))
    #     if dt_now.strftime('%H') != '05':
    #         continue
    #     print()
    #     break
    time.sleep(10) # スリープ復帰後だった場合のwait

    with open('C:/Settings/running.txt', 'w') as f:
        f.write('1')


def snoretoast(title='Snoretoast', comment='Comment', icon_path=''):
    snoretoast_exe = 'C:/bin/snoretoast/snoretoast.exe'
    if not os.path.isfile(snoretoast_exe):
        raise
    cmd = [snoretoast_exe, '-t', title, '-p', icon_path, '-m', comment, '-silent']
    subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)


def git_commit():
    cmd = ['git', 'add', '.']
    proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    print(proc.stdout.decode('utf8'))

    cmd = ['git', 'commit', '-a', '-m', 'Update xml']
    proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    print(proc.stdout.decode('utf8'))

    cmd = ['git', 'push', 'origin', 'master']
    proc = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    print(proc.stdout.decode('utf8'))


def download_ps5_xml_tsv(url):
    with urllib.request.urlopen(url) as res, open('PS5_XML.tsv', mode='wb') as f:
        f.write(res.read())


def main():
    print('waiting...')
    time.sleep(10)
    while True:
        #download_ps5_xml_tsv(sys.argv[1])

        xml_link_dict = {}
        in_file = 'PS5_XML.tsv'
        with open(in_file, encoding='utf-8') as f_in:
            f_in.readline()
            for row in csv.reader(f_in, delimiter='\t'):
                title_id = f'{row[0][7:16]}_00'
                title_name = row[1]
                xml_link = row[2]
                xml_link_dict[title_id] = {'XML_LINK': xml_link, 'TITLE_NAME': title_name}

        in_file = 'XML_HASH.json'
        with open(in_file) as f_in:
            xml_hash_dict = json.load(f_in)




        snoretoast('PS5 XML Check', 'チェック開始')
        start = time.time()
        for title_id in xml_link_dict:
            xml_link = xml_link_dict[title_id]['XML_LINK']
            xml_file_name = xml_link.split('/')[-1]
            title_name = xml_link_dict[title_id]['TITLE_NAME']


            try:
                with urllib.request.urlopen(xml_link) as res:
                    headers = res.getheaders()
                    ps5_xml = res.read()

                    for i in headers:
                        if i[0] == 'Last-Modified':
                            xml_date = conver_date_format(i[1])
                            break
            except urllib.error.HTTPError as err:
                if err.code == 404:
                    print(f'error {err.code}')
                    continue
                elif err.code == 403:
                    snoretoast('PS5 XML Check', f'ERROR! http_code: {err.code}')
                    sys.exit(-1)
            except urllib.error.URLError as err:
                print(f'error {err}')

            print(f'xml link  : {xml_link}')
            print(f'file_name : {xml_file_name}')
            print(f'title_name: {title_name}')
            print(f'xml_date  : {xml_date}')
            print()

            sha256_hash = get_hash_value(ps5_xml)

            try:
                if sha256_hash == xml_hash_dict[title_id]:
                    continue
            except KeyError:
                pass
            xml_hash_dict[title_id] = sha256_hash
            out_file = 'XML_HASH.json'
            with open(out_file, mode='w') as f_out:
                json.dump(xml_hash_dict, f_out)

            os.makedirs(f'PS5_XML/{title_id}/{xml_date}_{sha256_hash}', exist_ok=True)
            out_file = f'PS5_XML/{title_id}/{xml_date}_{sha256_hash}/{xml_file_name}'
            with open(out_file, mode='wb') as f_out:
                f_out.write(ps5_xml)

            out_file = 'LOG/update_check.log'
            with open(out_file, mode='a', encoding='utf-8') as f_out:
                f_out.write(f'{xml_date} XML更新 {title_id} {title_name}\n'            snoretoast('PS5 XML Check', f'XML 更新 {title_id} | {title_name}')

        git_commit()
        wait_interval()


if __name__ == '__main__':
    main()
Feel free to share your findings with others on the PS5 Scene Forums, and remember everyone is also encouraged to contribute to both the PS5DevWiki and PS5Tools Github repository as more people are able to Obtain a PlayStation 5 Console to work with in coming months. :tup:
PS5 PKG Update Links and PS5 XML Update Checker Python Script.jpg
 

Comments

Status
Not open for further replies.

:fire: Latest Help Topics

Top