Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Repair ps3 rap urls and make filenames pretty #66

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions NPS Browser/models/TSVData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ struct TSVData {
default: break
}
case .PS3:
let baseURL = "https://nopaystation.com/rap2file/?"
let baseURL = "https://nopaystation.com/tools/rap2file/"
name = values[2]
pkgDirectLink = values[3]
rap = values[4]
contentId = values[5]
lastModificationDate = parseDate(dateString: values[6])
downloadRapFile = "\(baseURL)&contentid=\(values[5])&rap=\(values[4])"
downloadRapFile = "\(baseURL)\(values[5])/\(values[4])"
fileSize = Int64(values[8])
sha256 = values[9]
case .PSP:
Expand Down
5 changes: 4 additions & 1 deletion NPS Browser/services/DownloadManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ class DownloadManager {
func getDestination(data: DLItem) -> DownloadRequest.DownloadFileDestination {
let destination: DownloadRequest.DownloadFileDestination = { request, response in
// .pkg filename
let pathComponent = response.suggestedFilename!
var pathComponent = response.suggestedFilename!
if let unwrappedName = data.name {
pathComponent = "\(unwrappedName).\(URL(fileURLWithPath: pathComponent).pathExtension)"
}
let cf = data.consoleType

var path: URL = Defaults[.dl_library_folder] ?? URL(string: try! Folder.home.subfolder(named: "Downloads").path)!
Expand Down