Lorc520

MP3 to DFPWM web request

May 20th, 2025 (edited)
49
0
Never
6
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. local url = "https://remote.craftos-pc.cc/music/upload"
  2.  
  3. -- mp3 name request
  4. print("Please enter the name of your mp3")
  5. local filePath = read()
  6. if not filePath:lower():match("%.mp3$") then
  7. filePath = filePath .. ".mp3"
  8. end
  9.  
  10.  
  11. -- Open the file in binary mode
  12. local file = fs.open(filePath, "rb")
  13. if not file then
  14. print("Failed to open file: " .. filePath)
  15. return
  16. end
  17.  
  18. local fileData = file.readAll()
  19. file.close()
  20.  
  21. -- Perform HTTP POST request
  22. local response = http.post(url, fileData, {
  23. ["Content-Type"] = "application/octet-stream",
  24. ["Content-Length"] = tostring(#fileData)
  25. })
  26.  
  27. -- Handle response
  28. if response then
  29. result = response.readAll()
  30. response.close()
  31. else
  32. print("Upload failed.")
  33. end
  34.  
  35. input = "https://remote.craftos-pc.cc/music/content/" .. result .. ".wav"
  36.  
  37. local clock = os.clock
  38. function sleep(n)
  39. local t0 = clock()
  40. while clock() - t0 <= n do end
  41. end
  42.  
  43.  
  44. local dfpwm = require("cc.audio.dfpwm")
  45. local speaker = peripheral.find("speaker")
  46.  
  47. local response = http.get(input)
  48. if not response then
  49. print("Failed to download audio from URL.")
  50. return
  51. end
  52.  
  53. local decoder = dfpwm.make_decoder()
  54.  
  55. while true do
  56. local chunk = response.read(16 * 1024)
  57. if not chunk then break end
  58.  
  59. local buffer = decoder(chunk)
  60. while not speaker.playAudio(buffer) do
  61. os.pullEvent("speaker_audio_empty")
  62. end
  63. end
  64.  
  65. response.close()
  66.  
  67.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Benalag
    2 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=aieuvjpxhk
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment