https://github.com/ajayos/yt-download.rb
ruby script for download youtube shorts media.
https://github.com/ajayos/yt-download.rb
Last synced: about 2 months ago
JSON representation
ruby script for download youtube shorts media.
- Host: GitHub
- URL: https://github.com/ajayos/yt-download.rb
- Owner: Ajayos
- License: apache-2.0
- Created: 2022-07-04T17:05:05.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-16T08:55:49.000Z (almost 3 years ago)
- Last Synced: 2025-03-02T13:05:06.395Z (about 2 months ago)
- Language: Ruby
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README




#### What's this?
* this is a ruby module/script for download youtube shorts video
looks like usually youtube videos. but i make it like different.
----------
#### installing package
```bash
* Install with gems
> gem install yt-download
* Install from github
> gem 'yt-download', :git => 'git://github.com/Ajay-o-s/yt-download.rb.git'
```### use as module
* importing
```ruby
irb(main):002:0> require "yt-download"
irb(main):005:0> short = YoutubeShort.new("https://youtube.com
/shorts/?feature")
```* Get json data
```ruby
irb(main):019:0> js_data = short.parseJS(short.getPage(short.shorts_
url)) =>
# result:
{
"author"=>"",
"title"=>"",
"duration"=>"",
"tags"=> "" # nil if nothing tags
"description"=> ""
}
```* running to download
```ruby
irb(main):000:0> short.Main()
```* Audio with video
```ruby
irb(main):022:0> short.formats
=>
[{
"link"=> "https://rr3---sn-uxa3vhnxa-nvjl.googlevideo.com/.....",
"type"=>"video/mp4",
"quality"=>"360p",
"bitrate"=>598208
}, "{....}"]
```* Just fomat only ,eg: .webm, .mp4
```ruby
irb(main):022:0> short.adaptiveFormats
=>
[{
"link"=> "https://rr3---sn-uxa3vhnxa-nvjl.googlevideo.com/.....",
"type"=>"video/mp4",
"quality"=>"1080p",
"bitrate"=> 1954462
}, "{....}"]
```### CLI Command
```bash
┬ ┬ ─┬─
└┬┘ │
┴ ┴
[ • a simple ruby youtube video downloader • ]
┴┴┴┴┴┴┴┴┴┴[ • github.com/Ajay-o-s • ]┴┴┴┴┴┴┴┴┴
Usage: yt-download.rb [options] / -h
-u, --url url url youtube short
-o, --output output output path download
-s, --savetube savetube yt-download.savetube.me cli version
-t, --type type Type formats for savetube, only: audio & video
-h, --help show all options and exit
````
* Use cli command
```
yt-download-dl -u -o
# default output is where you run the command.
# for savetube
yt-download-dl -s -t -o
```### problems
* Sometimes can't get stream url. /nothing valid stream url in
the short pages.