I can use youtube-dl
with the --dump-json
option and jq
to get the uploader of a video:
uploader=$(youtube-dl --dump-json "$video_url" | jq -r '.uploader')
Is there a way to get the creator of a playlist in a similar way?
youtube-dl -j "$playlist_url"
returns a list of videos but no information about the playlist creator.
As @Seth suggests in his answer I can use the --skip-download
and --output
options. Experimenting a bit I figured out that the --output option will not put any extra info in the json data. However, calling youtube-dl
like this:
youtube-dl --skip-download --playlist-end 1 --output '%(playlist_uploader)s/%(title)s.%(ext)s' "$playlist_url"
does create a folder with the name of the playlist uploader. This folder I can the get using the find
command like so:
find . -type d -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "
as suggested in this answer to a question at stackoverflow.com. This is even more roundabout than what @Seth suggests but it does solve my problem.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments