Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Don't return Err result when ytdl produces a warning #37

Closed
alecks opened this issue Jan 13, 2021 · 4 comments
Closed

Don't return Err result when ytdl produces a warning #37

alecks opened this issue Jan 13, 2021 · 4 comments
Labels
feature-request Request for addition of a new feature or improvement.

Comments

@alecks
Copy link

alecks commented Jan 13, 2021

Youtube-dl warning messages are written to stderr, causing songbird::ytdl to fail if one is produced. Since it's usually not fatal, I think that whether or not it should continue should be configurable.

@FelixMcFelix
Copy link
Member

Thanks for raising this. Could you give some indication of the sort of warning/error that can pop up, or an example URL that's triggering failure?

Feel free to PR a new variant function which forcibly ignores errors, or that silences warning from youtube-dl. 😄

@FelixMcFelix FelixMcFelix added the feature-request Request for addition of a new feature or improvement. label Jan 13, 2021
@alecks
Copy link
Author

alecks commented Jan 14, 2021

WARNING: Assuming --restrict-filenames since file system encoding cannot encode all characters. Set the LC_ALL environment variable to fix this. is pretty common, but it's possible (though not the best idea) to ignore it. Would it be okay to use tracing::warn for only warning messages in the original function?

@FelixMcFelix
Copy link
Member

It should be, if you can find a way to reasonably/safely separate them out from any actual errors. Keep in mind that the track metadata is also output on stderr, and is siphoned off accordingly so that we can get away with fewer calls to youtube-dl (and fewer network requests).

Otherwise, please add --no-warnings to the default argument list.

@vilgotf
Copy link
Contributor

vilgotf commented Jan 23, 2021

I encountered this recently trying to play https://opus-codec.org/static/examples/samples/speech_orig.wav. yt-dl can download it, but songbird says that the warning "Falling back on generic information extractor" is an error thus failing to play

FelixMcFelix added a commit to FelixMcFelix/songbird that referenced this issue Jan 26, 2021
Simple enough change to handle this for now, in that it just tells ytdl to silence errors.

Closes serenity-rs#37.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for addition of a new feature or improvement.
Projects
None yet
Development

No branches or pull requests

3 participants