Giter Site home page Giter Site logo

Comments (2)

pukkandan avatar pukkandan commented on August 20, 2024

I believe it can already be done with --match-filter. Pls provide some examples I can test commands on

from yt-dlp.

bashonly avatar bashonly commented on August 20, 2024

Here's the long-awaited example URL: https://www.youtube.com/watch?v=nGIpdiQrFDU

yt-dlp does indeed fetch the sponsorblock data after --match-filter is checked against, so it is not currently possible to do this in a single run of yt-dlp.

There is a workaround, however; you could do something like this (for a single video):

yt-dlp --write-info-json --skip-download --sponsorblock-mark all -o "sponsorblock_check.%(ext)s" "https://www.youtube.com/watch?v=nGIpdiQrFDU" && yt-dlp --load-info-json "sponsorblock_check.info.json" --match-filter sponsorblock_chapters

Any additional options for downloading could be passed to the second invocation of yt-dlp (so anywhere after --match-filter sponsorblock_chapters), e.g. if you want to use --sponsorblock-mark all or --sponsorblock-remove all, you would add them there.

Note that you do not need to pass the URL to the second invocation; all data is being extracted from the info json written by the first yt-dlp call.

Here's a slightly more advanced example of a workaround that could be used with a playlist/channel or --batch-file/-a:

yt-dlp --write-info-json --skip-download --sponsorblock-mark all -o "sponsorblock_check.%(ext)s" --batch-file links.txt --exec "yt-dlp --load-info-json sponsorblock_check.info.json --match-filter sponsorblock_chapters --sponsorblock-remove sponsor"

Note that any output template args should be stashed in a config file since they will not be passed to the inner yt-dlp call correctly if done in the command line.

from yt-dlp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.