skick1234 / DisTube

A powerful Discord.js module for simplifying music commands and effortless playback of various sources with integrated audio filters.
https://distube.js.org
MIT License
422 stars 95 forks source link

DisTubeError [FFMPEG_EXITED]: ffmpeg exited with code 3436169992 only while playing on youtube platform #333

Open Tarekthedeveloper opened 1 month ago

Tarekthedeveloper commented 1 month ago

When playing music using youtube platform it play normally around 10h then the ffmpeg say that it exited with code 3436169992 but when using another platform like soundcloud,spotify,deezer the bot play normally .

Note that the ffmpeg is installed on the system path

skick1234 commented 1 month ago

You have to check the ffmpeg log with ffmpegDebug event to know exactly why it happens. But I think it is due to expired stream url.

Tarekthedeveloper commented 1 month ago

You have to check the ffmpeg log with ffmpegDebug event to know exactly why it happens. But I think it is due to expired stream url.

FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: size= 22608KiB time=00:02:00.76 bitrate=1533.6kbits/s speed=1.01x FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: [tls @ 000002cb85936d80] Error in the pull function. FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: [tls @ 000002cb85936d80] IO error: Error number -10054 occurred FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: [https @ 000002cb85932ac0] Will reconnect at 2064384 in 0 second(s), error=Error number -10054 occurred. FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: [https @ 000002cb85932ac0] HTTP error 403 Forbidden FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: [tls @ 000002cb85936d80] The specified session has been invalidated for some reason. FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: [https @ 000002cb85932ac0] Will reconnect at 2064384 in 1 second(s), error=I/O error. FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: size= 22743KiB time=00:02:01.34 bitrate=1535.4kbits/s speed=1.01x FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: size= 22746KiB time=00:02:01.34 bitrate=1535.7kbits/s speed=1.01x FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: [https @ 000002cb85932ac0] HTTP error 403 Forbidden FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: [tls @ 000002cb85936d80] The specified session has been invalidated for some reason. FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: [https @ 000002cb85932ac0] Will reconnect at 2064384 in 3 second(s), error=I/O error. FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: size= 22746KiB time=00:02:01.34 bitrate=1535.7kbits/s speed=1.01x FFMPEG_DEBUG: [1267535651541090305] [ffmpeg] log: size= 22746KiB time=00:02:01.34 bitrate=1535.7kbits/s speed= 1x FFMPEG_DEBUG: [1267535651541090305] [stream] error: Premature close FFMPEG_DEBUG: [1267535651541090305] [process] exit: code=unknown signal=SIGKILL

skick1234 commented 1 month ago

It means your stream url is not accessable due to youtube antibot system. Update @distube/ytdl-core and try adding cookies. https://github.com/skick1234/DisTube/wiki/YouTube-Cookies

Or just simply because the url is expired after hours .-.

Tarekthedeveloper commented 1 month ago

It means your stream url is not accessable due to youtube antibot system. Update @distube/ytdl-core and try adding cookies. https://github.com/skick1234/DisTube/wiki/YouTube-Cookies

Or just simply because the url is expired after hours .-.

I'am already use the @distube/ytdl-core latest update and there is already cookies but the same error happen

This is part of distube setup :

client.distube = new DisTube(client, {
        customFilters: {
            equalizer: 'equalizer=f=1000:t=q:w=1:g=5',
            bassboost: 'bass=g=10',
            trebleboost: 'treble=g=5',
            normalize: 'volume=1.0',
            compression: 'compand=audioreplay_gain=1', 
            reverb: 'aecho=0.8:0.9:1000:0.3' 
        },
  plugins: [new YouTubePlugin({cookies: JSON.parse(fs.readFileSync("cookies.json"))

}),new SoundCloudPlugin(), new SpotifyPlugin() , new YtDlpPlugin()],

})
MiekoHikari commented 1 month ago

From my investigation I've found that the youtube API now requires a new parameter called potoken to be passed in the URL

Tarekthedeveloper commented 1 month ago

So how can we solve this problem ?