Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct seeds {
- let encodedSingnature : String
- let seed1 : String
- let seed2 : String
- }
- struct openload {
- static func seedsAnalizer(link: String, completion: @escaping (seeds)->()) {
- var fixedLink = link
- if link.contains("oload.tv") {
- fixedLink = fixedLink.replacingOccurrences(of: "https://oload.tv/embed/", with: "https://openload.co/embed/")
- }
- print(fixedLink)
- Alamofire.request(fixedLink).responseString { response in
- print(response.response?.statusCode)
- if let content: String = response.result.value {
- if response.response?.statusCode == 200 {
- do {
- let doc: Document = try SwiftSoup.parse(content)
- if !content.contains("It maybe got deleted by the owner or was removed due a copyright violation") {
- let encodedSingnature = try doc.select("p").after("<div class=\"\" style=\"display:none;\">").text().replacingOccurrences(of: " 640K ought to be enough for anybody", with: "")
- let seed1 = content.components(separatedBy: "_0x30725e,")[1].components(separatedBy: "),_1x4bfb36)")[0]
- let seed2 = content.components(separatedBy: "_1x4bfb36=")[1].components(separatedBy: ";")[0]
- completion(seeds(encodedSingnature: encodedSingnature, seed1: seed1, seed2: seed2))
- }
- } catch {
- print("error")
- }
- } else {
- print("error need bypass")
- print(response.response?.statusCode as Any)
- } // If status code is different 200
- } // First If
- } // Alamofire
- } // Func
- static func generateLinks(seeds: seeds, completion: @escaping (mp4Links)->()) {
- print(seeds)
- let encodeSingatureStart = seeds.encodedSingnature.prefix(72)
- let encodeSingatureEnds = seeds.encodedSingnature.replacingOccurrences(of: encodeSingatureStart, with: "")
- var ivArray = [Int]()
- var i = 0
- var signature = ""
- while i < encodeSingatureStart.count {
- let startIndex = i
- let endIndex = i + 8
- let start = String.Index(utf16Offset: startIndex, in: encodeSingatureStart)
- let end = String.Index(utf16Offset: endIndex, in: encodeSingatureStart)
- let iv = String(encodeSingatureStart[start..<end]) // This could be wrong
- ivArray.append(Int(iv, radix: 16) ?? 0)
- i = i + 8
- }
- var iv_index = 0
- var x = 0
- while x < encodeSingatureEnds.count {
- var unknown_2 = 0
- var unknown_3 = 0
- var unknown_4 = 0
- repeat {
- let startIndex = x
- let endIndex = x + 2
- let start = String.Index(utf16Offset: startIndex, in: encodeSingatureEnds)
- let end = String.Index(utf16Offset: endIndex, in: encodeSingatureEnds)
- let unknown_5 = String(encodeSingatureEnds[start..<end]) // This could be wrong
- unknown_4 = Int(unknown_5, radix: 16) ?? 0
- let unknown_6 = unknown_4 & 63
- if unknown_3 < 30 {
- unknown_2 = unknown_2 + unknown_6 << unknown_3
- } else {
- unknown_2 = unknown_2 + unknown_6 * Int(pow(Double(2), Double(unknown_3)))
- print(unknown_2)
- }
- unknown_3 = unknown_3 + 6
- x = x + 2
- } while unknown_4 >= 64
- var IV = unknown_2 ^ ivArray[iv_index % 9]
- IV = (IV ^ Int(seeds.seed2)!) ^ Int(seeds.seed1)!
- var unknown_8 = 255
- var j = 0
- while j < 4 {
- let charcode = ((IV & unknown_8) >> (8 * j)) - 1
- let character = String(UnicodeScalar(UInt8(charcode))) // Could be wrong
- if character != "$" {
- signature = signature + character
- print(signature)
- }
- unknown_8 = unknown_8 << 8
- j = j + 1
- }
- iv_index = iv_index + 1
- }
- print("https://openload.co/stream/" + signature)
- completion(mp4Links(link: "https://openload.co/stream/" + signature))
- } // Func
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement