lavalink-devs / lavaplayer

Lavaplayer fork maintained by Lavalink
Apache License 2.0
186 stars 51 forks source link

Invalid status code for access token tv response: 400 #69

Closed austin3410 closed 7 months ago

austin3410 commented 8 months ago

I'm running into this error on my Lavalink server. I started by submitting a form post on the Lavalink Discord but was directed here as a possible bug report.

Background: Developing a Discord bot using the Wavelink library to communicate with my Lavalink server. The bot and Lavalink server are being hosted within the same Ubuntu environment.

Sometimes when autoplay is set to enabled. Lavalink can't find related tracks to the one that was playing.

I'm not sure but I believe it has to do with the initial track, or the search term that was used to play the initial track. I also see in the logs that it fails to update my YouTube access token but there are times when autoplay still works with this error. I don't have MFA enabled on this YouTube account.

Lavalink version: 4.0.3 Wavelink version: 3.2.0

I'm happy to provide any other information.

Lavalink log file: spring.log

application.yml file:

server: # REST and WS server
  port: 2333
  address: 127.0.0.1
  http2:
    enabled: true # Whether to enable HTTP/2 support
plugins:
#  name: # Name of the plugin
#    some_key: some_value # Some key-value pair for the plugin
#    another_key: another_value
lavalink:
  plugins:
#    - dependency: "com.github.example:example-plugin:1.0.0" # required, the coordinates of your plugin
#      repository: "https://maven.example.com/releases" # optional, defaults to the Lavalink releases repository by default
#      snapshot: false # optional, defaults to false, used to tell Lavalink to use the snapshot repository instead of the release repository
#  pluginsDir: "./plugins" # optional, defaults to "./plugins"
#  defaultPluginRepository: "https://maven.lavalink.dev/releases" # optional, defaults to the Lavalink release repository
#  defaultPluginSnapshotRepository: "https://maven.lavalink.dev/snapshots" # optional, defaults to the Lavalink snapshot repository
  server:
    password: "youshallnotpass124"
    sources:
      youtube: true
      bandcamp: true
      soundcloud: true
      twitch: false
      vimeo: true
      http: true
      local: false
    filters: # All filters are enabled by default
      volume: true
      equalizer: true
      karaoke: true
      timescale: true
      tremolo: true
      vibrato: true
      distortion: true
      rotation: true
      channelMix: true
      lowPass: true
    bufferDurationMs: 400 # The duration of the NAS buffer. Higher values fare better against longer GC pauses. Duration <= 0 to disable JDA-NAS. Minimum of 40ms, lower values may introduce pauses.
    frameBufferDurationMs: 5000 # How many milliseconds of audio to keep buffered
    opusEncodingQuality: 10 # Opus encoder quality. Valid values range from 0 to 10, where 10 is best quality but is the most expensive on the CPU.
    resamplingQuality: LOW # Quality of resampling operations. Valid values are LOW, MEDIUM and HIGH, where HIGH uses the most CPU.
    trackStuckThresholdMs: 10000 # The threshold for how long a track can be stuck. A track is stuck if does not return any audio data.
    useSeekGhosting: true # Seek ghosting is the effect where whilst a seek is in progress, the audio buffer is read from until empty, or until seek is ready.
    youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
    playerUpdateInterval: 5 # How frequently to send player updates to clients, in seconds
    youtubeSearchEnabled: true
    soundcloudSearchEnabled: true
    gc-warnings: true
    #ratelimit:
      #ipBlocks: ["1.0.0.0/8", "..."] # list of ip blocks
      #excludedIps: ["...", "..."] # ips which should be explicit excluded from usage by lavalink
      #strategy: "RotateOnBan" # RotateOnBan | LoadBalance | NanoSwitch | RotatingNanoSwitch
      #searchTriggersFail: true # Whether a search 429 should trigger marking the ip as failing
      #retryLimit: -1 # -1 = use default lavaplayer value | 0 = infinity | >0 = retry will happen this numbers times
    youtubeConfig: # Required for avoiding all age restrictions by YouTube, some restricted videos still can be played without.
      email: "<myuser>" # Email of Google account
      password: "<mypass>" # Password of Google account
    #httpConfig: # Useful for blocking bad-actors from ip-grabbing your music node and attacking it, this way only the http proxy will be attacked
      #proxyHost: "localhost" # Hostname of the proxy, (ip or domain)
      #proxyPort: 3128 # Proxy port, 3128 is the default for squidProxy
      #proxyUser: "" # Optional user for basic authentication fields, leave blank if you don't use basic auth
      #proxyPassword: "" # Password for basic authentication

metrics:
  prometheus:
    enabled: false
    endpoint: /metrics

sentry:
  dsn: ""
  environment: ""
#  tags:
#    some_key: some_value
#    another_key: another_value

logging:
  file:
    path: ./logs/

  level:
    root: INFO
    lavalink: DEBUG
    lavalink.server.io.SocketContext: TRACE

  request:
    enabled: true
    includeClientInfo: true
    includeHeaders: false
    includeQueryString: true
    includePayload: true
    maxPayloadLength: 10000

  logback:
    rollingpolicy:
      max-file-size: 10GB
      max-history: 30
aikaterna commented 8 months ago

It looks like the url you are requesting in the log, watch?v=aWiHyDAqCCI8&list=RDaWiHyDAqCCI, has an extra "8" in the video id, which causes a redirect when you visit it. It seems like you want watch?v=aWiHyDAqCCI&list=RDaWiHyDAqCCI instead.

austin3410 commented 8 months ago

It looks like the url you are requesting in the log, watch?v=aWiHyDAqCCI8&list=RDaWiHyDAqCCI, has an extra "8" in the video id, which causes a redirect when you visit it. It seems like you want watch?v=aWiHyDAqCCI&list=RDaWiHyDAqCCI instead.

Is this in my ability to fix? I'm not doing any sort of URL manipulation on my side.

chianti-ga commented 8 months ago

Having the same sort of problem for a discord bot

topi314 commented 8 months ago

this could potentially fixed by https://github.com/lavalink-devs/lavaplayer/pull/70

topi314 commented 8 months ago

@austin3410 @skitou can you see if this lavalink build fixes the issue? https://github.com/lavalink-devs/Lavalink/commit/9a6c9d4e73108b7e66c8f3663e62d31137733777

kyleyannelli commented 8 months ago

@topi314 Can confirm 727959e9f621fc457b3a5adafcfffb55fdeaa538-SNAPSHOT seems to solve the issue with my project.

austin3410 commented 8 months ago

@austin3410 @skitou can you see if this lavalink build fixes the issue? lavalink-devs/Lavalink@9a6c9d4

I'd also like to see if this build fixes my issue but I'm not familiar enough with GitHub to know how to download that specific build. I'm using the .jar file from the master release. Do I have to compile my own .jar in this case?

topi314 commented 8 months ago

Click on the commit Click on the green checkmark There will be a download link

austin3410 commented 8 months ago

Thank you!

austin3410 commented 8 months ago

@austin3410 @skitou can you see if this lavalink build fixes the issue? lavalink-devs/Lavalink@9a6c9d4

My problems are still occurring with the snapshot build. Same errors as previous.

JustRed23 commented 8 months ago

Having the same issues, status code 400 on ytsearch

Alokura commented 7 months ago

Having the same, Invalid status code for video page response: 400

thaddeuskkr commented 7 months ago

pulled docker tag fix-yt-400 and it seems to fix

crackedpotato007 commented 7 months ago

Using the fix-yt-400 docker image, seems to me the trackStart event is not fired at all. I am using moonlink.js And such a event is not received at all, only playerUpdates after the track starts playing

topi314 commented 7 months ago

there are no changes regarding sending track starts whatsoever in this build. this is most likely a client issue and off-topic for here

Perdition0 commented 7 months ago

I have this problem and I'm using this version

pulled docker tag fix-yt-400 and it seems to fix

lucawen commented 7 months ago

It was fixed with fix-yt-400 docker tag. Do you have any updates on when this will be merged at main docker tag? Thanks for all the support.

hellblazer24 commented 7 months ago

I can confirm using branch fix-yt-400 fixes the issues. Perhaps the 2.0.1 lavaplayer is outdated due to Youtube making some changes to their backends.

Mortezanavidi commented 7 months ago

branch fix-yt-400 has problems with lavasrc 4.0.1

hellblazer24 commented 7 months ago

branch fix-yt-400 has problems with lavasrc 4.0.1

Make sure you use lavasrc-plugin-4.0.1.jar

Mortezanavidi commented 7 months ago

branch fix-yt-400 has problems with lavasrc 4.0.1

Make sure you use lavasrc-plugin-4.0.1.jar

as i mentioned, i am using specifically that version of plugin for fix-yt-400, it works fine with lavalink v4

topi314 commented 7 months ago

this should now be fixed in https://github.com/lavalink-devs/lavaplayer/releases/tag/2.1.1 and https://github.com/lavalink-devs/lavaplayer/releases/tag/1.5.3

I'm locking this issue, please open a new issue when you encounter new errors