question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Base64 encoding is unreliable

See original GitHub issue

Description

I tried to encode this song to a base64 string using Wavelink (was told to report it here): https://www.youtube.com/watch?v=_2zwBWLkZHM

After encoding that, I am writing the base64 string to a database. When the user requests the song from the database, the base64 string can’t get decoded.

The base64 string that wavelink/lavalink gives me is this:

QAAAhwIAIUNoaWxsIGJ5IEpvYWtpbSBLYXJ1ZCBbWm9uZWQgT3V0XQAMSm9ha2ltIEthcnVkAAAAAAAC+bgAC18yendCV0xrWkhNAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9XzJ6d0JXTGtaSE0AB3lvdXR1YmUAAAAAAAAAAA==

Version info

Client used: Wavelink

Lavalink: Version: b16ba2f169212982a2124423a9f2cb236b22f624-SNAPSHOT Build: 1050

Output of java -version:

java 13.0.2 2020-01-14
Java(TM) SE Runtime Environment (build 13.0.2+8)
Java HotSpot(TM) 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)

The log just shows this:

[ XNIO-1 task-14] l.server.player.AudioLoaderRestHandler   : GET /decodetrack

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
freyacodescommented, Jun 11, 2020

It works on my machine™️

curl --request GET \
  --url 'http://localhost:2333/decodetrack?track=QAAAhwIAIUNoaWxsIGJ5IEpvYWtpbSBLYXJ1ZCBbWm9uZWQgT3V0XQAMSm9ha2ltIEthcnVkAAAAAAAC%2BbgAC18yendCV0xrWkhNAAEAK2h0dHBzOi8vd3d3LnlvdXR1YmUuY29tL3dhdGNoP3Y9XzJ6d0JXTGtaSE0AB3lvdXR1YmUAAAAAAAAAAA%3D%3D' \
  --header 'authorization: youshallnotpass'
{
  "identifier": "_2zwBWLkZHM",
  "isSeekable": true,
  "author": "Joakim Karud",
  "length": 195000,
  "isStream": false,
  "position": 0,
  "title": "Chill by Joakim Karud [Zoned Out]",
  "uri": "https://www.youtube.com/watch?v=_2zwBWLkZHM"
}

Also Naegin’s B64:

{
  "identifier": "2yWWFLI5kFU",
  "isSeekable": true,
  "author": "Tom Scott",
  "length": 232000,
  "isStream": false,
  "position": 0,
  "title": "᚛ᚈᚑᚋ ᚄᚉᚑᚈᚈ᚜ and ᚛ᚑᚌᚐᚋ᚜",
  "uri": "https://www.youtube.com/watch?v=2yWWFLI5kFU"
}

I’m disappointed that you didn’t use Tom Scott’s video about YouTube and base64 https://www.youtube.com/watch?v=gocwRvLhDf8

0reactions
realmayuscommented, Jun 11, 2020

Okay, it turns out that it was a bug in Wavelink, not in Lavalink. Thanks a bunch for helping debugging the issue! https://github.com/PythonistaGuild/Wavelink/pull/57 fixed the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bad Base64 Error while using decode - Stack Overflow
The purpose of Base64 is to encode binary data into a text string as a hack to send it somewhere that sends text....
Read more >
Why optimizing images with Base64 is almost always a bad idea
The reason for this is that sharing Base64 images is much harder due to the fact that they are not actually accessible via...
Read more >
Base64 Encoding of "bad" - Online
Encode bad to Base64 format with various advanced options. Our site has an easy to use online tool to convert your data.
Read more >
Is it a bad idea to use base-64 encoded strings for passwords?
Choosing a weak password like 'password' and encoding (encoding offers really no benefit to plain text passwords, here is a site were you...
Read more >
ELI5: Why is it a a bad idea to use base-64 encoding to create ...
Base-64 encoding is fairly recognizable and completely reversible. The second any of your passwords is breached, all of your passwords would be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found