|
|
|
@ -9,9 +9,7 @@ import Alamofire |
|
|
|
class NetworkManager { |
|
|
|
static let sharedInstance = NetworkManager() |
|
|
|
|
|
|
|
let localurl = "http://192.168.178.93:8081/" |
|
|
|
let nodeurl = "http://linkstation:8081/" |
|
|
|
let baseurl = "http://linkstation:8080/tomcat/media" |
|
|
|
let vidurl = "http://linkstation:8089" |
|
|
|
|
|
|
|
var offline = false |
|
|
|
@ -619,23 +617,6 @@ class NetworkManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func grab(url: URL, cookies: String?, result: @escaping (String) -> ()) { |
|
|
|
var queryItems = [URLQueryItem(name: "url", value: url.absoluteString)] |
|
|
|
|
|
|
|
if let c = cookies { |
|
|
|
queryItems.append(URLQueryItem(name: "cookies", value: c)) |
|
|
|
} |
|
|
|
|
|
|
|
var urlComps = URLComponents(string: localurl)! |
|
|
|
urlComps.queryItems = queryItems |
|
|
|
let p = urlComps.url! |
|
|
|
|
|
|
|
AF.request(p).responseJSON { |
|
|
|
(response) in |
|
|
|
result("ok") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func downloadToServer(path: String, url: URL, cookies: String?, result: @escaping (String) -> ()) { |
|
|
|
let date = Date() |
|
|
|
let format = DateFormatter() |
|
|
|
|