-
Notifications
You must be signed in to change notification settings - Fork 434
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
video-ids output format for list cmd #177
base: master
Are you sure you want to change the base?
Conversation
plainWriter(w) | ||
writer, ok := writers[outputFormat] | ||
if !ok { | ||
return errUnhandledFormat(outputFormat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the flag is handled by addFormatFlag
which prints 4 formats. For info cmd, this new format is not implemented. Maybe when info cmd accepts multiple URLs we can extract all video IDs the same way as list cmd does in this PR?
./youtubedr-dev info <videoID> --format video-ids
unhandled output format: video-ids
./youtubedr-dev list <playlistID> --format video-ids
JTRqppn4vNo lhbytXY9gEs 7Y7m3uMRNak GjhRMetsok0 fePN2EFK5bU 7sX44EkgTds sAb-ogxZIAI kv-8SeTfT0k CHvhcM_Rvlo -075jrjea4Q ZgHrrkG175M KK58lRTSn5I iIfgwENiL3o VNNXO4DIHUo
Which problem does this pull request solve? Do you want to download all videos of a playlist? |
This PR tries to export directly a list of IDs separated by space, which can be piped into other tools. Download a playlist is one of the goals, this can be (and I would like to propose a PR) done in download cmd, if it detects a playlist then it will download all media from playlist. The format Currently I used this command after list cmd is implemented
Feel free to decline the PR @corny |
What do you think about adding CSV as output format and optionally selecting the columns? If you want all video IDs, you can just select the videoID column and skip the first line (column header). |
Like this? nice idea. I'll change the PR this wk. |
It's better to have column headers without spaces. Example:
Or just IDs without headers:
Just use NewWriter() from the |
6ef3171
to
bc29310
Compare
4da7717
to
a22d61b
Compare
Description
Maybe useful to avoid using jq to reformat.
Usage could be:
Issues to fix
Please link issues this PR will fix:
#[issue number]
if no relevant issue, but this will fix something important for reference
, please free to open an issue.
Reminding
Something you can do before PR to reduce time to merge