ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.32k stars 10.03k forks source link

Youtube - Download according to timestamps. #24858

Open kettenfett opened 4 years ago

kettenfett commented 4 years ago

Description

It seems, youtube is now using information found in timecodes in the video description and displays them in the videoplayer like so: grafik

It may have been like this for some time, but I saw it for the first time today (link to video).

Can this be used by youtube-dl to offer a download option, that automatically downloads the individual videos/audios according to these timecodes?

Checklist

wattux commented 4 years ago

The extractor already gets thoses tracks as "chapters". I'm not really into that project base, but I guess adding a new FFmpegPostProcessor for splitting the resulting file into own tracks is a good approach?

I'm playing around with that for a bit

jtagcat commented 4 years ago

Instead of splitting to separate files, what about mapping the timestamps to chapters?

wattux commented 4 years ago

afaik the timestamps are already parsed into those chapters. At least thats were I got them from.

jtagcat commented 4 years ago

image

youtube-dl https://www.youtube.com/watch?v=zPuELAzJyno image

No chapters, not fully sure if talking about the same thing.

wattux commented 4 years ago

We were kinda. I was talking about the chapters raw, internal data, created by the extractors. I guess they are just not included in the local file by default. Maybe there is an extra argument for that

jtagcat commented 4 years ago

We were kinda. I was talking about the chapters raw, internal data, created by the extractors. I guess they are just not included in the local file by default. Maybe there is an extra argument for that

F3 in the main readme for chapter and timestamp did not yield any results.

dyloxim commented 4 years ago

being able to split a video into multiple files according to these timestamps (with the result the same as if the files had been downloaded from a playlist of those segments) would be great

dogancelik commented 4 years ago

I want to see the timestamps in VLC / Media Player Classic. How can I embed chapters of the video when I download it with youtube-dl -f bestaudio URL? I only want the audio and the timestamps with titles embedded inside the file.

lyz-code commented 4 years ago

I've found crisbal/album-splitter which does exactly this, maybe it can be used as inspiration

darkred commented 3 years ago

For reference, here's another approach, a awk/bash script: https://github.com/Pab0/album_splitter

Syntax:

./album_splitter.sh URL [download_location]

It uses youtube-dl, ffmpeg and awk: The youtube webpage is fetched (--get-description) and the video's description is parsed (using 'format_titles.awk') for titles and timestamps/tracks. Then the album file (e.g. webm) is downloaded (--get-title), converted to audio (--extract-audio --audio-format mp3), and split (using 'split_audio.awk') into single tracks according to the parsed track information.

makew0rld commented 3 years ago

It would be helpful if the chapters could also be downloaded as a data file, so that the timestamps and the names of the chapters can be archived and used later. Perhaps it could be included in the .info.json file that's enabled with --write-info-json?

Please let me know if I should make a separate issue for this.

xantares commented 3 years ago

@femaref your commit looks promising, any updates on this ?

femaref commented 3 years ago

@femaref your commit looks promising, any updates on this ?

not more than is in the fork I'm afraid. I can do a PR for what's there.

xantares commented 3 years ago

yes, please

SpL1Ne commented 3 years ago

Yet another rough and simple powershell script: https://gist.github.com/SpL1Ne/54d8c8d036f58b8afb89eaa34ce77fd0