twitch-dl
twitch-dl copied to clipboard
Return output as well instead of only printing
It would be nice if the data that's printed (especially when using the json flag) would be returned by the function instead of only printing it It would make it easier to use the printed data without having to tap into stdout to retrieve the data
Sorry for sitting on this for such a long time.
I'm confused why you need info
to return the data. You can instead write a couple of lines of code which have the same result:
from twitchdl import twitch
video_id = "1657460453"
video = twitch.get_video(video_id)
access_token = twitch.get_access_token(video_id)
playlists = twitch.get_playlists(video_id, access_token)
I'm hesitant to merge the PR because I would prefer that the functions which implement console commands don't return any value.
No worries for taking your time!
You are right, it's not needed at all and your reason to not merge the PR is totally understandable. I figured it would just be a QoL improvement if the same function could be used to return the data, as for now it wouldn't change or break anything for the CLI application (although it might in the future)