Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Begin option not working. #219

Closed
kyranet opened this issue Sep 2, 2017 · 1 comment
Closed

Begin option not working. #219

kyranet opened this issue Sep 2, 2017 · 1 comment
Labels

Comments

@kyranet
Copy link

kyranet commented Sep 2, 2017

Similar to #200, I'm trying to make the stream start at a certain moment, tried with the following formats: "0:02:48:000", "2min 48s", "2 min 48 s", even "2m" and "3m", and in milliseconds: 168000 but the stream starts at 0:00:00:000 from the beggining. Also tried shorter times, "6s" and "10s", same issue.

Code

const stream = ytdl(this.queue[0].url, { begin, filter: (format) => !format.bitrate && format.audioEncoding === 'opus' })
    .on('error', err => this.client.emit('log', err, 'error'));

this.dispatcher = this.connection.playStream(stream, { passes: 5 });

Tried with songs which a duration longer than 3, 4 and 7 minutes. It starts from zero.

Later, I tried using range instead of begin:

const stream = ytdl(this.queue[0].url, { range: { start: 168000 }, filter: (format) => !format.bitrate && format.audioEncoding === 'opus' })
    .on('error', err => this.client.emit('log', err, 'error'));

this.dispatcher = this.connection.playStream(stream, { passes: 5 });

And it simply doesn't stream until I change the value of start to 0. (Tried with a few milliseconds, didn't work.)

@fent
Copy link
Owner

fent commented Sep 3, 2017

This option has been pretty unreliable. I just tried it with a random video, it worked for the default format, but not for the first format with the audioonly and videoonly filters.

I can add another note about this. I'm also considering removing it entirely, it's not reliable at all.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants