Giter Club home page Giter Club logo

youtubesegmentdownloader's Introduction

Youtube Segment Downloader

What's this?

A lifesaver for anyone who is doing video clipping/translating or any need to download segments from Youtube.

GitHub release (latest SemVer) GitHub Release Date GitHub all releases

Preview

Windows .NET 8.0 GitHub

The software can only be run on Windows x64 platforms.

Feature

Download Youtube video in segment
In detail, you can download only one segment in the middle of the video instead of downloading the whole video.

This software is built on yt-dlp and FFmpeg.
If you don't have them installed, this software will download them automatically at startup.

Can accept Youtube clips too!
Try to put this in the Youtube Link textbox: https://youtube.com/clip/UgkxdTb9o6I2pTr87wKgpO0kLEaZbYrkMDFv
It will be converted to id, start, and end time immediately.

Use the Youtube login status in your browser.
Select your login browser and download the membership video/your private video.

The output video format conforms to the Youtube recommendation for uploading!
Recommended upload encoding settings - YouTube Help

The download format can be specified.
Input the format such as 303+251

Note: The video will be downloaded in this format and will ALWAYS be re-encoded to mp4 format.
Re-encoded is needed after cutting the video. Please read the details below.

I18n 多國語系
我做了中文介面
I only speak Chinese. Feel free to send me PR if you add more languages!

It can accept any yt-dlp supported site.
I only support Youtube, but this application can theoretically be used on any site supported by yt-dlp.
The actual situation depends on the video format and whether ffmpeg can index it correctly, but it's still worth a try.
For reference, I have had success with Youtube, Twitch, and niconico.

Install

Get the latest release GitHub release (latest SemVer)

Please download and install with the setup.exe

  • Automatically check for upgrades when launching this software update
  • Setup installer will install .NET 8.0 Runtime for you
  • Setting shortcuts on the Desktop and Start Up Menu

Or you can just download YoutubeSegmentDownloader.exe, if you don't care about the above.

Why not just use yt-dlp with ffmpeg -ss -to?

Nope, not enough.

According to FFmpeg docs about -ss:

Note that in most formats it is not possible to seek exactly, so ffmpeg will seek to the closest seek point before position. When transcoding and -accurate_seek is enabled (the default), this extra segment between the seek point and position will be decoded and discarded. When doing stream copy or when -noaccurate_seek is used, it will be preserved.

Then the download is actually a streaming copy, so you won't get an accurate cut of it.

For example, downloading this video from 230s ~ 250s

yt-dlp --downloader ffmpeg --downloader-args "ffmpeg_i:-ss 230 -to 250" 89kXyUCenD0 

yt-dlp --download-sections "*230-250" is actually equivalent to --downloader ffmpeg --downloader-args "ffmpeg_i:-ss 230 -t 20" *ref

would result in a video duration of 29.98 seconds, with the first 7 seconds being corrupted. This is inaccurate by, well, about 10 seconds. This is because the last seek point is around 220s, so it cuts off 220s ~ 250s.

To solve this, use ffmpeg to seek it again with transcoding.

ffmpeg -sseof -20 -i just_downloaded.webm good.webm

-sseof likes the -ss option but relative to the "end of file".

So, you have to do two steps, plus a simple math calculation. It's not that much of a hassle, but it's enough to get a lazy programmer move.

LICENSE

Note

This software uses FFmpeg licensed under the GPLv3.
FFmpeg binary distributions will be downloaded from here.
FFmpeg source code can be found here.

This software uses yt-dlp licensed under the Unlicense License.
yt-dlp binary distribution will be downloaded from here.

This software uses Xabe.FFmpeg licensed under the License Agreement with Non-commercial use - Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0).

This software uses Beautiful Flat Icons licensed under the GPLv2.
Icon source can be found here.

gpl

GNU GENERAL PUBLIC LICENSE Version 3

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.


A winform project written in .NET 6 7 8 and CI/CD the ClickOnce installer on the github workflow.
I think I'll stop it at .NET 8 since it's LTS.
Anyone want to turn it into MAUI? ¯\_(ツ)_/¯

CodeFactor DeepSource
FOSSA Status

youtubesegmentdownloader's People

Contributors

deepsource-io[bot] avatar jim60105 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

youtubesegmentdownloader's Issues

Crash when the download time is too long

New issue from: @s3840jeff #6 (comment)

您好,再度叨擾 回報近期使用狀況
近期使用YSD下載影片時,即高機率會程式關閉(直接消失)
如果是抓短片還有機會在程式當機(消失)前下載完成
但我時常需要抓自己實況VOD檔,基本上都數小時起跳,一定會遇到程式當機
偏偏YT能提供的後台下載影片只有720P 30FPS 做後製剪接不好用
只好再次和您回報問題,希望能尋求解方。

Add `--proxy` option to yt-dlp

Thanks for your lifesaver.👍

When downloading video segments, ffmpeg cannot automatically use the system proxy and return error with Error number -138 occurred . Adding --proxy to yt-dlp can solve this issue.

無法更新FFmpeg

您好,11月底時有在您當初PO YSD的FB文章下留言未果,只好於12月底在您最近的FB文章下留言。

自從11月更新後,我YSD軟體自動更新時,FFmpeg會一直呈現沙漏狀態無法更新(如圖),重新下載YSD去更新也是一樣。
雖然GIHUB上似乎可以下載FFmpeg,但github的使用介面對一般人真的很難使用,下載到一些原始碼,也不太知道如何手動更新。
就如同這次回報issue使用信件,也是額外申請帳號才能回報給您。

image

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.