我看到youtube-dl我可以使用文件名中的变量来构建输出文件名,如其所示手册页。
但在我的例子中,许多变量都不可用。如何将视频中包含的 TEMPLATE OUTPUT 的所有值转储到文件中?
答案1
youtube-dl --get-filename -o 'id:%(id)stitle:%(title)surl:%(url)sext:%(ext)salt_title:%(alt_title)sdisplay_id:%(display_id)suploader:%(uploader)slicense:%(license)screator:%(creator)srelease_date:%(release_date)stimestamp:%(timestamp)supload_date:%(upload_date)suploader_id:%(uploader_id)schannel:%(channel)schannel_id:%(channel_id)slocation:%(location)sduration:%(duration)sview_count:%(view_count)slike_count:%(like_count)sdislike_count:%(dislike_count)srepost_count:%(repost_count)saverage_rating:%(average_rating)scomment_count:%(comment_count)sage_limit:%(age_limit)sis_live:%(is_live)sstart_time:%(start_time)send_time:%(end_time)sformat:%(format)sformat_id:%(format_id)sformat_note:%(format_note)swidth:%(width)sheight:%(height)sresolution:%(resolution)stbr:%(tbr)sabr:%(abr)sacodec:%(acodec)sasr:%(asr)svbr:%(vbr)sfps:%(fps)svcodec:%(vcodec)scontainer:%(container)sfilesize:%(filesize)sfilesize_approx:%(filesize_approx)sprotocol:%(protocol)sextractor:%(extractor)sextractor_key:%(extractor_key)sepoch:%(epoch)sautonumber:%(autonumber)splaylist:%(playlist)splaylist_index:%(playlist_index)splaylist_id:%(playlist_id)splaylist_title:%(playlist_title)splaylist_uploader:%(playlist_uploader)splaylist_uploader_id:%(playlist_uploader_id)schapter:%(chapter)schapter_number:%(chapter_number)schapter_id:%(chapter_id)sseries:%(series)sseason:%(season)sseason_number:%(season_number)sseason_id:%(season_id)sepisode:%(episode)sepisode_number:%(episode_number)sepisode_id:%(episode_id)strack:%(track)strack_number:%(track_number)strack_id:%(track_id)sartist:%(artist)sgenre:%(genre)salbum:%(album)salbum_type:%(album_type)salbum_artist:%(album_artist)sdisc_number:%(disc_number)srelease_year:%(release_year)s'
或者:
youtube-dl -j <URL> | jq 'del(.formats, .requested_formats, .thumbnails, .thumbnail)'