lib/rmega/nodes/node.rb in rmega-0.2.5 vs lib/rmega/nodes/node.rb in rmega-0.2.6

- old
+ new

@@ -19,11 +19,11 @@ @session = session @data = data end def public_url - @public_url ||= "https://mega.co.nz/#!#{public_handle}!#{Utils.base64urlencode(decrypted_file_key)}" + @public_url ||= "https://mega.nz/file/#{public_handle}\##{Utils.base64urlencode(decrypted_file_key)}" end def public_handle @public_handle ||= request(a: 'l', n: handle) end @@ -136,10 +136,11 @@ if shared_key aes_ecb_decrypt(shared_key, file_keys[h]) elsif file_key aes_ecb_decrypt(master_key, file_key) else - Utils.base64urldecode(public_url.split('!').last) + ary = Rmega::Nodes::Factory.public_handle_and_key_from_url(public_url) + Utils.base64urldecode(ary[1]) end end def attributes encrypted = data['a'] || data['at']