Giter Club home page Giter Club logo

cobalt's Introduction

cobalt

best way to save what you love: cobalt.tools

cobalt logo with repeated logo (double arrow) pattern background

πŸ’¬ community discord server
🐦 twitter/x

what's cobalt?

cobalt is a media downloader that doesn't piss you off. it's fast, friendly, and doesn't have any bullshit that modern web is filled with: no ads, trackers, or invasive analytics.

paste the link, get the file, move on. it's that simple. just how it should be.

supported services

this list is not final and keeps expanding over time. if support for a service you want is missing, create an issue (or a pull request πŸ‘€).

service video + audio only audio only video metadata rich file names
bilibili.com & bilibili.tv βœ… βœ… βœ… βž– βž–
dailymotion βœ… βœ… βœ… βœ… βœ…
instagram posts & reels βœ… βœ… βœ… βž– βž–
facebook videos βœ… ❌ ❌ βž– βž–
loom βœ… ❌ βœ… βœ… βž–
ok video βœ… ❌ βœ… βœ… βœ…
pinterest βœ… βœ… βœ… βž– βž–
reddit βœ… βœ… βœ… ❌ ❌
rutube βœ… βœ… βœ… βœ… βœ…
snapchat stories & spotlights βœ… βœ… βœ… βž– βž–
soundcloud βž– βœ… βž– βœ… βœ…
streamable βœ… βœ… βœ… βž– βž–
tiktok βœ… βœ… βœ… ❌ ❌
tumblr βœ… βœ… βœ… βž– βž–
twitch clips βœ… βœ… βœ… βœ… βœ…
twitter/x βœ… βœ… βœ… βž– βž–
vimeo βœ… βœ… βœ… βœ… βœ…
vine archive βœ… βœ… βœ… βž– βž–
vk videos & clips βœ… ❌ βœ… βœ… βœ…
youtube videos, shorts & music βœ… βœ… βœ… βœ… βœ…
emoji meaning
βœ… supported
βž– impossible/unreasonable
❌ not supported

additional notes or features (per service)

service notes or features
instagram supports reels, photos, and videos. lets you pick what to save from multi-media posts.
facebook supports public accessible videos content only.
pinterest supports photos, gifs, videos and stories.
reddit supports gifs and videos.
snapchat supports spotlights and stories. lets you pick what to save from stories.
rutube supports yappy & private links.
soundcloud supports private links.
tiktok supports videos with or without watermark, images from slideshow without watermark, and full (original) audios.
twitter/x lets you pick what to save from multi-media posts. may not be 100% reliable due to current management.
vimeo audio downloads are only available for dash.
youtube supports videos, music, and shorts. 8K, 4K, HDR, VR, and high FPS videos. rich metadata & dubs. h264/av1/vp9 codecs.

cobalt api

cobalt has an open api that you can use in your projects for free~. it's easy and straightforward to use, check out the docs to learn how to use it.

βœ… you can use the main api instance (api.cobalt.tools) in your personal projects.
❌ you cannot use the free api commercially (anywhere that's gated behind paywalls or ads). host your own instance for this.

we reserve the right to restrict abusive/excessive access to the main instance api.

how to run your own instance

if you want to run your own instance for whatever purpose, follow this guide.
it's highly recommended to use a docker compose method unless you run for developing/debugging purposes.

partners

cobalt is sponsored by royalehosting.net, all main instances are currently hosted on their network :)

ethics and disclaimer

cobalt is a tool for easing content downloads from internet and takes zero liability. you are responsible for what you download, how you use and distribute that content. please be mindful when using content of others and always credit original creators. fair use and credits benefit everyone.

cobalt is NOT a piracy tool and cannot be used as such. it can only download free, publicly accessible content. such content can be easily downloaded through any browser's dev tools. pressing one button is easier, so i made a convenient, ad-less tool for such repeated actions.

cobalt license

cobalt code is licensed under AGPL-3.0.

cobalt branding, mascots, and other related assets included in the repo are copyrighted and not covered by the AGPL-3.0 license. you cannot use them under same terms.

you are allowed to host an unmodified instance of cobalt with branding, but this does not give you permission to use it anywhere else, or make derivatives of it in any way.

notes:

  • mascots and other assets are a part of the branding.

  • when making an alternative version of the project, please replace or remove all branding (including the name).

  • you must link the original repo when using any parts of code (such as using separate processing modules in your project) or forking the project.

  • if you make a modified version of cobalt, the codebase must be published under the same license (according to AGPL-3.0).

3rd party licenses

acknowledgements

ffmpeg

cobalt heavily relies on ffmpeg for converting and merging media files. it's an absolutely amazing piece of software offered for anyone for free, yet doesn't receive as much credit as it should.

you can support ffmpeg here!

ffmpeg-static

we use ffmpeg-static to get binaries for ffmpeg depending on the platform.

you can support the developer via various methods listed on their github page! (linked above)

youtube.js

cobalt relies on youtube.js for interacting with the innertube api, it wouldn't have been possible without it.

you can support the developer via various methods listed on their github page! (linked above)

many others

cobalt also depends on:

  • content-disposition-header to simplify the provision of content-disposition headers.
  • cors to manage cross-origin resource sharing within expressjs.
  • dotenv to load environment variables from the .env file.
  • esbuild to minify the frontend files.
  • express as the backbone of cobalt servers.
  • express-rate-limit to rate limit api endpoints.
  • hls-parser to parse m3u8 playlists for certain services.
  • ipaddr.js to parse ip addresses (for rate limiting).
  • nanoid to generate unique (temporary) identifiers for each requested stream.
  • node-cache to cache stream info in server ram for a limited amount of time.
  • psl as the domain name parser.
  • set-cookie-parser to parse cookies that cobalt receives from certain services.
  • undici for making http requests.
  • url-pattern to match provided links with supported patterns.

...and many other packages that these packages rely on.

cobalt's People

Contributors

adrigoomy avatar alyx avatar blobadoodle avatar bramaudi avatar busybox11 avatar coolvrdude avatar deepsource-io[bot] avatar deepsourcebot avatar devilr33f avatar drwarpman avatar dumbmoron avatar gptgit avatar hexandcube avatar hyperdefined avatar ihatespawn avatar j4mez avatar jojobii-arks avatar jsopn avatar kwiatekmiki avatar lexito-o avatar lyfev avatar miraisubject avatar mxr avatar otomir23 avatar plusreed avatar snazzah avatar synzr avatar teidesu avatar wukko avatar yerrak00 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cobalt's Issues

Add estimated file size to stream API responses

For streamDefault just pass through the Content-Length header, for the rest parsing the ffmpeg output might be required. I can send a PR, do you have example URLs/settings for all the different types?

Twitter links return 400

image

Test both on my own instance (running af1fc24) and on https://co.wukko.me.

Tested with this link: (and many other random videos) https://twitter.com/FreelanceMocha/status/1576304807794552833, returns 400.

https://co.wukko.me/api/json?audioFormat=best&quality=max&url=https%3A%2F%2Ftwitter.com%2FFreelanceMocha%2Fstatus%2F1576304807794552833

https://co.hyper.lol/api/json?audioFormat=best&quality=max&url=https%3A%2F%2Ftwitter.com%2FFreelanceMocha%2Fstatus%2F1576304807794552833

image

Memory leak issue caused by incorrect node-cache configuration

no idea if this is caused by cobalt itself or my nginx configuration, but after a few days way more ram is used by the server that cobalt is hosted on. i'll have a look into this issue in a few days (if ram usage ramps up again). if you host your own instance, you can help by checking if this issue applies to you too.

image

Setup script is confusing

Current and Crowdin (3.5.2). Test on YouTube and VK (audio, video):

cobalt

Trying to download from YouTube resulted in a warning:

cobalt

After trying to update: "npm install npm@latest -g". There is no result, no matter what the order. Problem with code or with npm 8.19.2/node 18.9.0, maybe this version does not work correctly with this code.

Your service on co.wukko.me is now work. And yes turn that shit off: https://github.com/wukko/cobalt/blob/current/src/modules/sub/currentCommit.js

TikTok links with dots on the username dont work

TikTok links can include the username in them, and usernames can include dots, seems like cobalt breaks trying to recognize them as tiktok links and throws an "it seems like this service is not supported yet or your link is invalid."
example link: https://www.tiktok.com/@random.video.on.tiktok/video/7090355705605016859

also, as a band-aid fix, seems like replacing the username with something else without the dots makes it work on cobalt, as tiktok redirects to the good one.
https://www.tiktok.com/@a/video/7090355705605016859

Add option to switch languages in settings

I can't seem to find an option to switch languages in the settings and the process of switching languages appears to be entirely bound to the system locale. An option to manually pick a language would be nice.

Support Bulk Downloads

This is working perfectly with Reddit videos. They're a real pain to download since they split the audio in a separate file.
What would make this really great is a window to paste some urls and let it go one by one with some custom wait time between them.
Could it be done?

I'm not able to download anything

Hello,

I tried going to https://co.wukko.me/ and I pasted the link https://www.youtube.com/watch?v=OvhVLmD0DfQ with auto mode on and I got the error saying that I have sent too many requests. However, the issue is that I haven't even used the site yet. I have visited the site before to check it out and see how it worked but never used it to download anything. And no, I didn't spam the button, I pressed it once.

Hope this issue is resolved soon, this site looks promising!

Audio of a certain youtube video cuts out in the middle when downloading in video mode

When downloading ぼっけロック in video mode, its audio cuts out at around the 1-minute mark. It isn't consistent, sometimes it happens earlier, sometimes later (differs by only a couple of seconds) and it doesn't happen when downloading it in audio mode. This video seems to have some issues on youtube itself, since (at least for me) also around the 1-minute mark the video briefly stops and buffers before resuming.

YouTube sometimes drops packets near the end of audio during live render

only possible reason i can think of is download speed or duration. don't know whether it's possible for ffmpeg to pre-fetch one of inputs before merging them together, but this would be one of possible solutions.

cobalt could instead cache the audio file before live render, but that could lead to even more issues.

Problem with processing mp4 audio

On mobile, I have been constantly facing an issue when I try to download any youtube video that’s longer than 1 minute to an mp4. I find that usually after the first half, the video is suddenly missing its audio.

I have yet to check if I face the same issue on pc, so keep that in mind. If needed, I could go check when I have time.

CORS restricts API access

I'm not sure if this is intentional or not, but trying to access an API endpoint at co.wukko.me via JavaScript (in this case, within a Firefox extension) will throw a CORS error, probably due to the header access-control-allow-origin: https://co.wukko.me/. I'm not sure, but I'd assume this is not intended behavior for an open API.
Screen Shot 2022-11-17 at 9 47 01 AM

Videos downloaded are incredibly long

For some reason, any time i download a video from youtube, the video is registered as extremely long, for example, one video i had downloaded was listed as being 256204778 hours long (or 29247 years). While the video file does not take up much space, on average being about 1.5 mb for a 15 second video, it is impossible to share it to any other services without getting a file size warning.

YouTube mp4 videos are impossible to play properly on less advanced players

i downloaded a youtube video and tried to trim it using the windows video trimmer, it wouldnt let me trim it. also this happened
image
(i dowloaded it as a max-quality mp4)
if i tried to import it into any other video editor it shows an error

when i try to view the file's properties it shows a null length, and 0kbps audio??? im not exactly an ffmpeg master so i dont exactly know what causes this
image

also the file opens normally when viewing it
image

Tiktok workflow is broken

Tested it locally on latest version, and also manually tested script part for tiktok.
Looks like it gives an error on step when you're trying to get html body of post page, before searching of file src.

Also I've found something strange in response

rejectUnauthorized: true,
session: undefined,

Maybe now we need to login before trying to find source link.
Any ideas?

/api/stream returns Unauthorized

When making a POST request with the following data:

{"url": "https://www.youtube.com/watch?v=[url]"}

it returns 200 OK with the following data:

{
    "status": "stream",
    "url": "https://co.wukko.me/api/stream?t=[...]&e=[...]&h=[...]"
}

Opening that URL returns this:

{"status":"error","text":"Unauthorized"}

NicoNico support

This will be useful because other downloaders are hard to find and it might just not work.

Some research

NicoNico video pages has authorization data for guest user in HTML attribute with id="js-initial-watch-data".

Front-end web sends to POST request to https://api.dmc.nico/api/sessions?_format=json (The DMC service; Modern delivery system) with JSON body of some data from authorization data.

The DMC service will respond with authorized URL to the master M3U8. And yes, NicoNico uses HLS VOD...

Preview URLs

Add support for Reddit GIFs

image
Attempted to download https://www.reddit.com/r/whenthe/comments/10vxtjj/imagine_using_this_against_like_a_fucking_cartel/

Public Twitter accounts that were flagged as adult content or age-restricted are no longer possible to download images, videos or mixed media from

Previously, Cobalt allowed you to download images, videos and mixed media from any public account. Then, downloading mixed media bugged outβ€”only allowing the first image or video in a series of four. Then, now it just completely disallows download from age-restricted accounts even if they're public.

The error message is:

uh-oh...

an error occurred when i tried to get info about your link. are you sure it works? check if it does, and try again.

Here's an example link, from a person uploading "safe" samples of his paid content: https://twitter.com/leathersambam88/status/1589098906616745986 - Try loading his profile in incognito/private mode and it would show the age-restricted message. Cobalt used to be able to download these just fine.

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.