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

Get playlist title / name only. without downloading files #23442

Closed
BlisteringSyko opened this issue Dec 17, 2019 · 2 comments
Closed

Get playlist title / name only. without downloading files #23442

BlisteringSyko opened this issue Dec 17, 2019 · 2 comments
Labels

Comments

@BlisteringSyko
Copy link

@BlisteringSyko BlisteringSyko commented Dec 17, 2019

Checklist

  • I'm asking a question
  • I've looked through the README and FAQ for similar questions
  • I've searched the bugtracker for similar questions including closed ones

Question

Hello,

I'm trying to get just the name of a playlist in a bash script without downloading the files. I've gone through the manual multiple times and put forth my best google foo.

Currently I'm downloading an entire playlist into a folder with a random name, then zipping it up before offering it to my users. Id just like to get that zip file named after the playlist and not jibberish. Ive tried to awk and sed with various options with no luck.

youtube-dl 2019.11.28
Ubuntu 19.04

Thanks.

@BlisteringSyko BlisteringSyko changed the title Get playlist title / name only without downloading files Get playlist title / name only. without downloading files Dec 17, 2019
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Dec 17, 2019

-J, --dump-single-json           Simulate, quiet but print JSON information
                                 for each command-line argument. If the URL
                                 refers to a playlist, dump the whole
                                 playlist information in a single line.
@dstftw dstftw closed this Dec 17, 2019
@BlisteringSyko
Copy link
Author

@BlisteringSyko BlisteringSyko commented Dec 17, 2019

Thanks. Did the trick using jq to get the value of title.

#! /bin/bash
export LC_ALL=en_US.UTF-8
name=$(youtube-dl --no-warnings --dump-single-json $1 | jq -r '.title')
echo $name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.