chapmanjacobd / library

80+ CLI tools to build, browse, and blend your media library: an index for your archive.
BSD 3-Clause "New" or "Revised" License
355 stars 9 forks source link

Add --live option #41

Closed deldesir closed 2 months ago

deldesir commented 2 months ago

Description

This pull request introduces a new --live flag to enable the download of live videos. This flag adjusts the match filters to include live streams, which were previously excluded by default.

Motivation and Context

The primary motivation for this change is to allow users to download live videos directly, a feature that was not supported due to default match filters excluding live content.

Some context: https://github.com/iiab/calibre-web/issues/188

How has this been tested?

The changes were tested by:

Screenshots (if appropriate):

image

Types of changes

Checklist:

holta commented 2 months ago

@deldesir what happens when someone accidentally tries to download a "genuinely live" YouTube video — that's actually being recorded live at that moment — e.g. a video from a nature scientist's webcam, that might never end?

(As distinct from "formerly live" YouTube videos, which people are currently / unfortunately being blocked from downloading!)

deldesir commented 2 months ago

It will be downloaded from the current time. This is the default behavior. To download it from the start --live-from-start must be passed. For finished streams, the whole video will be downloaded though.

holta commented 2 months ago

It will be downloaded from the current time.

Are you saying the download will never end?

This is the default behavior. To download it from the start --live-from-start must be passed.

Interesting!

For finished streams, the whole video will be downloaded though.

Certainly that's the priority use case needing a fix:

My concern is that educators/parents who accidentally try to download "genuinely live" YouTube videos, should be able to gracefully recover:

  1. Either we should inform them of their mistake, or
  2. Download partial video using --live-from-start and/or
  3. Give thoughtful consideration to educators/parents who accidentally download years-and-years of a nature scientist's continuous webcam video (probably not what the educator/parent wants — at least in many cases?)
deldesir commented 2 months ago

From yt-dlp README:

holta commented 2 months ago

It will be downloaded from the current time.

Are you saying the download will never end?

I had (wrongly) assumed YouTube could record videos of nearly endless duration, e.g. from a wilderness scientist's webcam.

In fact, YouTube video recordings seem to currently be limited to "12 hours long, or 128 GB" according to https://www.quora.com/Whats-the-maximum-video-length-on-YouTube-or-is-it-dependent-on-video-size

holta commented 2 months ago

Just FYI I'm trying to understand the true high-level objectives here.

So @deldesir is helping to explain some of those underlying motivations (and needs) in this conversation here:

chapmanjacobd commented 2 months ago

yeah this looks good. can you add @skip("network") to the test?

deldesir commented 2 months ago

Done.

chapmanjacobd commented 2 months ago

https://github.com/chapmanjacobd/library/commit/a49e1a01cc1f765728bf43143f469ff15c5ab1b9

https://github.com/chapmanjacobd/library/actions/runs/9687571930