{"id":18250583,"url":"https://github.com/asivery/networkwm-js","last_synced_at":"2025-04-04T16:31:31.863Z","repository":{"id":241673102,"uuid":"807362292","full_name":"asivery/networkwm-js","owner":"asivery","description":"A typescript library for accessing Sony Network Walkman devices","archived":false,"fork":false,"pushed_at":"2025-03-15T23:26:16.000Z","size":231,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T23:27:53.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asivery.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-29T00:44:14.000Z","updated_at":"2025-03-15T23:26:17.000Z","dependencies_parsed_at":"2024-08-16T19:43:02.204Z","dependency_job_id":"e60f607d-b94c-420f-914b-babd485c28c8","html_url":"https://github.com/asivery/networkwm-js","commit_stats":null,"previous_names":["asivery/networkwm-js"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetworkwm-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetworkwm-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetworkwm-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asivery%2Fnetworkwm-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asivery","download_url":"https://codeload.github.com/asivery/networkwm-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247209393,"owners_count":20901767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T09:45:15.137Z","updated_at":"2025-04-04T16:31:31.565Z","avatar_url":"https://github.com/asivery.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Work In Progress!!\n\n## JS library for accessing Sony Network Walkmen\n\nThis library aims to provide support for managing audio content on Sony Network Walkman devices.\nIt supports the same functionality as SonicStage - the original Sony application required to communicate with them.\n\nFor now, it is impossible to use this library as a standalone application - there's no CLI available.\n\n## What features are available?\n\n- [x] Track upload (ATRAC3 / ATRAC3+)\n- [x] DRM reimplementation\n- [X] Fetching contents' list\n- [X] Track upload (MP3)\n- [X] Track metadata editing (Title / Album / Artist / Genre)\n- [X] Track moving\n- [X] Track deletion\n- [X] OMA file decryption\n- [X] MP3 device leaf ID derivation\n\n## How to incorporate it into your project?\n\nThe library piggybacks on [himd-js](https://github.com/asivery/himd-js) to provide low-level filesystem and SCSI functionality.\nBecause of how the DRM requires vendor SCSI commands to be sent to the Network Walkman, it is impossible to upload a track and have it play on the device without SCSI access, but similarly to himd-js, it provides a way to edit the player's metadata.\n\n### 1 - Metadata access only\n\nIn this mode, it's only possible to read and write tracks' metadata (titles, track play order, etc.)\n\n**It is not possible to upload ATRAC3/3+/PCM with this mode.**\n\nExample:\n```ts\nasync function example(){\n    // When using Node.JS:\n    const fs = new NativeHiMDFilesystem(\"/path/to/HiMD/root\");\n\n    const database = await DatabaseAbstraction.create(fs);\n}\n```\n\n### 2 - Direct mode (USB Mass Storage Controller mode)\n\nBecause this mode takes full control over the Network Walkman, and can issue direct SCSI commands, it's possible to upload ATRAC3/3+ audio.\n\nAll the examples from mode 1 which utilize the `DatabaseManager` object still work.\n\nExample:\n```ts\nasync function example(){\n    await initCrypto();\n    importKeys(...);\n    const _dev = await openNewDeviceNode();\n    if(!_dev) {\n        console.log(\"Could not connect!\");\n        return;\n    }\n    const { dev, name } = _dev;\n    console.log(`Connected to ${name}`);\n    const fs = await createNWJSFS(dev, false);\n    // Open a writing session\n    const session = new UMSCNWJSSession(fs.driver as SonyVendorNWJSUSMCDriver, fs);\n    await session.performAuthorization();\n\n    const database = await DatabaseAbstraction.create(fs);\n\n    // Read the track\n    const trackContents = new Uint8Array(nodeFs.readFileSync(\"/path/to/raw/atrac.wav\")).slice(0x60);\n    const codec = generateCodecInfo(\"A3+\", HiMDKBPSToFrameSize.atrac3plus[352]);\n    database.uploadTrack({\n        album: \"Foobar - The Greatest Hits\",\n        artist: \"Foobaz\",\n        genre: \"Bar\",\n        title: \"Foobar\",\n        trackDuration: -1,\n        trackNumber: -1, // Guess the track number\n    }, codec, trackContents, session);\n\n    await database.flushUpdates();\n    await session.finalizeSession();\n}\n```\n\nIt is also possible to use this library to simply sign the device, so that it plays audio which could have been copied across from a different Network Walkman. To do that, it's simply enough to perform the authorization, and then finalize the session straightaway.\n\n```typescript\nasync function example(){\n    await initCrypto();\n    importKeys(...);\n    const _dev = await openNewDeviceNode();\n    if(!_dev) {\n        console.log(\"Could not connect!\");\n        return;\n    }\n    const { dev, name } = _dev;\n    console.log(`Connected to ${name}`);\n    const fs = await createNWJSFS(dev, false);\n\n    // Start a new session...\n    const session = new UMSCNWJSSession(fs.driver as SonyVendorNWJSUSMCDriver, fs);\n    await session.performAuthorization();\n    // ...and terminate it\n    await session.finalizeSession();\n    // At this point, the Walkman should play the audio.\n}\n```\n\n### Credits\n- Thank you to M Karcher over at the MiniDisc.wiki Discord server for explaining how the OpenMG keys deriving and SCSI authentication works\n- The [rustystage](https://github.com/antoyo/rustystage) project provided excellent documentation of the database format.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasivery%2Fnetworkwm-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasivery%2Fnetworkwm-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasivery%2Fnetworkwm-js/lists"}